Home > Article > Operation and Maintenance > How to compile and install Nginx
1. Download the nginx source file
Enter the nginx official website to download the stable version of nginx. I downloaded 1.10.0.
Unzip: tar -zxvf nginx-1.10.0.tar.gz
## 2. Check the installation dependencies
yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
3. Configure nginx installation options
./configure --prefix=/opt/nginx --sbin-path=/usr/bin/nginxOfficial website parameter configuration instructions:
4. Compile and install
make && make install
5. Start, stop, restart
# 1.启动nginx shell> nginx # 可通过ps -ef | grep nginx查看nginx是否已启动成功 # 2.停止nginx shell> nginx -s stop # 3. 重新启动 shell> nginx -s reload
6. Configure nginx to start at boot
shell> vim /etc/rc.d/rc.local # 添加如下参数 /usr/bin/nginx shell> chmod +x /etc/rc.d/rc.local
The above is the detailed content of How to compile and install Nginx. For more information, please follow other related articles on the PHP Chinese website!