配置apache基于端口的虚拟主机。
apache默认首页目录:/var/www/html/
编辑配置文件:
[root@super63 ~]# vim /etc/httpd/conf/httpd.conf
NameVirtualHost *:80
Listen 80
Listen 81
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/html
ServerName />
ErrorLog logs/ />
CustomLog logs/ common
</VirtualHost>
<VirtualHost *:81>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/html/web1/
ServerName bbs.example.com
ErrorLog bbs.example.com-error_log
CustomLog logs/bbs.example.com-access_log common
</VirtualHost>
检查配置文件语法:
[root@super63 ~]# httpd -t
启动apache:
[root@super63 ~]# /etc/init.d/httpd start
阅读(413) | 评论(0) | 转发(0) |