我不明白,我希望您能够提供帮助。通过端口80将多个域虚拟服务器连接到一台虚拟服务器
我有3个域名和一个服务器。我想通过右边的DirectoryRoot上的端口80获得所有3个域。但我无法做到这一点。使用我当前的站点可用/默认文件,它们都链接到相同的目录(domain3)。
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
ServerName www.domain1.tld
ServerAlias *.domain1.tld
DocumentRoot /var/www/domains/domain1/
<Directory /var/www/domains/domain1/>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ServerName www.domain2.tld
ServerAlias *.domain2.tld
DocumentRoot /var/www/domains/domain2/
<Directory /var/www/domains/domain2>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ServerName www.domain3.tld
ServerAlias *.domain3.tld
DocumentRoot /var/www/domains/domain3/
<Directory /var/www/domains/domain3>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
嘿丹尼斯,谢谢你的回答。不幸的是我无法得到这个工作。我修改了教程“在单个IP地址上运行多个基于名称的网站”。 domain2正在工作,其余的指向/ var/www/domain1 - 有什么我可以做,以确保一切重新加载正确(或者它只是重新启动Apache?) – daniel