Linux server offline installation nginx
1. Resources
nginx-1.20.1.tar.gz (the download link includes gcc, g, pcre, libtool, nginx)
Baidu network disk download:
Link: https://pan.baidu.com/s/1avQD-zGYVcj0ttRtnPNTIA Extraction code: 6yhi
2. Installation Steps
(1)Install gcc
rpm -Uvh *.rpm --nodeps --force
Copy after login
Copy after login
##(2)Install g
rpm -Uvh *.rpm --nodeps --force
Copy after login
Copy after login
(3) Verify whether gcc and g are installed successfully, execute the command:
(4). To install PCRE, first decompress the pcre, tar -zxvf pcre-8.35.tar.gz. After decompressing it, start the installation
cd pcre-8.35
./configure
make
make install
Copy after login
(5). To install libtool, first decompress libtool :tar -zxvf libtool-2.4.2.tar.gz, after decompressing it, start the installation
cd libtool-2.4.2
./configure
make
make install
Copy after login
(6). To install nginx, first decompress nginx tar -zxvf nginx-1.20.1. tar.gz, after decompressing it, you will start the installation
cd nginx-1.20.1
./configure
make
make install
Copy after login
(7). Start nginx: nginx installation directory address -c nginx configuration file address, the path after installation seems to be changed to /usr/local Inside
Common commands
Operation
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
Copy after login
Start nginx
/usr/local/nginx/sbin/nginx -s stop (quit)
Copy after login
Stop nginx
/usr/local/nginx/sbin/nginx -s reload
Copy after login
Restart nginx
netstat -tunlp
Copy after login
Check the port occupancy
netstat -tunlp
grep
Copy after login
The configuration file of nginx is nginx.conf in the nginx directory under the installation directory. The default port is 80. The following page appears after startup, which means the startup is successful.
The access address is : Server address: 80 (such as: 192.168.43.6:80) Please pay attention to whether port 80 is occupied
The above is the detailed content of How to install nginx offline on Linux server. For more information, please follow other related articles on the PHP Chinese website!