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 ;
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 = $uri;
} error_page /.html; # redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
#
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 ;
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 /.html; # redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
#
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;
        }
    }

CI在CentOS中的部署与实践LNMP的更多相关文章

  1. 案例3-ubuntu和centos中自动部署tomcat相关服务的脚本

    涉及redis,mysql,xtrabackup, tomcat 1. ubuntu中 #!/bin/bash #first, change to root #出错立刻中断 set -e apt-ge ...

  2. solr(五): centos中, 整合 tomcat&solr

    前言 虽然windows下, tomcat和solr整合起来灰常的方便, 但是, 一般像这种东西, 都很少部署在windows中, 更多的是部署到linux中去. 其实, 步骤是一样的, 这里, 我在 ...

  3. Asp.NetCore程序发布到CentOs(含安装部署netcore)--最佳实践(二)

    Asp.NetCore程序发布到CentOs(含安装部署netcore)--最佳实践(一) 接上一篇 3. Nginx配置反向代理 3.1 cnetos 安装nginx 首先,我们需要在服务器上安装N ...

  4. 在centos中部署jenkins

    在centos中部署jenkins,需要的环境:安装jdk,Apache-tomcat 这两步我前面文章里已写,再次忽略 到官网下载最新的jenkins 我这里的是  jenkins.war 把该文件 ...

  5. Asp.NetCore程序发布到CentOs(含安装部署netcore)--最佳实践(一)

    环境 本地 win7 服务器:Virtual Box 上的Centos ssh工具: Xshell 文件传输: xftp 1.在本地创建asp.net core应用发布 1.1 使用Vs2017 新建 ...

  6. .NetCore中的程序通过Docker在CentOS中部署

    基础说明 安装Docker过程就略过了 创建一个Asp.Net Core程序 启用Docker支持,会生成Dockerfile文件,接下来看下这个文件,当然不同的版本生成的具体可能不一致 FROM m ...

  7. Asp.NetCore程序发布到CentOs(含安装部署netcore)--最佳实践

    原文:Asp.NetCore程序发布到CentOs(含安装部署netcore)--最佳实践 环境 本地 win7 服务器:Virtual Box 上的Centos ssh工具: Xshell 文件传输 ...

  8. Centos 中使用通过docker 部署.netcore

    此前,我一直觉得,目前网络上的各种各样的技术文章.技术文档已经足够多,任何一种技术,都可以或多或少的在网络上找到教程,或者在qq群里找到前辈解答.所以,我觉得自己在博客上写文章的意义甚少.甚至觉得自己 ...

  9. Centos中部署NetCore项目(二)

    前言 在centos中部署程序,一般都不会是使用控制台进程直接启动,或者是后台运行.而是一些守护进程管理工具进行管理,例如supervisor. 部署Web相关程序,使用nginx是比较普遍的, 安装 ...

随机推荐

  1. 免安装jdk 和 免安装tomcat

    免安装tomcat 运行的时候要执行免安装的 jdk,可以进行如下设置. 在 startup.bat 里加上这么一句, set "JAVA_HOME=C:\jdk1.6.0_43"

  2. 14个Xcode中常用的快捷键操作

    在Xcode 6中有许多快捷键的设定可以使得你的编程工作更为高效,对于在代码文件中快速导航.定位Bug以及新增应用特性都是极有效的. 当然,你戳进这篇文章的目的也在于想要快速的对代码文件进行操作,或者 ...

  3. Python 融于ASP框架

    一.ASP的平反 想到ASP 很多人会说 “asp语言很蛋疼,不能面向对象,功能单一,很多东西实现不了” 等等诸如此类. 以上说法都是错误的,其一ASp不是一种语言是 微软用来代替CGI的一种web框 ...

  4. POJ 3034 Whac-a-Mole(DP)

    题目链接 题意 : 在一个二维直角坐标系中,有n×n个洞,每个洞的坐标为(x,y), 0 ≤ x, y < n,给你一把锤子可以打到地鼠,最开始的时候,你可以把锤子放在任何地方,如果你上一秒在( ...

  5. Android 中建立一个OpenGL ES的开发环境

    转自: http://wiki.eoe.cn/page/Building_an_OpenGL_ES_Environment.html 负责人:zhangql原文链接:http://docs.eoean ...

  6. Java 常用数据结构深入分析(Vector、ArrayList、List、Map)

    线性表,链表,哈希表是常用的数据结构,在进行Java开发时,JDK已经为我们提供了一系列相应的类来实现基本的数据结构.这些类均在java.util包中.本文试图通过简单的描述,向读者阐述各个类的作用以 ...

  7. 用httpPost对JSON发送和接收的例子

    HTTPPost发送JSON: private static final String APPLICATION_JSON = "application/json";         ...

  8. linux下修改tomcat的默认目录

    1.修改tomcat的默认目录.它的默认目录是webapps/ROOT,对应的conf目录下的server.xml里的内容是: 1.修改tomcat的默认目录.它的默认目录是webapps/ROOT, ...

  9. mysql 复杂的查询语句,工作中用到的记录下

    1  去重查询 select distinct id from user_info where xxxxxx 2 group by 分组查询中排序 group by本身没有排序功能,这可能是mysql ...

  10. ios开发理解nil,Nil, NULL

    nil是一个对象指针为空,Nil是一个类指针为空,NULL是基本数据类型为空.这些可以理解为nil,Nil, NULL的区别吧. iOS剪切板 UIPasteboard *pasteboard = [ ...