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

How to install nginx offline on Linux

WBOY
WBOYforward
2023-05-13 17:55:195130browse

How to install nginx offline on Linux

\1. Install dependent libraries first

 yum install -y gcc-c++``yum install -y pcre pcre-devel``yum install -y zlib zlib-devel``yum install -y openssl openssl-devel

\2. Download nginx installation package

http://nginx.org/download/

\3. Upload the downloaded nignx source code package to the linux server and decompress it

How to install nginx offline on Linux

\4. Enter the decompressed root directory of nginx and configure

 cd nginx-1.9.9
 ./configure --prefix=/usr/local/nginx

After configure is completed, there will be the following information, such as log files, configuration files, etc.

How to install nginx offline on Linux

\5. Compile and install

 make && make install

\ 6. nginx is installed successfully

How to install nginx offline on Linux

\7. Start nginx

First check whether the nginx configuration is correct

 ./nginx/sbin/nginx -t

How to install nginx offline on Linux

If the above two sentences appear, it means that the nginx configuration is ok and can be started.

 cd nginx/sbin
 ./nginx

There is no log output, indicating that the startup is normal. If an exception occurs, please refer to the error log path prompted during configuration to view the error message

You can view the nginx process

 ps -ef | grep nginx

How to install nginx offline on Linux

\8. Access nginx

The default port is 80, so you can directly enter the ip to access

How to install nginx offline on Linux

The above is the detailed content of How to install nginx offline on Linux. 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