lnmp环境之Nginx安装

一. nginx是什么?
一)Nginx是1款轻量级的Web
服务器/反向代理服务器及电子邮件代理服务器,并在八个BSD-like
协议下发行。
二)特点: 占有内部存储器少, 并发能力强 ,
事实上nginx的产出能力确实在同体系的网页服务器中展现较好。

一. nginx是什么?
一)Nginx是一款轻量级的Web
服务器/反向代理服务器及电子邮件代理服务器,并在2个BSD-like
协议下发行。
二)特点: 占有内部存款和储蓄器少, 并发能力强 ,
事实上nginx的面世能力确实在同连串的网页服务器中表现较好。

一.安装前准备:

一.装置前准备:

#率先肯定是还是不是有安装编写翻译包和1部分正视包
# yum install gcc gcc-c++ openssl openssl-devel zib-devel zib

#首先肯定是或不是有安装编写翻译包和有个别正视包
# 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

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

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

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

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

到这一步未有何错误,就足以ip访问了.

到这一步未有何错误,就能够ip访问了.

 

 

2.装置中报错解决:

2.安装中报错消除:

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

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

斩草除根办法:
[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.

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

#yum -y install pcre-devel

#yum -y install pcre-devel

上述仅为个体安装,仅供参考!

如上仅为私家安装,仅供参考!

 

 

相关文章