当前位置 主页 > 服务器问题 > nginx问题汇总 >

Linux下安装配置nginx详解

栏目:nginx问题汇总 时间:2018-10-30 16:30

本篇文章主要介绍了Linux下安装配置nginx,介绍了在Linux系统下安装配置Nginx的详细过程,具有一定的参考价值,有兴趣的可以了解一下。

一、Linux下安装配置nginx

第一次安装nginx,中间出现的问题一步步解决。

用到的工具secureCRT,连接并登录服务器。

1.1 rz命令,会弹出会话框,选择要上传的nginx压缩包。

#rz 

1.2 解压

[root@vw010001135067 ~]# cd /usr/local/[root@vw010001135067 local]# tar -zvxf nginx-1.10.2.tar.gz

1.3 进入nginx文件夹,执行./configure命令

[root@vw010001135067 local]# cd nginx-1.10.2[root@vw010001135067 nginx-1.10.2]# ./configure

报错如下:

checking for OS + Linux 2.6.32-431.el6.x86_64 x86_64checking for C compiler ... not found./configure: error: C compiler cc is not found

出现这个错误。那么就是gcc 包没有安装。

1.3.1 安装gcc

查看gcc

[root@vw010001135067 nginx-1.10.2]# whereis gccgcc:

安装gcc

[root@vw010001135067 nginx-1.10.2]# yum -y install gcc

安装成功后再次查看

[root@vw010001135067 nginx-1.10.2]# whereis gccgcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz

gcc安装好了。

1.3.2 继续执行./configure

[root@vw010001135067 nginx-1.10.2]# ./configurechecking for OS + Linux 2.6.32-431.el6.x86_64 x86_64checking for C compiler ... found......checking for PCRE library ... not foundchecking for PCRE library in /usr/local/ ... not foundchecking for PCRE library in /usr/include/pcre/ ... not foundchecking for PCRE library in /usr/pkg/ ... not foundchecking for PCRE library in /opt/local/ ... not found./configure: error: the HTTP rewrite module requires the PCRE library.You can either disable the module by using --without-http_rewrite_moduleoption, or install the PCRE library into the system, or build the PCRE librarystatically from the source with nginx by using --with-pcre=<path> option.

出现如上错误。安装pcre-devel

[root@vw010001135067 nginx-1.10.2]# yum install pcre-devel

1.3.3 再次执行./configure

error: the HTTP gzip module requires the zlib library.You can either disable the module by using --without-http_gzip_moduleoption, or install the zlib library into the system, or build the zlib librarystatically from the source with nginx by using --with-zlib=<path> option.

如果有这个错误 那么执行

yum install zlib-devel

1.3.4 执行./configure后没有报错

[root@vw010001135067 nginx-1.10.2]# ./configurechecking for OS + Linux 2.6.32-431.el6.x86_64 x86_64checking for C compiler ... found + using GNU C compiler + gcc version: 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) .......Configuration summary + using system PCRE library + OpenSSL library is not used + md5: using system crypto library + sha1: using system crypto library + using system zlib library 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" nginx error log file: "/usr/local/nginx/logs/error.log" nginx http access log file: "/usr/local/nginx/logs/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp"



缩小 缩小 缩小 缩小
IIS7整站下载工具 IIS7批量查询排名 IIS7远程桌面连接工具 iis7-iis网站批量管理 iis7批量替换工具 IIS7服务器专用下载工具 IIS7日志分析工具 IIS7批量PING,服务器批量添加网卡IP小工具 IIS7远程同步备份工具
IIS7网站监控 站群批量SEO查询 批量获取排名域名 批量关键词排名查询 模拟各种蜘蛛 批量友情链接监测 批量检测死链 搜索引擎大全 批量查询外链
批量查询网站标题 批量查询KeyWords 批量查询描述 批量查询网站IP 批量百度收录查询 批量查询百度日收录 批量查询百度周收录 批量查询百度月收录 批量查询360总收录 批量查询360日收录 批量查询网站年龄 批量查询360PC权重 批量查询爱站移动权重 批量查询站长移动权重 批量查询360移动权重 批量查询神马权重 批量查询谷歌PR 批量查询搜狗PR 批量查询百度反链 批量查询爱站首页反链 批量查询爱站内页反链 批量查询百度快照 批量查询搜狗快照 批量icp备案查询 批量网站ip地址查询 批量查询导出链接 批量查询百度V认证 批量查询百度安全 批量查询站长PC权重 批量查询爱站PC权重 批量查询搜狗总收录 站长资源大全 IIS7-cms大全 IIS7站群大全 IIS7虚拟空间大全 IIS7服务器大全 IIS7-VPS大全