centos6.5编译安装nginx
一、下载nginx安装包,官网下载中心http://nginx.org/download
1 | [root@localhost software]# wget http: //nginx.org/download/nginx-1.10.1.tar.gz |
二、解压nginx安装包
1 | [root@localhost software]# tar -xzvf nginx-1.10.1.tar.gz |
三、安装相关库和安装依赖(gzip模块需要 zlib 库,rewrite模块需要 pcre 库,ssl 功能需要openssl库)
1 | [root@localhost software]# yum -y install gcc pcre-devel zlib-devel openssl-devel |
四、执行configure命令(--prefix是打算将Nginx安装路径)
1 | [root@localhost nginx-1.10.1]# ./configure --prefix=/usr/local/nginx |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | //执行configure成功后,显示的信息。 checking for zlib library ... found creating objs/Makefile Configuration summary + using system PCRE library + OpenSSL library is not used + using builtin md5 code + sha1 library is not found + 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" |
五、编译安装(make && make install)
1 | [root@localhost nginx-1.10.1]# make && make install |
六、启动nginx服务
1 2 | [root@localhost nginx-1.10.1]# cd /usr/local/nginx/ [root@localhost nginx]# ./sbin/nginx |
七、安装成功(通过浏览器访问,记得开放80端口或者关闭防火墙)
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
2016-09-07 ubuntu 安装 lamp 和配置虚拟机
2016-09-07 Ubuntu 安装phpmyadmin 和配置
2016-09-07 ubuntu的 mysql 存储目录迁移