How to install nginx under linux?
First we need to put the nginx installation package under the /usr/local/software directory of linux, as shown in the figure below
Connect Next, install the dependency packages of nginx through the yum install command, as shown in the figure below. The dependency packages include pcre, pcre-devel, zlib, zlib-devel
Then we will nginx Unzip the installation package, as shown in the figure below. When decompressing tar, match the zxvf parameter
After decompression, we can see the folder as shown in the figure below in the directory. This It contains the installation command
Next we enter the decompressed file and execute the configure command to compile the installation file, as shown in the figure below
After compilation, execute the two commands make and make install to install nginx, as shown in the figure below
After the installation is completed, we can see As shown in the nginx directory as shown below, the startup file here is under the sbin folder
Next we start nginx through the /usr/local/nginx/sbin/nginx command Server, as shown in the figure below
Finally, we execute the ps -ef | grep nginx command to check whether nginx starts successfully. The record shown in the figure below indicates that the startup is successful
The above is the detailed content of How to install nginx under linux. For more information, please follow other related articles on the PHP Chinese website!