标签:nginx
一、安装相关组件
yum -y install pcre pcre-devel zlib zlib-devel openssl openssl-devel
二、下载安装包
wget http://nginx.org/download/nginx-1.9.7.tar.gz
三、安装Nginx
解压缩:tar xf nginx-1.9.7.tar.gz && cd nginx-1.9.7
编译: ./configure --prefix=/usr/local/nginx --with-http_gzip_module --with-http_stub_status_module --with-http-ssl_module --with-http_flv_module --with-http_rewrite_module && make && make install
四、配置环境变量
vim /etc/profile.d/nginx.sh
NGINX_HOME=/usr/local/nginx
PATH=$NGINX_HOME/sbin:$PATH
export PATH
source /etc/profile
五、测试访问
启动服务: nginx
检查是否启动: netstat -tlnp |grep 80
ps uax |grep nginx
lsof -i:80
测试: curl http://localhost
curl --head http://localhost
elinks http://localhost
本文出自 “IT漫漫路” 博客,请务必保留此出处http://longgege.blog.51cto.com/6740519/1763513
标签:nginx
原文地址:http://longgege.blog.51cto.com/6740519/1763513