服务器之家:专注于服务器技术及软件下载分享
分类导航

云服务器|WEB服务器|FTP服务器|邮件服务器|虚拟主机|服务器安全|DNS服务器|服务器知识|Nginx|IIS|Tomcat|

服务器之家 - 服务器技术 - Nginx - Centos下编译安装Nginx教程详解

Centos下编译安装Nginx教程详解

2019-11-18 16:27tongyimplin Nginx

这篇文章主要介绍了Centos下编译安装Nginx的教程详解,非常不错,具有参考借鉴价值,需要的朋友可以参考下

一、安装nginx时必须先安装相应的编译工具

?
1
2
yum -y install gcc gcc-c++ autoconf automake
yum -y install zlib zlib-devel openssl openssl-devel pcre-devel

建立nginx 组

?
1
2
3
groupadd -r nginx
useradd -s /sbin/nologin -g nginx -r nginx
id nginx

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

openssl:nginx提供ssl功能

pcre:支持地址重写rewrite功能

二、tar -zxvf nginx-1.2.8.tar.gz

三、cd nginx-1.2.8

四、./configure \

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--prefix=/usr \
--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 \
--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 \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi \
--with-http_stub_status_module

五、make && make install

小结:centos没有安装make编译器

解决:

?
1
yum -y install gcc automake autoconf libtool make

以上所述是小编给大家介绍的Centos下编译安装Nginx教程详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对服务器之家网站的支持!

原文链接:http://blog.csdn.net/tongyimplin/article/details/53780822

延伸 · 阅读

精彩推荐