Home  >  Article  >  Backend Development  >  Installation and deployment of Nginx under Linux

Installation and deployment of Nginx under Linux

WBOY
WBOYOriginal
2016-08-08 09:20:14913browse

1. Introduction to Nginx

Nginx ("engine IMAP/POP3/SMTP server. Nginx as Load balancing server: Nginx It can not only directly support Rails and PHP programs to serve externally internally, but also support external services as HTTPproxy server. nginx website domestic users include: Baidu, Sina, NetEase, Tencent, etc.etc. 2. Nginx installation Download Nginx (http://nginx.org/en/download.html), the latest one seems to be nginx-1.9.3

.

                    Download:

wget   http://nginx.org/download/nginx-1.9.3.tar.gz                                          through Before installing the modules required by ngxin, And software for compiling c, c++ devel openssl openssl--devel pcre pcre-devel

Decompression: For example, the file is downloaded in the /home/andy/ directory

tar xzvf nginx-1.9.3.tar.gz

cd nginx-1.9.3

Install the modules required for Nginx

./configure --prefix=/home/nginx --with-http_stub_status_module

--with-debug --with-http_realip_module

--with-http_ssl_module

                                                      Make install

                                                                                                                ​./nginx Restart s CD SBIN

./nginx -S RELOAD III. Installed problems If the following problems occur when starting, the port is occupied

                                                                                                                              80 Query the process occupying port 80

Kill the process Kill -s 9 pid (process id)

              2:错误为:./configure: error: the HTTP rewrite module requires thePCRE library.

                        解决办法:安装pcre-devel模块

                           yum -y install pcre-devel

              3:错误提示:./configure: error: the HTTP cache module requires md5functions from OpenSSL library.   You can either disable the module by using --without-http-                   cache option, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using--with-http_ssl_module --                        with-openssl= options.

         解决办法:

          yum -yinstall openssl openssl-devel


      安装完毕。

版权声明:本文为博主原创文章,未经博主允许不得转载。

以上就介绍了Nginx在Linux下的安装部署,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Statement:
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