GNU/Linux ◆ xterm ◆ bash 2650 views

How to Adding Virtualhost for Nginx

root directory can be anywhere, please customized mkdir -p /srv/www/formatdongkrak.com/logs for security secure, keep using chown root

nano /etc/php.ini press on the keyboard CTRL+W find cgi.fix_pathinfo you will see like this ;cgi.fix_pathinfo=0 replace cgi.fix_pathinfo=0

mkdir /etc/nginx/sites-available

mkdir /etc/nginx/sites-enabled

nano /etc/nginx/nginx.conf add the code below, to the bottom before the closing } include /etc/nginx/sites-enabled/*;

nano /etc/nginx/sites-available/formatdongkrak.com

FOLLOW THIS LINK

cd /etc/nginx/sites-enabled/

ln -s /etc/nginx/sites-available/formatdongkrak.com

service nginx restart

nano /srv/www/formatdongkrak.com/info.php

If permission denied cd /srv/www find . -type d | while read folder ; do chmod 755 "$folder" ; done find . -type f | while read file ; do chmod 644 "$file" ; done