Installasi Double Wordpress dan Virtual Host
Install Nginx & php
# apt-get update && apt-get upgrade -y
# apt-get install nginx
# apt-get install php-imagick php7.4-fpm php7.4-mbstring php7.4-bcmath php7.4-xml php7.4-mysql php7.4-common php7.4-gd php7.4-json php7.4-cli php7.4-curl php7.4-zip
Install database di server terpisah
# apt-get install mysql-server mysql-client
Create database wordpress
CREATE DATABASE site1;"
GRANT ALL PRIVILEGES ON site1.* TO 'site1'@'*' IDENTIFIED BY 'site1password';"
FLUSH PRIVILEGES;"
CREATE DATABASE site2;"
GRANT ALL PRIVILEGES ON site2.* TO 'site2'@'*' IDENTIFIED BY 'site2password';"
FLUSH PRIVILEGES;"
Konfigurasi nginx
1. Membuat site 1 dan 2 .conf ( di sesuaikan )
cat > /etc/nginx/sites-available/site1.conf <<EOF
server {
listen 80;
root /var/www/site1;
index index.php index.html index.htm;
server_name site1.example.com www.site1.example.com;
client_max_body_size 100M;
location / {
try_files \$uri \$uri/ /index.php?\$args;
}
location ~ \.php\$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
}
}
EOF
Link file ke sites-available
# ln -s /etc/nginx/sites-enabled/site1.conf /etc/nginx/sites-available/site1.conf
# ln -s /etc/nginx/sites-enabled/site2.conf /etc/nginx/sites-available/site2.conf
Unlink default konfigurasi nginx
#cd /etc/nginx/site-default
#unlink default
Test nginx
# nginx -t
# systemctl restart nginx
Membuat folder
# mkdir -p /var/www/site{1,2}
# chown -R www-data:www-data /var/www/site*
1. Download wordpress
cd /tmp
wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
cp -r wordpress/* /var/www/site1/
cp -r wordpress/* /var/www/site2/
chown -R www-data:www-data /var/www/site*
2. Setting connection database
nano /var/www/site1/wp-config.conf
arahkan server db dan database yang sudah di buat
2. Nano /etc/bind/zones/kantor.local
Tambahan A record pada DNS Internal
tentangit IN A 172.x.x.x #ip sesuaikan dengan server wordpress digunakan
tentangit1 IN A 172.x.x.x
0 Komentar