[[email protected] ~]# wget -c http://nginx.org/download/nginx-1.7.9.tar.gz #下载安装包
[[email protected] ~]# ls
anaconda-ks.cfg Downloads Pictures Videos Desktop initial-setup-ks.cfg nginx-1.7.9.tar.gz Public Documents Music original-ks.cfg Templates
[[email protected] ~]# tar zxvf nginx-1.7.9.tar.gz #解压
[[email protected] ~]# ls
anaconda-ks.cfg Downloads nginx-1.7.9 Pictures Videos
Desktop initial-setup-ks.cfg nginx-1.7.9.tar.gz Public Documents Music original-ks.cfg Templates
[[email protected] ~]# cd nginx-1.7.9/
[[email protected] nginx-1.7.9]# ls
auto CHANGES.ru configure html Makefile objs src
CHANGES conf contrib LICENSE man README
[[email protected] nginx-1.7.9]# yum -y install gcc-c++ pcre-devel zlib-devel #安装依赖,主要是安装这些,而接下来的三步则是编译安装必须执行的,其中prefix选项是指安装位置
[[email protected] nginx-1.7.9]# ./configure --prefix=/usr/etc/ngin
[[email protected] nginx-1.7.9]# make
[[email protected] nginx-1.7.9]# make install
[[email protected] nginx-1.7.9]# cd /usr/etc/ngin
[[email protected] ngin]# ls
client_body_temp fastcgi_temp logs sbin uwsgi_temp
conf html proxy_temp scgi_temp
[[email protected] ngin]# cd sbin
[[email protected] sbin]# ./nginx #启动服务,现在访问localhost就能看到nginx的欢迎界面了
原文地址:https://www.cnblogs.com/biaopei/p/9199599.html