Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache2, vhosts, only default_host works [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Tue Apr 25, 2006 9:45 pm    Post subject: Apache2, vhosts, only default_host works [solved] Reply with quote

Hi, this is yet another question about vhosts. I tried to find a solution here but I can't find one.
So I'm posting the problem here and hopefully someone knows whats going on.

The problem is dat I always see the defaulthost what I should see the page of another domain.
Even when I move /etc/apache2/vhosts.d/00_default_vhost.conf I still get the default_host page.
So, it seems that somewhere else the documentroot for the default_host is configured and the
vhosts configfile is ignored. I have configured vhosts before on other servers and I just can't
figure out what's going on... :?

Here's /etc/conf.d/apache2
Code:

APACHE2_OPTS="-D SSL -D SSL_DEFAULT_VHOST -D DEFAULT_VHOST -D PHP5 -D MAILMAN"

Here's 00_default_vhost.conf :
Code:

NameVirtualHost *:80

<IfDefine DEFAULT_VHOST>
   <VirtualHost *:80>
           DocumentRoot "/var/www/localhost/htdocs"
          <Directory "/var/www/localhost/htdocs">
                 Options Indexes FollowSymLinks
                 AllowOverride None
                 Order allow,deny
                 Allow from all
          </Directory>
          <IfModule peruser.c>
                 # this must match a Processor
                 ServerEnvironment apache apache
       
                 # these are optional - defaults to the values specified in httpd.conf
                 MinSpareProcessors 4
                 MaxProcessors 20
          </IfModule>
              ServerAdmin foo@bar.nl
              ServerName bar.nl
              ServerAlias www.bar.nl
              ErrorLog /var/log/apache2/bla.nl-error_log
              CustomLog /var/log/apache2/bla.nl-access_log common
   </VirtualHost>
</IfDefine>

<VirtualHost *:80>
       DocumentRoot "/var/www/doamin2.org/htdocs"
       <Directory "/var/www/domain2.org/htdocs">
              Options Indexes FollowSymLinks
              AllowOverride None
              Order allow,deny
              Allow from all
       </Directory>
       <IfModule peruser.c>
             ServerEnvironment apache apache
             MinSpareProcessors 4
            MaxProcessors 20
       </IfModule>
       ServerAdmin info@domain2.org.org
       ServerName test.domain2.org.org
       ErrorLog /var/log/apache2/domain2-error_log
       CustomLog /var/log/apache2/domain2-access_log common
</VirtualHost>


<VirtualHost *:80>
       DocumentRoot "/var/www/domain3.nl/htdocs"
       <Directory "/var/www/domain3.nll/htdocs">
              Options Indexes FollowSymLinks
              AllowOverride None
              Order allow,deny
              Allow from all
       </Directory>
       <IfModule peruser.c>
             ServerEnvironment apache apache
             MinSpareProcessors 4
             MaxProcessors 20
       </IfModule>
       ServerAdmin webmaster@domain3.nl
       ServerName domain3.nl
       ServerAlias www.domain3.nl
       ErrorLog /var/log/apache2/domain3-error_log
       CustomLog /var/log/apache2/domain3-access_log common
</VirtualHost>

Any help would be very welcome. I'm getting desperate :)

Thanks anyway ;)
_________________
If there is one thing to learn from history, it's that we usualy don't learn anything from it, at all.


Last edited by mariourk on Thu Apr 27, 2006 3:19 pm; edited 1 time in total
Back to top
View user's profile Send private message
sheldonh
n00b
n00b


Joined: 14 Sep 2004
Posts: 59

PostPosted: Tue Apr 25, 2006 11:50 pm    Post subject: Reply with quote

Make sure you have a line like this, uncommented in /etc/apache2/httpd.conf:

Include /etc/apache2/vhosts.d/*.conf
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Wed Apr 26, 2006 11:44 am    Post subject: Reply with quote

That line is uncommented. So, that's not it :?
_________________
If there is one thing to learn from history, it's that we usualy don't learn anything from it, at all.
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Thu Apr 27, 2006 3:18 pm    Post subject: Reply with quote

It turned out to be a combined problem with dns and borked proxy (that showed old pages...)
I also switched to seperate configs per vhost.

Glad its working now :)
_________________
If there is one thing to learn from history, it's that we usualy don't learn anything from it, at all.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum