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

Basic Construction of Nginx

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Nginx (lightweight web Server) is a high performance HTTP and reverse proxy server.

Advantages: less memory, strong anti-concurrency ability, suitable for dealing with static pages, high stability, support for hot deployment and so on.

Disadvantages: dealing with dynamic pages, bug is more than apache.

Features: modularization

It is roughly divided into two modules: the main module and the event module.

(main module: configure some parameters related to the overall situation of the server, such as error log, process, permissions, etc.)

(event module: configure parameters related to the IO event interface, such as: worker_connections)

If the module is refined, it is divided into five categories: 1. Core module 2. Standard http module 3. Optional http module 4. Mail module 5. Third-party modules and patches

Nginx official website: http://www.nginx.org/

First, the preparation before Nginx installation:

1) install support softwar

Yum-y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel

2) install PCRE (the function of PCRE is to make Nginx support Rewrite function)

1. Download the PCRE installation package

# wget http:// http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz

two。 Extract and go to the directory where the package is installed

# tar zxvf pcre-8.35.tar.gz

# cd pcre-8.35

3. Compile and install and view the pcre version

#. / configure & & make & & make install

# prce-config-version

3) create and run users and groups

Nginx service programs run as nobody by default. It is recommended to create special user accounts for them in order to control their access rights more accurately, increase flexibility and reduce security risks.

For example: create a user named nginx, do not establish a host folder, and prohibit login to the Shell environment.

# useradd-M-s / sbin/nologin nginx

Second, install Nginx and start:

1) install Nginx

1. Download Nginx

# wget http://nginx.org/download/nginx-1.6.2.tar.gz

two。 Extract and go to the directory where the package is installed

# tar zxvf nginx-1.6.2.tar.gz

# cd nginx-1.6.2

3. Basic compilation and installation

#. / configure-prefix=/usr/local/nginx-user=nginx-grep=nginx-with-http_stub_status_module (

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

Servers

Wechat

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

12
Report