sell模块

一 官网下载nginx

官网地址: http://nginx.org

二 安装gcc编译器

命令: yum install gcc

安装需保持连网状态,如已经安装过,跳过此步,以下命令遵循此原则。

三 安装make命令

命令: yum install make

四 安装pcre

命令: yum install pcre*

安装该命令主要是为了支持rewrite功能。

五 安装openssl

命令: yum install openssl*

如果需要ssl支持,否则,可以跳过此步

六 nginx配置

cd到nginx所在目录,例如ngnix/usr/local/nginx-1.12.0,然后执行如下命令

./configure --prefix=/usr/local/nginx-1.12.0 --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-pcre

配置含义:

--with-http_ssl_module: 支持https

--with-http_v2_module:需通过ssl支持

--with-http_stub_status_module:支持nginx状态查询

--with-pcre: 支持rewrite功能,定制pcre

七 编译

make

八 安装

make install

九 启动

/usr/local/nginx-1.12.0/sbin/nginx

如果启动时报如下错误:

nginx: [alert] could not open error log file: open() "/usr/local/nginx-1.12.0/logs/error.log" failed (2: No such file or directory)
2017/05/01 01:00:19 [emerg] 5329#0: open() "/usr/local/nginx-1.12.0/logs/access.log" failed (2: No such file or directory)

先在/usr/local/nginx-1.12.0/下创建一个logs文件夹,然后再文件夹下创建error.log,access.log文件,先让我们的nginx起来。

查看ps -ef|grep nginx查看nginx是否启动:

[root@lanhuigu nginx-1.12.0]# ps -ef|grep nginx
root      5462     1  0 01:23 ?        00:00:00 nginx: master process /usr/local/nginx-1.12.0/sbin/nginx
nobody    5463  5462  0 01:23 ?        00:00:00 nginx: worker process             
root      5472  2312  0 01:25 pts/0    00:00:00 grep nginx

十 关闭

/usr/local/nginx-1.12.0/sbin/nginx -s stop

十一 重置

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

如果ngnix配置有修改,通过如下命令重新加载即可
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值