安装环境准备:一台虚拟机、可以上网、yum环境为本机自带yum:CentOS-Base.repo
下载安装环境 #yum -y install gcc make zlib-devel pcre pcre-devel openssl-devel
准备上传nginx包:
# cd /tmp
# rm -rf *
# ls
# rz
用rz命令nginx-1.4.7.tar.gz
# cd nginx-1.4.7/
源码编译安装# ./configure --prefix=/usr/local/nginx
#make && make install
安装成功之后启动nginx
# /usr/local/nginx/sbin/nginx 启动
# lsof -i:80 查看端口
# ps aux | grep nginx 查看启动进程
# /usr/local/nginx/sbin/nginx -s stop 停止运行nginx
网页访问nginx,输入本机ip直接访问