Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kencoba/0c81e435d32fc092bf8173098dc60b8c to your computer and use it in GitHub Desktop.
Save kencoba/0c81e435d32fc092bf8173098dc60b8c to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install vim emacs -y
sudo apt-get install apache2 -y
sudo apt-get install mysql-server -y
sudo apt-get install php -y
sudo apt-get install libapache2-mod-php -y
sudo apt-get install php-curl php-mysql php-xml php-xmlrpc php-gd php-intl php-zip php-mbstring php-soap -y
sudo /etc/init.d/apache2 restart
sudo apt-get install git -y
cd /opt
git clone -b MOODLE_31_STABLE git://git.moodle.org/moodle.git
sudo cp -R /opt/moodle /var/www/html/
sudo mkdir /var/www/moodledata
sudo chown -R www-data /var/www/moodledata
sudo chmod -R 777 /var/www/moodledata
sudo chmod -R 0755 /var/www/html/moodle
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld_safe]
default-character-set=utf8
[mysqld]
character-set-server=utf8
skip-character-set-client-handshake
default-storage-engine=INNODB
sudo vi /etc/mysql/conf.d/mysql.cnf
[mysql]
default-character-set=utf8
sudo vi /etc/mysql/conf.d/mysqldump.cnf
[mysqldump]
default-character-set=utf8
sudo service mysql restart
mysql -u root -p -e 'CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci'
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodleuser@localhost IDENTIFIED BY 'password'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment