- Silakan login via SSH ke server masing-masing.
- Selalu update dan upgrade paket yang ada jika ada update dari Ubuntu [sourcecode] sudo apt-get update && sudo apt-get -y upgrade [/sourcecode]
Kita butuh beberapa software yang akan kita gunakan seperti Git dan python-software-properties. [sourcecode] sudo apt-get install python-software-properties software-properties-common git curl vim graphviz aspell [/sourcecode]
Install MariaDB 10 dengan perintah berikut: [sourcecode] sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu trusty main' sudo apt-get install mariadb-server [/sourcecode]
Setting server MariaDB dengan perintah mysql_secure_installation.
Kemudian Restart server MariaDB itu dengan perintah sudo service mysqld restart
Login ke server MariaDB dan buat database dan user untuk Moodle
[sourcecode] mysql -uroot -p MariaDB [(none)]> CREATE DATABASE moodle; MariaDB [(none)]> GRANT ALL PRIVILEGES ON moodle.* TO 'userbaru'@'localhost' IDENTIFIED BY 'passwordnyaini'; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> \q [/sourcecode]
Deploy source code MOODLE terbaru dari server Git mereka: [sourcecode] mkdir -p /var/www/moodle/{public_html,logs} git clone -b MOODLE_28_STABLE git://git.moodle.org/moodle.git /var/www/moodle/public_html [/sourcecode]
Buat direktori data MOODLE: [sourcecode] mkdir /var/www/moodledata/ [/sourcecode]
Install PHP-FPM dan Nginx [sourcecode] sudo apt-get install nginx php5-fpm php5-cli php5-pspell php5-intl php5-xmlrpc php5-gd php5-mysqlnd php5-curl php5-gd [/sourcecode]
Atur Konfigurasi PHP-FPM [sourcecode] sudo tee /etc/php5/fpm/pool.d/$(whoami).conf << EOF [$(whoami)] user = $(whoami) group = $(whoami) listen = /var/run/php5-fpm-$(whoami).sock listen.owner = $(whoami) listen.group = $(whoami) listen.mode = 0666 pm = ondemand pm.max_children = 5 pm.process_idle_timeout = 10s; pm.max_requests = 200 chdir = / EOF [/sourcecode]
Restart PHP-FPM dengan perintah sudo service php5-fpm restart.
Buat file konfigurasi situs kita di Nginx [sourcecode] sudo tee /etc/nginx/sites-available/moodle.emka.web.id << EOF server { server_name moodle.emka.web.id; listen 80; root /var/www/moodle/public_html; access_log /var/www/moodle/logs/access.log; error_log /var/www/moodle/logs/error.log; index index.php; location / { try_files \$uri \$uri/ /index.php?\$args; } location ~* \.(?:ico|css|js|gif|jpe?g|png|ttf|woff)\$ { access_log off; expires 30d; add_header Pragma public; add_header Cache-Control "public, mustrevalidate, proxy-revalidate"; } location ~ \.php\$ { fastcgi_split_path_info ^(.+\.php)(/.+)\$; fastcgi_pass unix:/var/run/php5-fpm-$(whoami).sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; fastcgi_intercept_errors off; fastcgi_buffer_size 16k; fastcgi_buffers 4 16k; } location ~ /\.ht { deny all; } } EOF [/sourcecode]
Aktifkan konfigurasi tersebut dengan symbolic link ke sites-enabled: [sourcecode] sudo ln -s /etc/nginx/sites-available/moodle.emka.web.id /etc/nginx/sites-enabled/moodle.emka.web.id [/sourcecode]
Restart NGINX dengan perintah sudo nginx -t && sudo service nginx restart
Kunjungi halaman web (misal: moodle.emka.web.id) dan lanjutkan instalasi MOODLE via web. Jangan lupa, direktori moodle data kita adalah /var/www/moodledata.