[英]Multiple domain with the same ip and port in apache
I want to bind two different domain in my VPS with the same ip and port, here is my httpd.conf
: 我想在我的VPS中使用相同的ip和端口绑定两个不同的域,这是我的
httpd.conf
:
<VirtualHost 106.187.96.123:80>
DocumentRoot /home/roy/sobuhu
ServerName aaa.com
</VirtualHost>
<VirtualHost 106.187.96.123:80>
DocumentRoot /disk1/allen/www
ServerName bbb.com
</VirtualHost>
<VirtualHost 106.187.96.123:80>
DocumentRoot /disk1/allen/www
ServerName www.bbb.com
</VirtualHost>
Can I config the ServerName use syntax like *.bbb.com ? 我可以配置像@ .bbb.com这样的ServerName使用语法吗? so I can access www.bbb.com、bbs.bbb.com with the
DocumentRoot /disk1/allen/www
. 所以我可以使用
DocumentRoot /disk1/allen/www
访问www.bbb.com,bbs.bbb.com。
Now I visit bbs.bbb.com, it will turn to /home/roy/sobuhu
. 现在我访问bbs.bbb.com,它将转向
/home/roy/sobuhu
。
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /home/roy/sobuhu
ServerName aaa.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /disk1/allen/www
ServerName bbb.com
ServerAlias *.bbb.com
</VirtualHost>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.