首页 >后端开发 >php教程 >centos7 安装nginx

centos7 安装nginx

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-07-29 09:11:481005浏览

安装nginx
    下载安装包
        http://nginx.org/en/download.html 下载最新的 nginx-1.9.6.tar.gz
放入 centos 7 /usr/local 中
解压 tar -zxvf nginx-1.9.6.tar.gz
创建nginx目录 mkdir /usr/local/nginx
进入解压目录 cd /usr/local/nginx-1.9.6
安装nginx
   接下来安装,使用--prefix参数指定nginx安装的目录,make、make install安装
        ./configure  $默认安装在/usr/local/nginx   
       
 
     如果有错误提示:./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library.   You can either disable the module by using
--without-http-cache option, or install the OpenSSL library into the system,
or build the OpenSSL library statically from the source with nginx by using
--with-http_ssl_module --with-openssl= options.
解决办法:
yum -y install pcre-devel openssl openssl-devel
./configure --prefix=/usr/local/nginx
    
继续安装
make

make install

        

      nginx的启动命令是:

     /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

     重启

     /usr/local/nginx/sbin/nginx -s  reload 

以上就介绍了centos7 安装nginx,包括了require方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn