1、配置hosts文件
[[email protected]_ttonnet ~]# cat /etc/hosts
123.58.250.36 monitor.ttonnet.com
123.58.250.36 leader.ttonnet.com
2、配置http 虚拟主机
1)、进入/etc/httpd/conf.d目录
2)、创建虚拟主机配置文件
[[email protected]_ttonnet conf.d]# cat httpd-vhosts.conf
NameVirtualHost 123.58.250.36:80
<VirtualHost 123.58.250.36:80>
DocumentRoot /var/www/monitor
ServerName monitor.ttonnet.com
ErrorLog /var/www/monitor/ttonnet.com-err.log
CustomLog /var/www/monitor/ttonnet.com-access.log common
</VirtualHost>
<VirtualHost 123.58.250.36:80>
DocumentRoot /var/www/leader
ServerName leader.ttonnet.com
ErrorLog /var/www/leader/ttonnet.com-err.log
CustomLog /var/www/leader/ttonnet.com-access.log common
</VirtualHost>
[[email protected]_ttonnet conf.d]#
3、重启apache
[[email protected]_ttonnet conf.d]# /etc/init.d/httpd restart
停止 httpd: [确定]
正在启动 httpd:httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 LoadModule auth_basic_module modules/mod_auth_basic.so
for ServerName
[确定]