Code:
mkdir /var/www/html/nama-folder
Step 1: Open the Apache configuration file to edit it
Code:
#vi /etc/httpd/conf/httpd.conf
Code:
NameVirtualHost *:80
Code:
<VirtualHost *:80> ServerName website1.example.com DocumentRoot /var/www/html/website1 </VirtualHost>
Step 4: Add as many virtual hosts as you want using VirtualHost blocks like below:
Code:
<VirtualHost *:80> ServerName website2.example.com DocumentRoot /var/www/html/website2 </VirtualHost>
Step 5: Restart Apache
Code:
#/etc/init.d/httpd restart
Step 6: Open /etc/hosts
Code:
#vi /etc/hosts
PHP Code:
127.0.0.1 website1.example.com
127.0.0.1 website2.example.com
save the file and exit.
You will now be able to access
Code:
http://website1.example.com
jng lupa configure AllowOverride none -> MENJADI AllowOverride All
Code:
#sudo vi /etc/httpd/conf/httpd.conff
Code:
#chown -R namauser.namagrup /letak-folder/
Tidak ada komentar:
Posting Komentar