apache_conf
2018-12-12 本文已影响0人
warmi_
yum install httpd 安装
systemctl start httpd.service 开启服务
systemctl enable httpd.service 开机自动重启服务
vi /etc/httpd/conf/httpd.conf 配置文件
Listen 80
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /www/example1
DirectoryIndex index.html index.htm index.php index.php
ServerName www.example1.com
ServerAlias example1.com. *.example1.com
# Other directives here
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /www/example2
ServerName www.example2.org
# Other directives here
</VirtualHost>
systemctl restart httpd.service 重启服务