环境:CentOS 6.5
1. 安装依赖环境
[[email protected] ~]# yum install pcre-devel zlib-devel openssl-devel -y
2. 安装nginx
[[email protected] ~]# cd /usr/local/src
[[email protected] src]# wget http://nginx.org/download/nginx-1.10.3.tar.gz
[[email protected] src]# tar xf nginx-1.10.3.tar.gz
[[email protected] src]# cd nginx-1.10.3
[[email protected] nginx-1.10.3]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module
[[email protected] nginx-1.10.3]# make && make install
注:http_stub_status_module主要是用于收集nginx的运行状态数据。
注:如果你的系统没有make命令,请使用yum install make -y安装即可。
3.启动
[[email protected] ~]# /usr/local/nginx/sbin/nginx
4.验证
http://10.20.30.40/
时间: 2024-10-10 06:41:27