Get the Nginx installation tutorial done in 5 minutes
- 2020-05-14 06:00:06
- OfStack
1. Install gcc (centos 7 after 1 comes with it, you can install it after the failure of step 6)
yum install gcc gcc-c++
2. Install pcre
yum install -y pcre pcre-devel
3. Install zlib
yum install -y zlib zlib-devel
4. Install openssl
yum install -y openssl openssl-devel
5. Download and unzip Nginx (then enter the Nginx directory)
wget http://nginx.org/download/nginx-1.12.2.tar.gz
6. Compile Nginx (load common modules such as ssl)
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_gzip_static_module --with-http_ssl_module
7. Install Nginx
make && make install
8. To start the
/usr/local/nginx/sbin/nginx
9. Stop
/ usr/local/nginx/sbin/nginx - s stop (reload restart)
10. The browser accesses IP on the machine where Nginx is located, and verifies that Nginx starts successfully
http://yourhost/
Note: Nginx configuration file location
/usr/local/nginx/conf/nginx.conf