lnmp.org 问题集

一、删除隐藏文件 .user.ini

        1、查看ls -a  

        2、lsattr .user.ini 

        3、chattr -i .user.ini

        4、rm -f .user.ini

二、配置nginx www.site.com.conf

server
    {
        listen 80;
        #listen [::]:80;
        server_name www.site.com site.com;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /data/www/www.site.com/public;

        include thinkphp.conf;
        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        #include enable-php.conf;
        location ~ [^/]\.php(/|$)
        {
            #try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
            include pathinfo.conf;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log  /home/wwwlogs/www.site.com.log;
    }


三、修改php.ini

        1、cgi.fix_pathinfo=1

        2、删除disable_functions 里的 scandir

四、错误

      1、OSError: Command /root/.local/share/letsencrypt/bin/python2.7 - setuptools pkg_resources pip wheel failed with error code 2

     解决办法:
     卸载virtualenv
        pip uninstall virtualenv
    安装virtualenv
        pip install virtualenv

    2、 cat ~/.pip/pip.conf

         [global]
         index-url = https://pypi.doubanio.com/simple/
         [install]
         trusted-host=pypi.doubanio.com

猜你喜欢

转载自my.oschina.net/u/3545218/blog/1798842
今日推荐