标签:http
Redhat7 配置http
安装:
# yum install httpd
主配置文件:
/etc/httpd/conf/httpd.conf
log路径:
/var/log/httpd
启动:
# systemctl start httpd
# systemctl enable httpd
开放防火墙:
# firewall-cmd --permanent --add-service=http
其它地址访问该web(selinux):
# setsebool -P httpd_can_network_relay on
对目录设置访问权限:
在<Directory "/var/www/html">里添加
order deny,allow
deny from all
allow 10.0.0.0/24
allow .ming.com (注:前没*)
allow localhost
:wq
注:allow可以写多行,但不能并排写,域名时前不能带"*"
配置虚拟主机:
多端口:
# vi /etc/httpd/conf/httpd.conf (最后添加)
Listen 81
<VirtualHost *:81>
DocumentRoot "/var/www/html/ming"
</VirtualHost>
:wq
多域名:
# vi /etc/httpd/conf/httpd.conf (最后添加)
<VirtualHost *:80>
ServerName aa.ming.com
DocumentRoot "/var/www/html/ming2"
</VirtualHost>
:wq
本文出自 “linux” 博客,请务必保留此出处http://yangzhiming.blog.51cto.com/4849999/1722514
标签:http
原文地址:http://yangzhiming.blog.51cto.com/4849999/1722514