Nginx源码编译并运行
安装Nginx
git clone https://github.com/nginx/nginx.git
cd nginx
git checkout release-1.22.1
./auto/configure
如果报错the HTTP rewrite module requires the PCRE library,那么执行
yum install -y zlib zlib-devel openssl openssl--devel pcre pcre-devel
make
make install
启动与退出
直接执行Nginx二进制程序
/usr/local/nginx/sbin/nginx
读取默认路径下的配置文件
cat /usr/local/nginx/conf/nginx.conf
优雅退出
/usr/local/nginx/sbin/nginx -s quit
联合命令
安装Nginx并启动
./auto/configure && make && make install && /usr/local/nginx/sbin/nginx