Linux下Nginx安装总结及抛错解决
进入目录:/usr/local/src
下载相关组件:
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.43.tar.gz
wget http://zlib.net/zlib-1.2.11.tar.gz
wget http://www.openssl.org/source/openssl-fips-2.0.16.tar.gz
下载Nginx:
wget http://nginx.org/download/nginx-1.16.0.tar.gz
安装组件及Nginx:
tar zxvf openssl-fips-2.0.16.tar.gz --->j进解压的目录openssl-fips-2.0.16执行:./config && make && make install
tar zxvf pcre-8.43.tar.gz --->j进解压的目录pcre-8.43:./configure && make && make install
tar zxvf zlib-1.2.11.tar.gz --->j进解压的目录zlib-1.2.11:./configure&& make && make install
tar zxvf nginx-1.16.0.tar.gz -->j进解压的目录nginx-1.16.0:./configure --prefix=/usr/local/nginx && make && make install
安装中如果抛错:./configure: error: the HTTP rewrite module requires the PCRE library..........................
解决方法:
yum -y install pcre-devel openssl openssl-devel
./configure --prefix=/usr/local/nginx
make
make install
基本搞定;
查询Nginx安装目录:whereis nginx 显示:/usr/local/nginx 进入目录
启动Nginx: sbin/nginx 启动完,查看进程:ps -ef|grep nginx 或ps aux|grep nginx 第二个显示的信息更全一点;