赞
踩
软件环境
系统:CentOS7
Apache Httpd版本:2.4.6-89.el7.centos.1
Apache Httpd安装方式:yum安装
1. 复制虚拟主机配置文件
cp /usr/share/doc/httpd-2.4.6/httpd-vhosts.conf /etc/httpd/conf.d/
2. 编辑虚拟主机配置文件
vi /etc/httpd/conf.d/httpd-vhosts.conf
加入以下代码并把其余的注释掉:
- <VirtualHost *:80>
- ServerAdmin support@jfedu.net
- DocumentRoot "/var/www/html/jf1"
- ServerName www.jf1.com
- ServerAlias www.dummy-host.example.com
- ErrorLog "logs/www.jf1.com_error_log"
- CustomLog "logs/www.jf1.com_access_log" common
- </VirtualHost>
- <VirtualHost *:80>
- ServerAdmin support@jfedu.net
- DocumentRoot "/var/www/html/jf2"
- ServerName www.jf2.com
- ServerAlias www.dummy-host.example.com
- ErrorLog "logs/www.jf2.com_error_log"
- CustomLog
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。