CentOS下搭建配置Nginx服务器
1、使用Xshell链接到服务器,使用命令下载Nginx软件:wgethttp://nginx.org/download/nginx-1.6.3.tar.gz等待下载完成后,输入命令:ls ,如下图:

2、下载完成后,解压该文件,命令:tar zxvf nginx-1.6.3.tar.gz解压完成后,同上输入ls ,如下图:


3、进入解压后的文件目录,输入命令:cd nginx-1.6.3

4、配置nginx安装信息,输入命令:./configure --user=www --group=www --prefix=/opt/nginx --with-http_stub_status_module --with-http_ssl_module
5、注意,此时可能会出现以下错误信息以及解决方案,主要服务器版本及软件更新问题。错误为:./configure: error: the HTTP rewrite module requires the PCRE library.

6、安装pcre-devel解决问题yum -y install pcre-devel还有可能出现:错误提示:./configure: error: the HTTP cache module requires md5 functionsfrom 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=<path> options.解决办法:yum -y install openssl openssl-devel
7、再次输入配置命令:./configure --user=www --group=www --prefix=/opt/nginx -幻腾寂埒-with-http_stub_status_module --with-http_ssl_module如果没有发生错误,接下来就可以直接安装了。
8、编译及安装,make && make install