zoukankan      html  css  js  c++  java
  • 更改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/

    chown nginx(所有者):nginx(组) /home/www/ -R  #设置目录所有者

    chmod 700  /home/www/ -R   #设置目录权限



  • 相关阅读:
    java纯数字加密解密实例
    C++手稿:std::string
    java裁剪图片
    java打开windows系统的浏览器
    Android手机无线adb
    office-word
    设计模式-享元模式(13)
    设计模式-外观模式(12)
    charles工具过滤腾讯视频播放器广告
    js将json格式的list转换为按某个字段分组的map数组
  • 原文地址:https://www.cnblogs.com/moqiang02/p/4061242.html
Copyright © 2011-2022 走看看