Apache virtual directories not quite working for base FQDN

Jordon Bedwell jordon at envygeeks.com
Fri Oct 8 14:42:38 UTC 2010

On Fri, 2010-10-08 at 16:35 +0200, Dotan Cohen wrote:
> On an Ubuntu 9.10 install I have a virtual host that works fine if
> there is a GET argument or path after the FQDN / IP address, but not
> if the FQDN / IP address is entered by itself. If there is an argument
> or path, then Apache correctly  fetches the pages from the the right
> place. If the FQDN / IP address appears by itself, then Apache fetches
> the default "It works!" page. See here:
> See these examples:
> http://uk.sharingcenter.de/?d
> http://uk.sharingcenter.de/
> The relevant config file:
> $ cat /etc/apache2/sites-available/default
> NameVirtualHost *:80
> <VirtualHost *:80>
>     ServerName *
>     DocumentRoot /var/www/default_public_html
> </VirtualHost>
> <VirtualHost *:80>
>     ServerName uk.sharingcenter.de
>     DocumentRoot /var/www/uk-sharsharingcenter-de/public_html
> </VirtualHost>
> The file /var/www/default_public_html/index.html has the text "Hello, world!".
> The file /var/www/uk-sharsharingcenter-de/index.html has the text "uk".
> Any ideas why Apache is giving the "It works!" [age when there is no
> argument / path? Thanks.
> Karl, please don't answer. Thanks.

I'm confused about what you're trying to do.  When I visit the FQDN's I
get UK, for both with or without query and path info. When I visit the
IP's I get "Hello World", but I get confused at where the problem is.

Are you trying to say that visiting http://uk.sharingcenter.de/?d
results in a different view (by assumption content being "hello world")
and http://uk.sharingcenter.de/ results in content simply being "UK"? Or
even vice verse.

More information about the ubuntu-users mailing list