FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 07-04-2008, 08:05 AM
Dietrich Bollmann
 
Default apache virtual host configuration...

Hi,

The syntax for virtual hosts configuration seems to have changed...

Until now I used the following syntax:
(taken from the configuration files in /etc/apache2/sites-enabled/)

<VirtualHost *:80>
...
</VirtualHost>

<VirtualHost *>
ServerName foo.bar
...
</VirtualHost>

...which seems to not work anymore.

I could make the virtual host foo.bar work again by
changing the second configuration to

<VirtualHost foo.bar>
ServerName foo.bar
...
</VirtualHost>

but now even http://localhost/ is directed to the default
page of the virtual host foo.bar...

How do I have to change the apache configuration files
to make things work again?

Thanks, Dietrich



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-04-2008, 11:25 AM
oneman
 
Default apache virtual host configuration...

On 4-jul-2008, at 10:05, Dietrich Bollmann wrote:


Hi,

The syntax for virtual hosts configuration seems to have changed...

Until now I used the following syntax:
(taken from the configuration files in /etc/apache2/sites-enabled/)

<VirtualHost *:80>
...
</VirtualHost>

<VirtualHost *>
ServerName foo.bar
...
</VirtualHost>

...which seems to not work anymore.

I could make the virtual host foo.bar work again by
changing the second configuration to

<VirtualHost foo.bar>
ServerName foo.bar
...
</VirtualHost>

but now even http://localhost/ is directed to the default
page of the virtual host foo.bar...

How do I have to change the apache configuration files
to make things work again?





It's a little unclear what you're trying to accomplish, but I think
you simply want one site for http://foo.bar and have any other
request go to a default page. In that case you create two files in /
etc/apache2/sites-available, one for the general site and one for the
other. Both use the syntax:


<Virtualhost *:80>
Servername
...
</Virualhost>

So both user '*:80' and both have a servername, since that won't be
used to control the order in wich apache uses them to process
requests. Then you use the command a2ensite (man a2ensite) to enable
you sites, making sure they're in the right order, i.e. the default
site first, the other last. The easiest way to do that is to use
number prefixes in their names. That way, if the url is not known,
apache will simply use the first file it finds in de sites dir and
all your request that don't contain 'foo.bar' go to the default site.



HTH


Peter


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 10:14 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org