zoukankan      html  css  js  c++  java
  • 那些在linux上遇到的坑 +1

    这几天一直在弄服务器

    我把自己的项目拉倒linux上的时候出现了各种permission denied 500 403 的错误 

    这些错误都可以设置权限来解决,可是遇到了一个我打死也没有想到会错的问题 404。

    前思后想  在windows 上一点问题都没有,为什么到linux 上就会出现404的错误呢,既然

    在windows上没有错误 那说明代码肯定是没有问题的,有问题的只是重写配置。于是乎开始

    了一场跟重写打仗的日子。

    找了好久 总算是找到了  原来我卸载项目路径下的.htaccess 或者 nginx.htaccess 文件没有生效,

    我索性就把里面的重写规则放到了server配置里面。 bingo  问题完美解决

    下面是我的server配置   yii2.0

    server {
        listen 80;  #监听端口
        root /home/luo/www/720kfang/backend/web; #项目根目录
        # Add index.php to the list if you are using PHP
        index index.php; 
    
        server_name backend.720kfang.com; #域名
    
        location / {
              # Redirect everything that isn't a real file to index.php
              try_files $uri $uri/ /index.php?$args; #yii2.0的重写
        }
        
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ .php$ {
            include snippets/fastcgi-php.conf;
        #
        #    # With php7.0-cgi alone:
        #    fastcgi_pass 127.0.0.1:9000;
        #    # With php7.0-fpm:
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        }
    }
  • 相关阅读:
    [Cloud Architect] 12. Defensive Security in the Cloud
    [SAP] 38. Database Migration Service
    [Cloud Architect] 11. Protecting Data Stored in the Cloud
    [SAP] 37. Snow family
    [SAP] 36. Storage getway
    JAVA开发常见问题整理(持续更新)
    sdf1434 最少转弯
    sdf 2439 问题 A: 迷宫(广搜模板题)
    sdf1552
    小学生数据结构和基础算法
  • 原文地址:https://www.cnblogs.com/eddief/p/7009308.html
Copyright © 2011-2022 走看看