博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CI在CentOS中的部署与实践LNMP
阅读量:7169 次
发布时间:2019-06-29

本文共 3396 字,大约阅读时间需要 11 分钟。

1. 平台:lnmp CentOS6.4 (64bit) nginx1.2.4+php5.5.7配置过程中遇到的问题与处理方式:

1. 404错误:

   原因:nginx中的配置请求路径的问题

2. 405错误:nginx在post到静态文件时出现的错误。

log_format ci3_main '$remote_addr - $remote_user [$time_local] "$request" '                                  '$status $body_bytes_sent "$http_referer" '                                  '"$http_user_agent" "$http_x_forwarded_for"';server {        listen       8089;        server_name  www.ainux.com;        #charset koi8-r;        access_log  logs/www.ainux.com.log  ci3_main;        location / {            root   /data/ci3;            index  index.php index.html index.htm;            error_page 405 =200 $uri;        }        error_page  404              /404.html;        # redirect server error pages to the static page /50x.html        #        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }        # proxy the PHP scripts to Apache listening on 127.0.0.1:80        #        #location ~ \.php$ {        #    proxy_pass   http://127.0.0.1;        #}        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000        #        location ~ \.php {            root           /data/ci;             fastcgi_pass   127.0.0.1:9000;             fastcgi_index  index.php;             fastcgi_param  SCRIPT_FILENAME /data/ci/$fastcgi_script_name;             include        fastcgi_params;        }      location ~ ^/Nginxstatus/ {
            stub_status on;             access_log off;         }         # deny access to .htaccess files, if Apache's document root         # concurs with nginx's one         #          location ~ /\.ht {
            deny  all;         }     }

解决后的配置内容为:

log_format ci3_main '$remote_addr - $remote_user [$time_local] "$request" '                                  '$status $body_bytes_sent "$http_referer" '                                  '"$http_user_agent" "$http_x_forwarded_for"';server {        listen       8089;        server_name  www.ainux.com;        #charset koi8-r;        access_log  logs/www.ainux.com.log  ci3_main;        location / {            root   /data/ci3;            index  index.php index.html index.htm;            error_page 405 =200 $uri; //此处解决405的错误,在post静态文件时出现的错误        }        error_page  404              /404.html;        # redirect server error pages to the static page /50x.html        #        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }        # proxy the PHP scripts to Apache listening on 127.0.0.1:80        #        #location ~ \.php$ {        #    proxy_pass   http://127.0.0.1;        #}        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000        #        location ~ \.php {                root /data/ci3;                fastcgi_pass 127.0.0.1:9000;                fastcgi_index index.php;                fastcgi_param  SCRIPT_FILENAME /data/ci3/$fastcgi_script_name;                include        fastcgi_params;                fastcgi_split_path_info ^(.+\.php)(.*)$;                fastcgi_param PATH_INFO $fastcgi_path_info;        }      location ~ ^/Nginxstatus/ {
            stub_status on;             access_log off;         }         # deny access to .htaccess files, if Apache's document root         # concurs with nginx's one         #          location ~ /\.ht {
            deny  all;         }     }

 

转载地址:http://qsmwm.baihongyu.com/

你可能感兴趣的文章
子网掩码的作用
查看>>
p0f(上)
查看>>
LNMP服务跨省迁移的解决方案
查看>>
我的友情链接
查看>>
DNS配置
查看>>
MPLS ××× 互访关系控制
查看>>
如果说搞技术没前途,那是因为你技术搞的还不够深
查看>>
柳州市第一职业技术学校中心机房双活虚拟引擎容灾备份系统需求
查看>>
我的友情链接
查看>>
NV 3D viosn的设置
查看>>
在CentOS系统下安装Red5
查看>>
移动端消除click事件的延迟效果
查看>>
bgp与igp交互的配置
查看>>
[官方文档] oracle官方文档总汇(9i,10g,11gR1, 11gR2)
查看>>
宝马与F团合作能否再造营销奇迹?
查看>>
10 Linux程序包管理
查看>>
Exchange2010升级SP2 (包含各角色)
查看>>
实施Exchange 2013中的分层通讯簿
查看>>
Windows下安装MySql后,出现的错误解决办法
查看>>
oracle创建只读用户
查看>>