Here is an example of the nginx-1.13.12 version
1, first to the official website download nginx-1.13.12.tar.gz install package and upload to the Linux server and unzip the installation package
TAR-ZXVF nginx-1.13.12.tar.gz
2, before installing the ngxin, we must first ensure that the Linux firewall is off state
Systemctl Stop Firewalld.service #停止
Firewall systemctl disable Firewalld.service #禁止firewall开机启动?
Firewall-cmd--state #查看默认防火墙状态 (show notrunning after turn off, show running when turned on)
3, install the C + + compilation environment, if you have installed the Ignore can
Yum Install gcc-c++
Is this OK [y/d/n]: Y
Installation Successful
Test
[Email protected] nginx-1.13.12]# gcc
GCC: Fatal error: No input file
Compile interrupts.
[[email protected] nginx-1.13.12]# make
Make: * No target is specified and makefile is not found. Stop it.
4, install some of the relevant dependencies of Nginx
Yum install-y pcre Pcre-devel
Yum install-y zlib Zlib-devel
Yum Install-y OpenSSL Openssl-devel
5, after the installation of dependencies into the folder after the Nginx decompression
Executes the command./configure--prefix=/home/demo/nginx
/home/demo/nginx This path is the installation directory for the specified ngxin
6. After the installation is completed, the LS command will find that there will be more than one makefile file in the Unpacked folder.
7. Start the installation
Command: Make
Command: Make install
8. View the installation directory
[Email protected] nginx]# Cd/home/demo/nginx
[[email protected] nginx]# ls
Conf HTML logs Sbin
9. Start Nginx
[Email protected] nginx]# CD sbin/
[[email protected] sbin]# ls
Nginx
[Email protected] sbin]#./nginx
View process
[[Email protected] sbin]# PS aux|grep nginx
Root 7779 0.0 0.0 20544 612? Ss 05:27 0:00 nginx:master process./nginx
Nobody 7780 0.0 0.1 23076 1636? S 05:27 0:00 Nginx:worker Process
Root 7884 0.0 0.0 112720 984 pts/2 s+ 05:29 0:00 grep--color=auto nginx
Accessing server Tests
10. Close Nginx
[[email protected] sbin]#./nginx-s stop
[[Email protected] sbin]# PS aux|grep nginx
Root 7951 0.0 0.0 112720 984 pts/2 s+ 05:33 0:00 grep--color=auto nginx
11. Reload the configuration file
./nginx-s Reload
Install and configure Nginx under Linux