CentOS6.5 compiling and installing nginx and OpenSSL

Source: Internet
Author: User

Nginx is a lightweight Web server/reverse proxy server and e-mail (IMAP/POP3) proxy server that is released under a bsd-like protocol. Developed by Russian program designer Igor Sysoev for use in Russian large portals and search engine Rambler (Russian: Рамблер). It is characterized by the possession of less memory, concurrency, in fact, nginx small file concurrency ability in the same type of Web server performance better.


Nginx Compile and install:

1. Download OpenSSL

[Email protected] ~]# wget http://www.openssl.org/source/openssl-1.0.2.tar.gz


2. Download Nginx

[Email protected] ~]# wget http://nginx.org/download/nginx-1.6.2.tar.gz


3. Unzip the Software

[[Email protected] ~]# tar zxf openssl-1.0.2.tar.gz[[email protected] ~]# tar zxf nginx-1.6.2.tar.gz


4. Compiling Nginx

[Email protected] ~]# CD Nginx-1.6.2[[email protected] nginx-1.6.2]#./configure--user=www--group=www--prefix=/data/ nginx1.6.2--with-http_stub_status_module--with-http_gzip_static_module--with-http_ssl_module--with-openssl=/ root/openssl-1.0.2

Note: Compile Nginx Add SSL support, if need to compile OpenSSL, is not required to compile Opensll,--with-openssl=dir DIR is the source path of OpenSSL, not the installation path of OpenSSL, otherwise make will error:

MAKE[1]: Entering directory '/root/nginx-1.6.2 ' Cd/server/openssl && make clean &&./confi G--prefix=/server/openssl/openssl no-shared no-threads && make && make installmake[2]: E  ntering directory '/server/openssl ' make[2]: * * * No rule to do target ' clean '. STOP.MAKE[2]: Leaving directory '/server/openssl ' make[1]: * * * [/server/openssl/openssl/include/openssl/ssl.h] Error 2MAKE[1]: Leaving directory '/root/nginx-0.7.61 ' make: * * * [build] Error 2


If it appears

./configure:error:the HTTP Rewrite module requires the PCRE library. You can either disable the module by using--without-http_rewrite_moduleoption, or install the PCRE library into the Syste m, or build the PCRE librarystatically from the source with Nginx by using--with-pcre=<path> option.

This note does not install Pcre & Pcre-devel package, here Yum installs

[Email protected] nginx-1.6.2]# yum-y install pcre pcre-devel


5. Installing Nginx

[[email protected] nginx-1.6.2]# Make[[email protected] nginx-1.6.2]# make install


6. Check Nginx before starting

[Email protected] nginx-1.6.2]#/data/nginx1.6.2/sbin/nginx-tnginx:the configuration file/data/nginx1.6.2/conf/ nginx.conf syntax is oknginx: [Emerg] Getpwnam ("www") failednginx:configuration file/data/nginx1.6.2/conf/nginx.conf Test failed

Check to see that no user is running, new WWW account

[Email protected] nginx-1.6.2]# groupadd www[[email protected] nginx-1.6.2]# useradd-g www-s/sbin/nologin-d/dev/null Www

7. Check Again

[Email protected] nginx-1.6.2]#/data/nginx1.6.2/sbin/nginx-t
Nginx:the configuration file/data/nginx1.6.2/conf/nginx.conf syntax is OK
Nginx:configuration file/data/nginx1.6.2/conf/nginx.conf Test is successful

8. Start Nginx

[Email protected] nginx-1.6.2]#/data/nginx1.6.2/sbin/nginx

9. Check the port

[[email protected] nginx-1.6.2]# netstat-ntlup |grep:80tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 19849/nginx

10. Check the process

[[Email protected] nginx-1.6.2]# PS aux |grep nginxroot 19849 0.0 0.0 22664 852?        Ss 11:19 0:00 nginx:master process/data/nginx1.6.2/sbin/nginxwww 19850 0.0 0.1 23100 1448? S 11:19 0:00 nginx:worker processroot 19858 0.0 0.0 103244 856 pts/0 s+ 11:21 0:00 grep nginx

11. Website Access

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5A/16/wKioL1T2fL_zYxrrAAGEdK_4bkY849.jpg "title=" 1.PNG " alt= "Wkiol1t2fl_zyxrraagedk_4bky849.jpg"/>

This article is from "Maple Night" blog, please be sure to keep this source http://fengwan.blog.51cto.com/508652/1617167

CentOS6.5 compiling and installing nginx and OpenSSL

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.