Home  >  Article  >  Operation and Maintenance  >  How to install nginx offline on Linux server

How to install nginx offline on Linux server

WBOY
WBOYforward
2023-05-12 10:07:131704browse

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

How to install nginx offline on Linux server

##(2)Install g

rpm -Uvh *.rpm --nodeps --force

How to install nginx offline on Linux server

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

gcc -v

How to install nginx offline on Linux server

g++ -v

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

(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

(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

(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

Start nginx

/usr/local/nginx/sbin/nginx -s stop (quit)

Stop nginx

/usr/local/nginx/sbin/nginx -s reload

Restart nginx

netstat -tunlp

Check the port occupancy

netstat -tunlp
grep

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete