How to install nginx offline on Linux server

WBOY
Release: 2023-05-12 10:07:13
forward
1740 people have browsed it

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

How to install nginx offline on Linux server

##(2)Install g

rpm -Uvh *.rpm --nodeps --force
Copy after login
Copy after login

How to install nginx offline on Linux server

(3) Verify whether gcc and g are installed successfully, execute the command:

gcc -v
Copy after login

How to install nginx offline on Linux server

g++ -v
Copy after login

How to install nginx offline on Linux server

(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

How to install nginx offline on Linux server

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template