How to install nginx offline on Linux

WBOY
Release: 2023-05-13 17:55:19
forward
5099 people have browsed it

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
Copy after login

\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
Copy after login

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
Copy after login

\ 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
Copy after login

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
Copy after login

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
Copy after login

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!

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