Nginx在Linux下的安装部署

php中文网
发布: 2016-08-08 09:20:14
原创
1004人浏览过

一、nginx简介

          Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 服务器Nginx作为负载均衡服务器:Nginx 既可以在内部直接支持 Rails 和 PHP 程序对外进行服务,也可以支持作为 HTTP代理服务器对外进行服务。nginx网站国内的用户有:百度、新浪、网易、腾讯等等。

二、Nginx的安装

       下载Nginx(http://nginx.org/en/download.html),最新的好像是nginx-1.9.3

       下载:wget  http://nginx.org/download/nginx-1.9.3.tar.gz

        

        安装:在安装前安装ngxin所需的模块,以及编译c,c++的软件

                   yum install gcc-c++

         yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel

   解压:比如文件下载在/home/andy/目录下

        tar xzvf nginx-1.9.3.tar.gz

        cd nginx-1.9.3

   安装Nginx所需的模块

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

--with-debug --with-http_realip_module  --with-http_ssl_module


      

      

         编译安装

                 make

                 make install

       

        启动Nginx

                 cd sbin

                ./nginx

        重新启动

                 cd sbin

                ./nginx -s reload 

 三、安装出现的问题

       如果启动时出现如下问题时

             1:端口被占用

                

                 说明:80端口已被占用

                 netstat -anp | grep 80   查询占用80端口的进程

                杀死该进程

                kill  -s 9  pid(进程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教程有兴趣的朋友有所帮助。

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
相关标签:
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号