皇冠直营现金网官方网lnmp环境的Nginx安装

一. nginx是什么?
1)Nginx是相同慢轻量级的Web
服务器/反为代理服务器及电子邮件代理服务器,并以一个BSD-like
协议下发行。
2)特点: 占有内存少, 并发能力强 ,
事实上nginx的面世能力确实在和种类的网页服务器中展现于好。

1.装前准备:

#先是肯定是无是发安编译包和片依赖包
# yum install gcc gcc-c++ openssl openssl-devel zib-devel zib

2.安装pcre
# wget
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
#tar zxvf pcre-8.39.tar.gz
编译安装
# cd pcre-8.39
# ./configure –prefix=/usr/local/pcre
# make && make install

3.安装nginx
# wget http://nginx.org/download/nginx-1.6.2.tar.gz
# tar -zxvf nginx-1.6.2.tar.gz
# cd nginx-1.6.2
# ./configure –prefix=/usr/local/nginx –with-pcre=usr/local/pcre
–with-http_stub_status_module
# make && make install

5.启动nginx
检查nginx配置文件语法有没有问题
#/usr/local/nginx/sbin/nginx -t
只要无见面油然而生,下面提示
nginx: the configuration file /usr/local/nginx-1.4.6/conf/nginx.conf
syntax is ok
nginx: configuration file /usr/local/nginx-1.4.6/conf/nginx.conf test is
successful

启动nginx
#/usr/local/nginx/sbin/nginx
再加载nginx
#/usr/local/nginx/sbin/nginx –s reload

至马上同样步没有呀错误,就得ip访问了.

 

二.装着报错解决:

1.解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid"
failed错误 

釜底抽薪方法:
[root@localhost nginx]# /usr/local/nginx/sbin/nginx -c
/usr/local/nginx/conf/nginx.conf

2.解决 ./configure: error: the HTTP rewrite module requires the PCRE
library.

#yum -y install pcre-devel

以上仅为个人安装,仅供参考!

 

相关文章