diff --git a/README.md b/README.md index 0625895..257742b 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,7 @@ Kemudian kita akan membuat virtualhost untuk masing-masing website -#1 Virtualhost untuk prestashop +**1. Virtualhost untuk prestashop** ``` # Vim /etc/httpd/cong.d/prestashop.conf ``` @@ -230,7 +230,7 @@ Kemudian perhatikan SetHandler “proxy:fcgi://127.0.0.1:9071” , disini kita mengarahkan setiap pemrosesan php ke php7.1, ingat tadi pada konfigurasi php7.1 kita mengubah listen port menjadi 9071 -#2 Virtualhost untuk wordpress +**2. Virtualhost untuk wordpress** ``` ServerName wordpress.task.my.id @@ -253,7 +253,7 @@ ``` Disini kita sesuaikan juga user dan listen portnya menjadi :9072 -#3 Virtualhost untuk nextcloud +**3. Virtualhost untuk nextcloud** ``` ServerName nextcloud.task.my.id @@ -343,3 +343,136 @@ Content-Type: text/html; charset=UTF-8 ``` Perhatikan pada bagian X-Powered-By: PHP/ pastikan versi php nya sudah cocok dengan yang kita inginkan + +#### Step 2: Konfigurasi reverse proxy nginx +Buat server block yang akan di gunakan sebagai reverse proxy yang mengarak pada masing-masing website + +Prestashop +``` +# vim /etc/nginx/conf.d/prestashop.conf +``` +Kemudian isikan +``` +server { + listen 80; + server_name prestashop.task.my.id; + + location / { + proxy_set_header Host $host; + proxy_set_header Accept-Encoding ""; + proxy_pass http://prestashop.task.my.id:8080; + } +} +``` + +Wordpress +``` +server { + listen 80; + server_name wordpress.task.my.id; + + location / { + proxy_set_header Host $host; + proxy_set_header Accept-Encoding ""; + proxy_pass http://wordpress.task.my.id:8080; + } +} +``` +Nextcloud +``` +server { + listen 80; + server_name nextcloud.task.my.id; + + location / { + proxy_set_header Host $host; + proxy_set_header Accept-Encoding ""; + proxy_pass http://nextcloud.task.my.id:8080; + } +} +``` + +Cek apakah ada error pada konfigurasi kita +``` +# nginx -t +``` +Restart nginx +``` +# systemctl restart nginx +``` + +Buat file index.html di setiap root dir website untuk pengecekan +``` +# echo "ini directory prestashop" > /home/prestashop/index.html +# echo "ini directory wordpress" > /home/wordpress/index.html +# echo "ini directory nextcloud" > /home/nextcloud/index.html +``` + +Jika sudah lakukan pengecekan kembali dengan curl +``` +# curl -I prestashop.task.my.id +``` +Output: +``` +HTTP/1.1 200 OK +Server: nginx/1.16.1 +Date: Sun, 08 Mar 2020 08:01:26 GMT +Content-Type: text/html; charset=UTF-8 +Content-Length: 25 +Connection: keep-alive +Last-Modified: Sun, 08 Mar 2020 07:41:33 GMT +ETag: "19-5a05303fcdfb0" +Accept-Ranges: bytes +``` +Perhatikan pada bagian Server, pastikan server nya nginx + +lalu coba curl website lainnya juga dan pastikan server nya nginx + +Installasi prestashop, wordpress, nextcloud dan phpmyadmin +============== +#### Step 1: Tambahkan database dan user untuk prestashop +``` +# mysql -u root -p +``` +``` +CREATE DATABASE prestashop; +GRANT ALL PRIVILEGES ON prestashop.* TO 'prestashopuser'@'localhost' IDENTIFIED BY 'prestashoppass'; +FLUSH PRIVILEGES; +EXIT; +``` +#### Step 2: Konfigurasi php untuk prestashop +Buka konfigurasi php.ini +``` +vim /etc/opt/remi/php71/php.ini +``` +Lalu ubah beberapa bagian menjadi +``` +file_uploads = On +allow_url_fopen = On +memory_limit = 256M +upload_max_filesize = 64M +``` +#### Step 3: Download dan konfigurasi prestashop +Masuk ke dir root prestashop +``` +# cd /home/prestashop +``` +Kemudian hapus file index.html dan test.php yang sudah kita buat +``` +# rm -f index.html test.php +``` +Download prestashop +``` +# curl -O https://download.prestashop.com/download/releases/prestashop_1.7.2.4.zip +``` +Unzip prestashop dan hapus archive +``` +# unzip prestashop_1.7.2.4.zip +# rm -f prestashop_1.7.2.4.zip +``` +Ubah permission dan kepilikan directory +``` +# chown -R prestashop:prestashop /home/prestashop +# chmod -R 755 /home/prestashop +``` +Setup prestashop dengan mengakses prestashop.task.my.id di browser