更改nginx網站根目錄


默認網站根目錄為/usr/local/nginx/html,要將它改成/homw/www

vi /usr/local/nginx/conf/nginx.conf
將其中的
 
        location / {
            root   html;
            index  index.php index.html index.htm;
        }
改為
 
        location / {
            root   /home/www;
            index  index.php index.html index.htm;
        }
然后再將
location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
改為
location ~ \.php$ {
            root           /home/www;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
然后重啟nginx
已經安裝了samba,所以要將vi /etc/samba/smb.conf中的[public]下的path值改為
path = /home/www/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM