nginx下载与安装

2019-03-06 23:40|来源: 网路

下载

http://nginx.org/en/download.html


下载最新版本:nginx-1.8.0

http://nginx.org/download/nginx-1.8.0.tar.gz


文档

http://nginx.org/en/docs/

安装文档:http://nginx.org/en/docs/install.html

源码编译安装文档:http://nginx.org/en/docs/configure.html


安装

解压

[root@master local]# tar -zxvfnginx-1.8.0.tar.gz

[root@master local]# cd nginx-1.8.0


查看编译帮助文档,可以装哪些模块

[root@master nginx-1.8.0]# ./configure –help


创建用户

[root@master nginx-1.8.0]# groupadd -rnginx

[root@master nginx-1.8.0]# useradd -s/sbin/nologin -g nginx -r nginx

[root@master nginx-1.8.0]# id nginx

uid=494(nginx) gid=492(nginx) 组=492(nginx)


编译安装

安装编译工具和相应的库

yum -y install gcc gcc-c++ autoconfautomake

yum -y install zlib zlib-devel opensslopenssl-devel pcre-devel


zlib:nginx提供gzip模块,需要zlib库支持

openssl:nginx提供ssl功能

pcre:支持地址重写rewrite功能


[root@master nginx-1.8.0]# ./configure \

> --prefix=/usr/local/nginx \

> --sbin-path=/usr/sbin/nginx \

> --conf-path=/etc/nginx/nginx.conf \

>--error-log-path=/var/log/nginx/error.log \

> --pid-path=/var/run/nginx/nginx.pid \

> --lock-path=/var/lock/nginx.lock \

> --user=nginx \

> --group=nginx \

> --with-http_ssl_module \

> --with-http_flv_module \

> --with-http_gzip_static_module \

>--http-log-path=/var/log/nginx/access.log \

>--http-client-body-temp-path=/var/tmp/nginx/client \

>--http-proxy-temp-path=/var/tmp/nginx/proxy \

> --with-http_stub_status_module


Configuration summary

 +using system PCRE library

 +using system OpenSSL library

 +md5: using OpenSSL library

 +sha1: using OpenSSL library

 +using system zlib library


nginx path prefix: "/usr/local/nginx"

nginx binary file: "/usr/sbin/nginx"

nginx configuration prefix: "/etc/nginx"

nginx configuration file: "/etc/nginx/nginx.conf"

nginx pid file: "/var/run/nginx/nginx.pid"

nginx error log file: "/var/log/nginx/error.log"

nginx http access log file: "/var/log/nginx/access.log"

nginx http client request body temporary files:"/var/tmp/nginx/client"

nginx http proxy temporary files: "/var/tmp/nginx/proxy"

nginx http fastcgi temporary files: "fastcgi_temp"

nginx http uwsgi temporary files: "uwsgi_temp"

nginx http scgi temporary files: "scgi_temp"


安装

[root@master nginx-1.8.0]# make &&make install


安装出错

缺少pcre

./configure: error: the HTTP rewrite module requires the PCRElibrary.

You can either disable the module by using--without-http_rewrite_module

option, or install the PCRE library into the system, or buildthe PCRE library

statically from the source with nginx by using--with-pcre=<path> option.

[root@master nginx-1.8.0]# yum -y install pcre-devel


相关问答

更多
  • 出现这个错误是因为nginx的安装目录和解压缩目录选择了同一个,并且参数没有配置好。 举例说明:在centos 7.2 环境下,我把nginx-1.12.2.tar.gz压缩文件放在/opt/目录下,tar -zxvf nginx-1.12.2.tar.gz 解压以后出现nginx-1.12.2文件夹,mv nginx-1.12.2 nginx更改文件夹名为nginx,cd nginx 进入nginx目录,./configure --prefix=/opt/nginx 设置参数,make进行编译,make ...
  • windows系统装什么nginx, nginx在windows上面和IIS、apache相比,效率又不高又不稳定。
  • 和法度榜样一般没有关系,有很多nginx的phpcms案例,请细心检查您的许可情况
  • nginx默认是监听80端口,而80端口在win7下会被系统占用。 需要修改注册表(或让nginx监听其他端口): 1、打开注册表:regedit 2、找到:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP 3、找到一个REG_DWORD类型的项Start,将其改为0 4、重启系统,System进程不会占用80端口
  • 可以,在linux下,有的会用apache去跑php,然后用nginx做反向代理,比如apache运行在8080端口,nginx在80端口,访问php文件时,反向代理到apache,静态页通过nginx处理。nginx支持高并发,apache对php的运行比较稳定。
  • 刚刚有人指点了一下apt-get install nginx 就这么一行命令之后sudo /etc/init.d/nginx start就行了,懒人适用 哈哈
  • 您好! 还请您谅解的哦,请问不安装出现什么提示的哦,①.提示内存不足。建议您将安装到手机中的程序移动到sd卡中再使用,您可以进入手机设置-通用-应用程序-已安装中将安装在手机中的程序移动到sd卡中。如果程序都移动了还是提示内存不足的话,您需要卸载几个安装在手机中的程序(也就是移动不了的程序)释放了空间才能再安装其他程序。 ②提示解析错误。可能是下载的安装包损坏,建议重新下载资源进行安装. ③提示未安装。部分软件因为分辨率不支持,或者软件或该软件版本与手机系统不兼容导致无法安装,建议您更换其他版本或其他第三方 ...
  • 看你是下载的什么样的了。如果是压缩文件,先解压到一个文件夹中,然后打开文件夹选择安装程序进行安装主,这个与一般的程序安装没什么区别的。如果是破解版的,解压的文件夹中可能有破解补丁,安装完主程序后再运行破解补丁就可以了;如是绿色版的,解压后运行autocad,exe就可以使用了
  • 应用宝下载安装[2023-11-02]

    打开浏览器,输入如图网址,打开应用宝官网 按需选择下载电脑版还是下载手机版, 由于电脑版安装好后,连接手机会自动给手机安装,下载电脑版 应用宝结合手机管理和手机应用软件,综合手机多元化性能的一款手机软件 实现手机一体化手机管理应用,多元化丰富资源应用和使用。 并对手机提供丰富快速且优质和个性化的全方面管理应用 满足手机现代化休闲等多样化需求 在应用宝的工具箱中更有多项手机管理功能 方便用户管理和使用手机。
  • 在/ etc / nginx / sites-available / default中我注释掉了以下行: #fastcgi_pass 127.0.0.1:9000; In /etc/nginx/sites-available/default I commented out the following line: #fastcgi_pass 127.0.0.1:9000;