Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install nginx on Linux system

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "Linux system how to install nginx", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "Linux system how to install nginx" this article.

Nginx (engine x) is a high-performance HTTP and reverse proxy web server known for its stability, rich feature set, sample configuration files, and low system resource consumption.

About nginx: Nginx (engine x) is a high-performance HTTP and reverse proxy web server. Nginx is a lightweight Web server / reverse proxy server and email (IMAP/POP3) proxy server.

Issued under the BSD-like agreement. It is characterized by less memory and strong concurrency ability. in fact, the concurrency ability of nginx performs better in the same type of web server. Chinese mainland uses nginx website users: Baidu, JD.com, Sina, NetEase, Tencent, Taobao and so on.

Linux system installation nginx detailed steps 1. Install dependency packages

/ / install the above four dependencies yum-y install gcc zlib zlib-devel pcre-devel openssl openssl-devel2 with one click. Download and extract the installation package

/ / create a folder cd / usr/local mkdir nginx cd nginx / / download the tar package wget http://nginx.org/download/nginx-1.13.7.tar.gz tar-xvf nginx-1.13.7.tar.gz3. Install nginx

/ / enter the nginx directory cd / usr/local/nginx / / enter the directory cd nginx-1.13.7 / / execute the command. / configure / / execute the make command make / / execute the make install command make install4. Configure nginx.conf

# Open the configuration file vi / usr/local/nginx/conf/nginx.conf and change the port number to 8089, because apeache may occupy port 80. Try not to modify the apeache port. We choose to modify the nginx port.

Change localhost to your server ip address.

5. Start nginx

/ usr/local/nginx/sbin/nginx-s reload if an error occurs: nginx: [error] open () "/ usr/local/nginx/logs/nginx.pid" failed

Then run: / usr/local/nginx/sbin/nginx-c / usr/local/nginx/conf/nginx.conf

Just start it again!

Check to see if the nginx process starts:

Ps-ef | grep nginx

6. If you want to connect to the virtual machine access port 192.168.131.2 using an external host, you need to turn off the firewall of the virtual machine:

CentOS6 and previous versions use the command: systemctl stop iptables.service

CentOS7 turn off firewall command: systemctl stop firewalld.service

Then visit the ip to see the nginx interface.

7. Visit the server ip to view (Note, since I am still listening on port 80, the port number after ip is omitted)

The above is all the contents of the article "how to install nginx in Linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report