我有一个主域www.example.com
我想有这样的子域
www.pictures.example.com
我(想)可以select:
我的问题是:
你在这里实际上没有select。 如果你运行两个独立的Apache实例,他们不能同时抓取端口80.使用虚拟主机是最好的解决scheme。
将以下内容添加到您的apacheconfiguration中:
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /var/www/example.com ServerName example.com ServerAlias www.example.com # the remainder of your example.com configuration goes here </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/pictures.example.com ServerName pictures.example.com ServerAlias www.pictures.example.com # the remainder of your pictures.example.com configuration goes here </VirtualHost>