CentOS6.5下源码安装 Nginx
2018-02-11 16:26
369 查看
写在前面:
建议先大体看一遍,然后再根据实际情况安装。
1、下载nginx源码
nginx源码下载地址:http://nginx.org/en/download.html
选择需求的版本,右击复制链接,然后使用wget命令下载
建议先大体看一遍,然后再根据实际情况安装。
1、下载nginx源码
nginx源码下载地址:http://nginx.org/en/download.html
选择需求的版本,右击复制链接,然后使用wget命令下载
//我的下载目录是 /usr/local/src/ //我是用的版本是最新稳定版nginx-1.12.2 [root@localhost src]# wget http://nginx.org/download/nginx-1.12.2.tar.gz[/code]
2、解压源码tar -zxvf nginx-1.12.2.tar.gz
3、配置源码[root@localhost src]# cd nginx-1.12.2 [root@localhost nginx-1.12.2]# ./configure
此处我这里出现了错误:checking for OS + Linux 2.6.32-431.el6.x86_64 x86_64 checking for C compiler ... not found ./configure: error: C compiler cc is not found
解决方法->http://blog.csdn.net/xinyflove/article/details/79310996
再次配置[root@localhost nginx-1.12.2]# ./configure
又出现一个错误./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option.
安装pcre-devel解决问题(作用是让ngnix支持rewrite功能)yum -y install pcre-devel
再次配置[root@localhost nginx-1.12.2]# ./configure
又出现一个错误./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using --with-zlib=<path> option.
安装zlib-devel解决问题yum -y install zlib-devel
再次配置[root@localhost nginx-1.12.2]# ./configure
这次没有错误提示了,配置成功。
返回 配置概述 信息:Configuration summary //配置概述 + using system PCRE library //使用系统PCRE库 + OpenSSL library is not used //不使用OpenSSL库 + using system zlib library //使用系统zlib库 nginx path prefix: "/usr/local/nginx" //安装目录 nginx binary file: "/usr/local/nginx/sbin/nginx" //二进制文件 nginx modules path: "/usr/local/nginx/modules" //模块目录 nginx configuration prefix: "/usr/local/nginx/conf" //配置文件目录 nginx configuration file: "/usr/local/nginx/conf/nginx.conf" //配置文件 nginx pid file: "/usr/local/nginx/logs/nginx.pid" //pid文件 nginx error log file: "/usr/local/nginx/logs/error.log" //错误日志文件 nginx http access log file: "/usr/local/nginx/logs/access.log" //http权限日志文件 nginx http client request body temporary files: "client_body_temp" //http客户机请求主体临时文件 nginx http proxy temporary files: "proxy_temp" //http代理临时文件 nginx http fastcgi temporary files: "fastcgi_temp" //http fastcgi临时文件 nginx http uwsgi temporary files: "uwsgi_temp" //http uwsgi临时文件 nginx http scgi temporary files: "scgi_temp" //http scgi临时文件
Tip:
如果需要安装openssl(https支持)//安装openssl yum -y install openssl openssl-devel //然后在进行配置。 ./configure
4、安装 make && make install[root@localhost nginx-1.12.2]# make [root@localhost nginx-1.12.2]# make install
没有错误提示,安装成功。
5、启动nginx/usr/local/nginx/sbin/nginx
其他nginx命令/usr/local/nginx/sbin/nginx -s reload /usr/local/nginx/sbin/nginx -s stop
相关文章推荐
- CentOS6.5下源码安装 PHP(Unix 系统下的 Nginx)
- CentOS 6.5下源码安装MySQL 5.6
- centos7下源码安装多个nginx步骤完整版
- centos下源码安装Nginx详细操作步骤和方法
- centos6.5下安装nginx配置https
- CentOS5.5 Nginx环境搭建(源码方式安装)
- [原创]在Centos7.2上源码安装PHP、Nginx、Zentao禅道
- CentOS源码编译安装Nginx
- CentOS6.5下Nginx1.7.4安装记录
- centOS6.5下yum安装nginx1.10.2
- Linux(CentOS) - 源码编译安装Nginx
- centos5.5下源码安装nginx
- centos 6.5下安装mysql+nginx+redmine 3.1.0 笔记
- CentOS 6.5下源码安装mysql 5.5
- Centos6.5下nginx编译安装
- CentOS_6.5下安装Nginx+PHP+MySQL
- CentOS源码包安装apache、nginx服务
- ubuntu/redhat/centOS下源码安装nginx+php+mysql
- Centos6.4 源码安装nginx之LNMP
- CentOS6.5下源码安装gcc-4.9.4