Two hostnames in the same webserver

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Two hostnames in the same webserver

Postby hidden » 18. July 2007 10:00

I have several websites in the root of my linux server (mantis, dotproject, etc), and I access them from a Windows XP machine typing "http://myserver/mantis", "http://myserver/dotproject", etc.

Also I have a project made with Symfony that I would like to access with a different name, for example "http://mysymfonyproject", but it doesn't work (it says the server was not found).

Here's my apache2.conf configuration:

Code: Select all
NameVirtualHost *:80

#original apache location
<VirtualHost *:80>
  ServerName myserver
  DocumentRoot "/var/www"

<VirtualHost *:80>
  ServerName mysymfonyproject
  DocumentRoot "/var/www/mysymfonyproject/web"
  DirectoryIndex index.php
  Alias /sf /usr/share/php/data/symfony/web/sf

  <Directory "/usr/share/php/data/symfony/web/sf">
   AllowOverride All
   Allow from All

  <Directory "/var/www/mysymfonyproject/web">
   AllowOverride All
   Allow from All

But then I type this in my Windows XP machine:

Code: Select all

And it doesn't find the server.

But if I modify the HOSTS file in my Windows XP machine adding this:

Code: Select all myserver mysymfonyproject

Then it works, BUT... both are pointing to the same IP, so the server doesn't know which virtual server it has to serve... therefore the result is always "http://myserver", even if I type "http://mysymfonyproject".

Here's an alternative:

- Delete the added lines in the HOSTS file.
- Open cmd.exe and type "nbtstat -a" (the server's IP)

Then, "http://myserver" works perfectly, but "http://mysymfonyproject" is not.

Inside the server all works perfectly, so it seems to be a problem serving inbound petitions from the network.

What am I doing wrong?
Posts: 1
Joined: 18. July 2007 09:52

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 9 guests