1. Foreword
This installation uses source code installation. The main resource package is downloaded from the official website, and the secondary dependencies are installed using yum. This article only involves the installation of nginx, not The configuration of nginx and how nginx accesses php are not covered in this article.
2. Installation steps
nginx
2.1. Download nginx
wget http://nginx.org/download/nginx-1.12.0.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
tar zxvf nginx-1.12.0.tar.gz
tar zxvf pcre-8.39.tar.gz
yum install -y gcc gcc-c++ zlib-devel
cd nginx-1.12.0
make && make install
3. Start nginx
/usr/local/ nginx/sbin/nginxCheck the running status through ps aux|grep nginxAt this point nginx will start normally.4. Open port 80 for external access
If you only run it without opening the port, the browser will not be able to access it.firewall-cmd --zone=public --add-port=80/tcp --permanent
systemctl restart firewalld.service
The above is the detailed content of How to install and configure nginx for LNMP compilation and installation. For more information, please follow other related articles on the PHP Chinese website!