0

I have on a server machine a local domain called "localwiki.com" that points to /var/www/wiki and works fine.

The sites-available and sites-enable configuration:

<VirtualHost *:80>
DocumentRoot /var/www/wiki/
ServerName localwiki.com
ServerAlias *.localwiki.com
</VirtualHost>

I wanted to create a second local domain for /var/www/doxygen (which I can access using "serverIP"/doxygen).

Here is the localdoxygen.com config file created at /etc/apache2/sites-available/localdoxygen.com

<VirtualHost *:80>
DocumentRoot /var/www/doxygen/
ServerName localdoxygen.com
ServerAlias *localdoxygen.com
</VirtualHost>

I used "a2ensite" in order to create a symbolic link in sites-enable pointing to localdoxygen.com in sites-available:

sudo a2ensite localdoxygen.com

I also have reloaded the new configuration:

sudo /etc/init.d/apache2 reload

And restarted apache:

sudo service apache2 restart

But the domain (localdoxygen.com), still doesn't work.

Any suggestions on how to fix this?

4

4 回答 4

3

为了解决这个问题,我必须在 /etc/bind 中添加一个条目以激活域的 DNS。

于 2012-05-03T10:45:03.877 回答
1

我认为这些 conf 文件必须以 .conf 结尾才能加载:即 localdoxygen.com.conf

于 2012-05-09T04:31:02.060 回答
1
  1. 禁用默认站点 - a2dissite default (!!!)
  2. DNS 正确
  3. 签入 /etc/apache2/sites-enabled 有你的网站
  4. 重新加载 apache2 /etc/init.d/apache2 重新加载
于 2012-05-09T05:58:35.200 回答
0

您需要NameVirtualHost在您的中定义一个apache2.conf以支持一个 IP 下的多个域。

NameVirtualHost 123.456.789.123:80

或者

NameVirtualHost *:80

另请参阅在单个 IP 地址上运行多个基于名称的网站

于 2012-04-30T09:49:14.610 回答