Nginx编译安装

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nginx编译安装相关的知识,希望对你有一定的参考价值。

cd /usr/src yum -y install gcc gcc-c++ make libtool zlib zlib-devel pcre pcre-devel openssl openssl-devel wget http://nginx.org/download/nginx-1.14.0.tar.gz tar zxf nginx-1.14.0.tar.gz groupadd www useradd -g www www -s /sbin/nologin cd nginx-1.14.0/ ./configure --prefix=/usr/local/nginx --with-http_dav_module --with-http_stub_status_module --with-http_addition_module --with-http_sub_module --with-http_flv_module --with-http_mp4_module --with-pcre --with-http_ssl_module --with-http_gzip_static_module --user=www --group=www make && make install ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/ cat >> /etc/init.d/nginx << EOF #!/bin/bash # chkconfig: 345 85 15 nginx=/usr/local/sbin/nginx conf=/usr/local/nginx/conf/nginx.conf case $1 in start) $nginx echo "nginx is start" ;; reload) $nginx -s reload echo "nginx reload done" ;; stop) $nginx -s stop echo "nginx is stop " ;; restart) $nginx -s stop 2>/dev/null $nginx echo "nginx restart done" ;; *) echo "what do you want to do?" ;; esac EOF chmod 755 /etc/init.d/nginx chkconfig --add nginx chkconfig nginx on ss -anplt | grep nginx nginx firewall-cmd --add-port=80/tcp --permanent firewall-cmd --reload

以上是关于Nginx编译安装的主要内容,如果未能解决你的问题,请参考以下文章

Nginx编译安装及编译参数讲解

nginx编译安装服务启动脚本在哪

安装nginx的时候,是怎么编译老出错啊

编译安装——什么是开放源代码编译器与可执行文件——编译安装nginx

nginx 编译安装

编译安装nginx