liunx安装nginx
1、下载nginx安装包
wget http://nginx.org/download/nginx-1.22.0.tar.gz
2、解压下载安装包
tar -xvf nginx-1.13.7.tar.gz
3、编译
cd nginx-1.13.7
./configure
4、安装nginx
make
make install
5、启动nginx
cd /usr/local/nginx/sbin
./nginx -c /usr/local/nginx/conf/nginx.conf
常见问题
Q:./configure编译失败
A:nginxa安装需要依赖zlib、pcre等相关插件,需要先安装上述插件后在进行编译,如需要使用nginx的SSL模块,还需要安装openSSL,安装命令如下:
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel