nginx学习之简化安装篇(一)

环境:CentOS 6.5

1. 安装依赖环境

[root@localhost ~]# yum install pcre-devel zlib-devel openssl-devel -y

 

2. 安装nginx 

[root@localhost ~]# cd /usr/local/src

[root@localhost src]# wget http://nginx.org/download/nginx-1.10.3.tar.gz

[root@localhost src]# tar xf nginx-1.10.3.tar.gz

[root@localhost src]# cd nginx-1.10.3

[root@localhost nginx-1.10.3]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module

[root@localhost nginx-1.10.3]# make && make install

注:http_stub_status_module主要是用于收集nginx的运行状态数据。

注:如果你的系统没有make命令,请使用yum install make -y安装即可。

 

3.启动

[root@localhost ~]# /usr/local/nginx/sbin/nginx

 

4.验证

http://10.20.30.40/

posted @ 2017-04-14 12:12  道霖  阅读(270)  评论(0编辑  收藏  举报