阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS6编译安装Nginx

459次阅读
没有评论

共计 6399 个字符,预计需要花费 16 分钟才能阅读完成。

安装 libunwind

 

64 位操作系统请先安装 libunwind 库,32 位操作系统不要安装。libunwind 库为基于 64 位 CPU 和操作系统的程序提供了基本的堆栈辗转开解功能,其中包括用于输出堆栈跟踪的 API、用于以编程方式辗转开解堆栈的 API 以及支持 C ++ 异常处理机制的 API。

  1. [root@test software]# tar zxvf libunwind-1.1.tar.gz
  2. [root@test software]# cd libunwind-0.99-alpha
  3. [root@test libunwind-0.99-alpha]# CFLAGS=-fPIC ./configure
  4. [root@test libunwind-0.99-alpha]# make CFLAGS=-fPIC
  5. [root@test libunwind-0.99-alpha]# make CFLAGS=-fPIC install

安装 google-perftools

  1. [root@test software]# tar -zxvf gperftools-2.1.tar.gz
  2. [root@test software]# cd gperftools-2.1
  3. [root@test gperftools-2.1]# ./configure
  4. [root@test gperftools-2.1]# make
  5. [root@test gperftools-2.1]# make install
  6. [root@test gperftools-2.1]# echo “/usr/local/lib” > /etc/ld.so.conf.d/usr_local_lib.conf
  7. [root@test gperftools-2.1]# /sbin/ldconfig

安装 nginx

  1. [root@test software]# tar -zxvf nginx-1.5.7.tar.gz
  2. [root@test software]# cd nginx-1.5.7
  3. [root@test nginx-1.5.7]# ./configure –prefix=/service/nginx –with-http_stub_status_module –with-google_perftools_module –with-pcre –with-http_ssl_module –lock-path=/service/nginx/nginx.lock –pid-path=/service/nginx/nginx.pid
  4. ……………………
  5. Configuration summary
  6. + using PCRE library: /service/pcre
  7. + using system OpenSSL library
  8. + md5: using OpenSSL library
  9. + sha1: using OpenSSL library
  10. + using system zlib library
  11. nginx path prefix: “/service/nginx”
  12. nginx binary file: “/service/nginx/sbin/nginx”
  13. nginx configuration prefix: “/service/nginx/conf”
  14. nginx configuration file: “/service/nginx/conf/nginx.conf”
  15. nginx pid file: “/service/nginx/nginx.pid”
  16. nginx error log file: “/service/nginx/logs/error.log”
  17. nginx http access log file: “/service/nginx/logs/access.log”
  18. nginx http client request body temporary files: “client_body_temp”
  19. nginx http proxy temporary files: “proxy_temp”
  20. nginx http fastcgi temporary files: “fastcgi_temp”
  21. nginx http uwsgi temporary files: “uwsgi_temp”
  22. nginx http scgi temporary files: “scgi_temp”
  23. [root@test nginx-1.5.7]# make
  24. [root@test nginx-1.5.7]# make install

测试 nginx

  1. [root@test sbin]# ./nginx -t
  2. nginx: the configuration file /service/nginx/conf/nginx.conf syntax is ok
  3. nginx: configuration file /service/nginx/conf/nginx.conf test is successful
  4. [root@test sbin]# ./nginx -v
  5. nginx version: nginx/1.5.7
  6. [root@test sbin]#
 
  1. [root@test nginx]# /service/nginx/sbin/nginx
  2. [root@test nginx]# netstat -lanp|grep nginx
  3. tcp 0 0 0.0.0.0:81 0.0.0.0:* LISTEN 27889/nginx
  4. unix 3 [] STREAM CONNECTED 54224 27889/nginx
  5. unix 3 [] STREAM CONNECTED 54223 27889/nginx
  6. [root@test nginx]# ll
  7. total 40
  8. drwx—— 2 nobody root 4096 Nov 26 21:24 client_body_temp
  9. drwxr-xr-x 2 root root 4096 Nov 26 21:38 conf
  10. drwx—— 2 nobody root 4096 Nov 26 21:24 fastcgi_temp
  11. drwxr-xr-x 2 root root 4096 Nov 26 21:23 html
  12. drwxr-xr-x 2 root root 4096 Nov 26 21:24 logs
  13. -rw-r–r– 1 root root 6 Nov 26 21:40 nginx.pid
  14. drwx—— 2 nobody root 4096 Nov 26 21:24 proxy_temp
  15. drwxr-xr-x 2 root root 4096 Nov 26 21:23 sbin
  16. drwx—— 2 nobody root 4096 Nov 26 21:24 scgi_temp
  17. drwx—— 2 nobody root 4096 Nov 26 21:24 uwsgi_temp
  18. [root@test nginx]# cat nginx.pid
  19. 27889
  20. [root@test nginx]# ps -ef|grep nginx
  21. root 27889 1 0 21:40 ? 00:00:00 nginx: master process /service/nginx/sbin/nginx
  22. nobody 27890 27889 0 21:40 ? 00:00:00 nginx: worker process
  23. root 27902 3729 0 21:40 pts/0 00:00:00 grep nginx

关闭 Nginx

  1. /service/nginx/sbin/nginx -s stop

 

访问 81 端口显示

 

Welcome to nginx!

 

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

推荐阅读

Nginx 实现反向代理和负载均衡的配置及优化 http://www.linuxidc.com/Linux/2013-11/92909.htm

Nginx 做负载均衡报:nginx: [emerg] could not build the types_hash http://www.linuxidc.com/Linux/2013-10/92063.htm

Nginx 负载均衡模块 ngx_http_upstream_module 详述 http://www.linuxidc.com/Linux/2013-10/91907.htm

Nginx+Firebug 让浏览器告诉你负载均衡将请求分到了哪台服务器 http://www.linuxidc.com/Linux/2013-10/91824.htm

Ubuntu 安装 Nginx php5-fpm MySQL(LNMP 环境搭建) http://www.linuxidc.com/Linux/2012-10/72458.htm

Nginx 的详细介绍 :请点这里
Nginx 的下载地址 :请点这里

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-20发表,共计6399字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中

星哥玩云

星哥玩云
星哥玩云
分享互联网知识
用户数
4
文章数
19350
评论数
4
阅读量
7966419
文章搜索
热门文章
星哥带你玩飞牛NAS-6:抖音视频同步工具,视频下载自动下载保存

星哥带你玩飞牛NAS-6:抖音视频同步工具,视频下载自动下载保存

星哥带你玩飞牛 NAS-6:抖音视频同步工具,视频下载自动下载保存 前言 各位玩 NAS 的朋友好,我是星哥!...
星哥带你玩飞牛NAS-3:安装飞牛NAS后的很有必要的操作

星哥带你玩飞牛NAS-3:安装飞牛NAS后的很有必要的操作

星哥带你玩飞牛 NAS-3:安装飞牛 NAS 后的很有必要的操作 前言 如果你已经有了飞牛 NAS 系统,之前...
我把用了20年的360安全卫士卸载了

我把用了20年的360安全卫士卸载了

我把用了 20 年的 360 安全卫士卸载了 是的,正如标题你看到的。 原因 偷摸安装自家的软件 莫名其妙安装...
再见zabbix!轻量级自建服务器监控神器在Linux 的完整部署指南

再见zabbix!轻量级自建服务器监控神器在Linux 的完整部署指南

再见 zabbix!轻量级自建服务器监控神器在 Linux 的完整部署指南 在日常运维中,服务器监控是绕不开的...
飞牛NAS中安装Navidrome音乐文件中文标签乱码问题解决、安装FntermX终端

飞牛NAS中安装Navidrome音乐文件中文标签乱码问题解决、安装FntermX终端

飞牛 NAS 中安装 Navidrome 音乐文件中文标签乱码问题解决、安装 FntermX 终端 问题背景 ...
阿里云CDN
阿里云CDN-提高用户访问的响应速度和成功率
随机文章
还在找免费服务器?无广告免费主机,新手也能轻松上手!

还在找免费服务器?无广告免费主机,新手也能轻松上手!

还在找免费服务器?无广告免费主机,新手也能轻松上手! 前言 对于个人开发者、建站新手或是想搭建测试站点的从业者...
每天一个好玩的网站-手机博物馆-CHAZ 3D Experience

每天一个好玩的网站-手机博物馆-CHAZ 3D Experience

每天一个好玩的网站 - 手机博物馆 -CHAZ 3D Experience 一句话介绍:一个用 3D 方式重温...
星哥带你玩飞牛NAS-16:飞牛云NAS换桌面,fndesk图标管理神器上线!

星哥带你玩飞牛NAS-16:飞牛云NAS换桌面,fndesk图标管理神器上线!

  星哥带你玩飞牛 NAS-16:飞牛云 NAS 换桌面,fndesk 图标管理神器上线! 引言 哈...
恶意团伙利用 PHP-FPM 未授权访问漏洞发起大规模攻击

恶意团伙利用 PHP-FPM 未授权访问漏洞发起大规模攻击

恶意团伙利用 PHP-FPM 未授权访问漏洞发起大规模攻击 PHP-FPM(FastCGl Process M...
星哥带你玩飞牛NAS-7:手把手教你免费内网穿透-Cloudflare tunnel

星哥带你玩飞牛NAS-7:手把手教你免费内网穿透-Cloudflare tunnel

星哥带你玩飞牛 NAS-7:手把手教你免费内网穿透 -Cloudflare tunnel 前言 大家好,我是星...

免费图片视频管理工具让灵感库告别混乱

一言一句话
-「
手气不错
星哥带你玩飞牛NAS硬件03:五盘位+N5105+双网口的成品NAS值得入手吗

星哥带你玩飞牛NAS硬件03:五盘位+N5105+双网口的成品NAS值得入手吗

星哥带你玩飞牛 NAS 硬件 03:五盘位 +N5105+ 双网口的成品 NAS 值得入手吗 前言 大家好,我...
三大开源投屏神器横评:QtScrcpy、scrcpy、escrcpy 谁才是跨平台控制 Android 的最优解?

三大开源投屏神器横评:QtScrcpy、scrcpy、escrcpy 谁才是跨平台控制 Android 的最优解?

  三大开源投屏神器横评:QtScrcpy、scrcpy、escrcpy 谁才是跨平台控制 Andr...
自己手撸一个AI智能体—跟创业大佬对话

自己手撸一个AI智能体—跟创业大佬对话

自己手撸一个 AI 智能体 — 跟创业大佬对话 前言 智能体(Agent)已经成为创业者和技术人绕...
国产开源公众号AI知识库 Agent:突破未认证号限制,一键搞定自动回复,重构运营效率

国产开源公众号AI知识库 Agent:突破未认证号限制,一键搞定自动回复,重构运营效率

国产开源公众号 AI 知识库 Agent:突破未认证号限制,一键搞定自动回复,重构运营效率 大家好,我是星哥,...
星哥带你玩飞牛NAS-11:咪咕视频订阅部署全攻略

星哥带你玩飞牛NAS-11:咪咕视频订阅部署全攻略

星哥带你玩飞牛 NAS-11:咪咕视频订阅部署全攻略 前言 在家庭影音系统里,NAS 不仅是存储中心,更是内容...