Apache的安装:
#yum -y install httpd
#service iptables stop
#setenforce 0
配置基于ip的虚拟主机
为虚拟主机创建目录:
#mkdir /var/www/wg
#mkdir /var/www/bw
新建测试页面
#vim /var/www/wg/index.html
This is wg!!!
#vim /var/www/bw/index.html
This is bw!!!
修改主配置文件:
#vi /etc/httpd/conf/httpd.conf
Listen 8080
Listen 8090
<VirtualHost *:8080>
DocumentRoot /var/www/wg
ServerName www.wg.com
###bw####
<VirtualHost *:8090>
DocumentRoot /var/www/bw
ServerName www.bw.com
重启apache并测试:
#service httpd restart