【发布时间】:2013-03-11 18:54:38
【问题描述】:
我有一个运行 Ubuntu 11 和 Apache2 的 Linode 服务器,我正在尝试让一个子域正常工作。这是我在sites-available 文件夹中的mywebsite 文件。我尝试将顶部放在它自己的文件testing.mywebsite 中并重新加载 apache2,但没有成功。
<VirtualHost *:80>
DocumentRoot /home/user2/www
ServerName testing.mywebsite.com
</VirtualHost>
<VirtualHost *:80>
ServerAdmin email@gmail.com
ServerName mywebsite.com
ServerAlias *.mywebsite.com
ServerAlias 192.155.90.135
#Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /home/user/public/mywebsite/www
#Log file locations
LogLevel warn
ErrorLog /home/user/public/mywebsite/log/error.log
CustomLog /home/user/public/mywebsite/log/access.log combined
</VirtualHost>
我有一个网站正在运行,apache 可以找到/home/user/public/mywebsite/www 中的所有文件,但是当我转到测试子域时,我的浏览器找不到它。我对 apache2 非常陌生,因此不胜感激。谢谢。
【问题讨论】:
标签: linux apache webserver subdomain virtualhost