Article Directory
Install Nginx
Step 1: Mount the CD-ROM to the media directory
Reason: Because the path is long, the CD-ROM drive is mounted to the media directory through the mount command to access the device.
[root@server1 ~]# mount /dev/cdrom/ /media/
Step 2: Download nginx
Step 3: Download to the src directory
[root@server1 src]# wget http://nginx.org/download/nginx-1.16.1.tar.gz
Step 4: Unzip
[root@server1 src]# tar zxf nginx-1.16.1.tar.gz
Problem: The source code cannot be installed by executing the yum install command like the rpm package.
Solution: Check the environment and install it without entering Yes or No
[root@server1 nginx-1.16.1]# ./configure
[root@server1 nginx-1.16.1]# yum install -y gcc
If you execute yum install -y gcc and the following problems occur,
check the warehouse yum repolist and findyum source is not configured
Step 5: Check the environment
Check the environment again and find that pcre is not installed and execute the command:
[root@server1 nginx-1.16.1]# yum install -y pcre-devel
Then check the environment and find that zlib is not installed and execute the command:
[root@server1 nginx-1.16.1]# yum install -y zlib-devel
The final result of checking the environment is successful!
Put ngix in the local directory
[root@localhost nginx-1.16.1]# ./configure --prefix=/usr/local/nginx --with-http_ssl_module
Step 6: Start nginx
Compile the source code:
[root@localhost nginx-1.16.1]# make
[root@localhost nginx-1.16.1]# make install
Run the script:
access the configured ip address from the browser: