lnmp1.4痛苦的配置经历

安装后,nginx访问virtualbox挂载的目录各种打不通。
先要把/media/sf_public的用户和组改了,可是改不了,只能改nginx的用户为root,并且php-fpm的用户和组改为www 和 vboxsf,不允许改为root,这时才不会报403和not input file…
然后要进入lnmp1.4/tool/执行里面的remove_open_basedir_restriction.sh把对应的网站目录的.user.ini干掉,网站的/public才能正常加载上级的目录文件的引用,坑爹啊,搞了好几天。重装了无数次lnmp版本。
最后还要配置主机路由重写,现在把nginx vhost备份上:

server
    {
        listen 80;
        #listen [::]:80;
        server_name sa-git-ubuntu.cc ;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /media/sf_public/sa-git/public;

        include none.conf;
        #error_page   404   /404.html;
        rewrite ^/(.*)/$ /$1 permanent;
        if (!-d $request_filename){
                set $rule_1 1$rule_1;
        }
        if (!-f $request_filename){
                set $rule_1 2$rule_1;
        }
        if ($rule_1 = "21"){
                rewrite ^/ /index.php last;
        }

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

        include enable-php.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/sa-git-ubuntu.cc.log;
    }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值