代码改变世界

centos 7 lNMP 安装之nginx安装

2016-09-25 23:43  sogouo  阅读(144)  评论(0编辑  收藏  举报

1.编译安装

  下载源码最新稳定版本: http://nginx.org/download/nginx-1.10.1.tar.gz

  简单有效的安装方式

  

tar zxf nginx-1.10.1.tar.gz
cd nginx-1.10.1
./configure
make && make install

  默认安装路径:/usr/local/nginx

2.yum安装

  不同linux系统有不同的安装方式,具体可以参考:http://nginx.org/en/docs/install.html

  以centos7 系统为例

  wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

  yum install nginx

 

3.nginx 配置

  http://nginx.org/en/docs/http/ngx_http_core_module.html#server

   systemctl restart nginx.service

 

  资料:

  http://nginx.org/en/docs/install.html

  https://www.nginx.com/resources/wiki/start/topics/tutorials/install/

  https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/

  https://www.nginx.com/resources/wiki/start/

  https://www.nginx.com/resources/wiki/start/topics/examples/initscripts/

  https://www.nginx.com/resources/wiki/start/topics/tutorials/install/

  https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/#testing

  https://www.nginx.com/resources/wiki/start/topics/tutorials/installoptions/

  https://www.nginx.com/resources/wiki/modules/

 

4.php-fpm 开启

  http://www.nginx.cn/231.html

  http://www.nginx.cn/300.html

  http://huoding.com/2013/10/23/290

  https://trac.nginx.org/nginx/ticket/321

  http://blog.martinfjordvald.com/2012/08/understanding-the-nginx-configuration-inheritance-model/

  http://www.cnblogs.com/jsckdao/archive/2011/05/05/2038265.html

  

4.关闭防火墙或者代开80, 9000 端口

  

  http://www.111cn.net/sys/CentOS/63586.htm

  http://www.111cn.net/sys/CentOS/63645.htm