赞
踩
#cd /etc/yum.repos.d
#mkdr bak
#mv *.repo bak/
#wget http://mirrors.aliyun.com/repo/Centos-7.repo
#yum clean all
#yum makecache
#yum install -y epel-release
#yum install nginx
vim /etc/nginx/nginx.conf
/usr/share/nginx/html
error_log /var/log/nginx/error.log;
error_log /var/log/nginx/access.log
安全加固:https://www.cnblogs.com/xiaozi/p/10119062.html
#vim /etc/nginx/nginx.conf
在文件最后一个}号前添加:
include vhost/*.conf;
# cd /etc/nginx
# mkdir vhost
# vim vhost/www.test.conf
server{
listen 192.168.75.128:80;
server_name www.test.com;
location / {
root /data/test;
index index.html;
}
}
nginx -t
systemctl restart nginx
systemctl stop firewalld
setenforce 0
# vim /etc/hosts
添加:
192.168.75.128 www.test.com
192.168.75.128:虚拟机ip地址
lsof -i 80
netstat -tunlp
kill -9 PID
ping www.test.com
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。