Linux Server Erection Chapter II – Source installation Web server Nginx

Source: Internet
Author: User
Linux Server Erection Chapter (ii) – Source installation Web server Nginx

I. Introduction to the Environment:

Linux version: CentOS 7 64-bit
Nginx Version: nginx-1.9.5
Nginx is a lightweight Web server, can do load balancer and Web server, Nginx performance is very good, stand-alone can theoretically support 5w concurrency

Two. Preparatory work

1. Install the required libraries for Nginx:
Yum install-y gcc gcc-c++ zlib zlib-devel pcre pcre-devel OpenSSL openssl-devel
Analytical:
GCC:GCC compiler
Gcc-c++: C + + compiler for compiling Nginx HTTP module
Zlib, Zlib-devel: For gzip compression of the contents of the HTTP packet
Pcre, Pcre-devel:pcre Library, Nginx rewrite module required
OpenSSL, Openssl-devel: Used to support the transfer of HTTP on the SSL protocol

2, users and user groups:
Groupadd www #创建www用户组
Useradd-g www www-s/sbin/nologin #创建www用户归入www组, and prohibit www user login system
Mkdir-p/alidata/server/nginx #创建nginx安装目录

Three. Start the installation:

Cd/alidata/server/source
wget http://nginx.org/download/nginx-1.9.5.tar.gz #获取nginx源码
TAR-ZXVF nginx-1.9.5.tar.gz #解压
CD nginx-1.9.5 #进入源码目录
./configure–user=www–group=www–prefix=/alidata/server/nginx–with->http_stub_status_module
–with-http_ssl_module–with-pcre
Use./configure–help to see which compilation options are available, nginx modules must be added at compile time and cannot be added dynamically


If this is the case, it will be successful, and the following command will be performed to complete the installation:

Make && make install #编译并安装

The installation is complete.

Four. Start:

Start Ngin: (Make sure no other programs in Linux occupy Port 80)
Cd/alidata/server/nginx #进入安装目录
./sbin/nginx #启动

No error indicates a successful start,
Enter the IP address of Linux in the browser, my is: http://192.168.186.130, if the following information is displayed, the installation is successful.


Also attached are some of Nginx's learning materials: http://yun.baidu.com/share/link?shareid=309794494&uk=3156731279

'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
  • '). Text (i)); }; $numbering. FadeIn (1700); }); });

    The above describes the Linux server erection of the second-source installation Web server Nginx, including the contents of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.