Home > Operation and Maintenance > Nginx > How to install and use nginx in Linux system

How to install and use nginx in Linux system

WBOY
Release: 2023-05-22 22:22:04
forward
939 people have browsed it

nginx Introduction:

  • Nginx is a very powerful, high-performance Web and reverse proxy service

  • *It has many very superior features: In the case of high concurrency of connections, Nginx is** A good alternative to Apache service

  • Nginx is one of the software platforms often chosen by virtual host business owners in the United States.

Linux system installation nginx

Download it and transfer it to the server. The first step is to decompress

tar -zxvf nginx-1.13.1.tar.gz

How to install and use nginx in Linux system

Enter the directory of nginx-1.13.1 and view The following file

How to install and use nginx in Linux system

found that nginx is released through the source package, and nginx is written in C, so a c/c compiler needs to be installed

yum install gcc

How to install and use nginx in Linux system

How to install and use nginx in Linux system

## As above, gcc has been installed, let’s install nginx

How to install and use nginx in Linux system

How to install and use nginx in Linux system

At the end of the detection, it was found that the dependent pcre library was not available. Let’s install pcre

https://ftp.pcre.org/pub/pcre/

After downloading pcre, you will also need to decompress the tar.gz file first.

tar -zxvf pcre-8.00.tar.gz

How to install and use nginx in Linux system

After decompression, there are the following files, which are still source code installations

How to install and use nginx in Linux system

How to install and use nginx in Linux system

How to install and use nginx in Linux system

How to install and use nginx in Linux system##It says that we can't find g, let's install g

yum install gcc-c

How to install and use nginx in Linux systemCome back and continue to install pcre

./configure

make install

How to install and use nginx in Linux systempcre installation is complete, go back and install nginx

How to install and use nginx in Linux systemZlib is missing, we need to install zlib again

http://www.zlib.net/

zlib is also managed by tar.gz, unzip it first

How to install and use nginx in Linux systemI found that zlib is also managed by the source code package, to install zlib

./configure

make install

After the installation is completed, install nginx

./configure

make install

This time the installation was finally successful. The software is installed to

/usr/local/nginx

Start nginx

./usr/local/nginx/sbin/nginx

Access nginx (ip address: 192.168.100.100, port number: 80)

http://192.168.100.100:8080/

nginx is installed successfully.

How to install and use nginx in Linux system

Linux system start/stop nginx command:

Stop nginx
nginx -s stop
Restart nginx
nginx -s reload

The above is the detailed content of How to install and use nginx in Linux system. 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