vi /home/nginx/conf/nginx.conflocation / { root /mnt; autoindex on; }
3.vmware 掛載 iso鏡像文件
虛擬機->設置->CD/DVD 選擇“使用iso鏡像文件”,“瀏覽”選擇ISO文件路徑。
4.掛載 鏡像文件到 /mnt 之下。
mount /dev/cdrom /mnt
5.修改 CentOS-Base.repo
cd /etc/yum.repo.d/#備份一下cp CentOS-Base.repo CentOS-Base.repo.bakvi CentOS-Base.repo[base]name=CentOS-Centos-Localbaseurl=http://192.168.252.10gpgcheck=0
6.清空本地軟件包緩存信息,重新生成
yum clean allyum makecache
7.關閉防火墻,啟動 nginx
service iptables stop/home/nginx/sbin/nginx
如果出現以下錯誤
[root@node2 ~]# /opt/nginx/sbin/nginxnginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)[root@node2 ~]# fuser -k 80/tcp80/tcp: 1209 1210[root@node2 ~]# /home/nginx/sbin/nginx