CI在CentOS中的部署与实践LNMP
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CI在CentOS中的部署与实践LNMP,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2470字,纯文字阅读大概需要4分钟。
内容图文
![CI在CentOS中的部署与实践LNMP](/upload/InfoBanner/zyjiaocheng/1070/bc653c68073e479a808f563a8c15d309.jpg)
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 500502503504 /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 500502503504 /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://www.cnblogs.com/hubing/p/4759948.html
内容总结
以上是互联网集市为您收集整理的CI在CentOS中的部署与实践LNMP全部内容,希望文章能够帮你解决CI在CentOS中的部署与实践LNMP所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。