nginx安装

来源:互联网 发布:12315可以投诉淘宝小二 编辑:程序博客网 时间:2024/06/06 02:54

官网当前最稳定的的版本是1.6.1,本教程以1.6.1为例:

1,redhat和centos可以设置rpm源,

  • RHEL 5
  • RHEL 6
  • RHEL 7
  • CentOS 5
  • CentOS 6
  • CentOS 7
       下载然后安装上面的文件

       运行命令 yum install nginx

       debian和ubuntu可以配置如下源

       deb http://nginx.org/packages/debian/ codename nginx

       deb-src  http://nginx.org/packages/debian/ codename nginx

       或

       deb http://nginx.org/packages/ubuntu/ codename nginx

       deb-src http://nginx.org/packages/ubuntu/ codename nginx

       运行

       apt-get update

       apt-get install nginx

2,源码编译

http://nginx.org/en/download.html 下载nginx1.6.1

./configure    --sbin-path=/usr/local/nginx/nginx    --conf-path=/usr/local/nginx/nginx.conf    --pid-path=/usr/local/nginx/nginx.pid    --with-http_ssl_modulemakemake install
中途可能有依赖关系,可以根据提示安装相关依赖

更多安装信息参考 http://nginx.org/en/docs/configure.html


0 0
原创粉丝点击