Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache2 and vhosts
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
epsilon_da
n00b
n00b


Joined: 17 Jan 2006
Posts: 28

PostPosted: Fri Jan 20, 2006 2:14 am    Post subject: apache2 and vhosts Reply with quote

hi, by same rare reason i cant get vhosts to work, my configuration is already tested in a debian system and works (and is not hard to do).

i read on http://www.osmosislatina.com/apache/vhosting.htm this page which for use vhosts, apache needs the module proxy loaded. so i did

apache2ctl -l

and the module is not there, but i cant find the module as emerge mod_proxy and there is no use flag to set it.

somebody have mod_proxy loaded or make vhosts works?


my vhost template is like this

Code:

#This is needed for Frontpage support
Port 80
ServerRoot /etc/apache
ResourceConfig /dev/null
AccessConfig /dev/null


<VirtualHost *:80>
   ServerAdmin (|USERNAME|)@hangarweb.com.ar
   ServerName  www.(|HOSTNAME|).com.ar
   ServerAlias (|HOSTNAME|).com.ar *.(|HOSTNAME|).com.ar
   DocumentRoot /home/clients/(|USERNAME|)/www/
   ScriptAlias /cgi-bin/ /home/clients/(|USERNAME|)/cgi-bin/
   ErrorLog /home/clients/(|HOSTNAME|).error.log
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
   LogLevel warn
   CustomLog /var/log/apache2/(|HOSTNAME|).access.log combined
   ServerSignature On
   Alias /icons/ "/home/clients/(|USERNAME|)/icons/"
   Alias /doc/ "/home/clients/(|USERNAME|)/doc/"
   User (|USERNAME|)
   Group clients
   Setenv VLOG /home/clients/(|USERNAME|)/logs
   RewriteEngine On
   RewriteOptions inherit


#   <Directory />
#      Options FollowSymLinks
#      AllowOverride None
#   </Directory>

#   <Directory /home/clients/(|USERNAME|)/www>
#      Options Indexes FollowSymLinks MultiViews
#      AllowOverride None
#      Order allow,deny
#      allow from all
#   </Directory>

#   <Directory "/usr/lib/cgi-bin">
#      AllowOverride None
#      Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
#      Order allow,deny
#      Allow from all
#   </Directory>

#   <Directory "/usr/share/apache2/icons">
#       Options Indexes MultiViews
#       AllowOverride None
#       Order allow,deny
#       Allow from all
#   </Directory>

</VirtualHost>
Back to top
View user's profile Send private message
epsilon_da
n00b
n00b


Joined: 17 Jan 2006
Posts: 28

PostPosted: Fri Jan 20, 2006 2:34 am    Post subject: update Reply with quote

i look at httpd.conf and i found mod_proxy with other modules under the PROXY define, so i define it but nothing change.

mod_proxy is not the problem.

my apache version is 2.0.54
Back to top
View user's profile Send private message
epsilon_da
n00b
n00b


Joined: 17 Jan 2006
Posts: 28

PostPosted: Fri Jan 20, 2006 3:28 pm    Post subject: Reply with quote

**up**
Back to top
View user's profile Send private message
c4
Guru
Guru


Joined: 21 Feb 2004
Posts: 312
Location: Sweden

PostPosted: Fri Jan 20, 2006 3:53 pm    Post subject: Reply with quote

Are you sure about having your ServerRoot /etc/apache and also have you made sure that your vhost configuration file is infact loaded from httpd.conf ?

What errros are you seeing, anything useful in error.log ? Are you getting 403 errors when accessing your vhosts or what is happening?
_________________
AMD64 Gentoo Hardened server
AMD64 Xubuntu Desktop
X86 Dreamlinux Vaio laptop
Back to top
View user's profile Send private message
minskpower
Tux's lil' helper
Tux's lil' helper


Joined: 16 Jun 2005
Posts: 94
Location: /dev/null

PostPosted: Fri Jan 20, 2006 4:39 pm    Post subject: Reply with quote

I don't think it's related to mod_proxy.

Here is my vhosts.conf, see if it helps:

Code:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName yourdomain.com
ProxyPass /mvnforum/    http://dexter:8080/mvnforum/
ProxyPassReverse /mvnforum/     http://dexter:8080/mvnforum/
<Directory /var/www/dexter/htdocs/phpmyadmin>
    Order Deny,Allow
    Deny from All
    Allow from 10.1.1.2
</Directory>

<Directory /var/www/dexter/htdocs/cacti>
    Order Deny,Allow
    Deny from All
    Allow from 10.1.1.2
</Directory>

</VirtualHost>

<VirtualHost *:80>
ServerName ruby.yourdomain.com
DocumentRoot /home/ruby/projects/public/
ErrorLog /home/ruby/projects/log/apache.log
<Directory /home/ruby/projects/public>
    Options ExecCGI FollowSymLinks
    AddHandler cgi-script .cgi
    AllowOverride all
    Order Deny,Allow
    Deny from All
    Allow from 10.1.1.2
</Directory>
</VirtualHost>


Ignore the proxyPass directives, they are not relevant to the issue.
Back to top
View user's profile Send private message
epsilon_da
n00b
n00b


Joined: 17 Jan 2006
Posts: 28

PostPosted: Fri Jan 20, 2006 4:59 pm    Post subject: *** update *** Reply with quote

NO ERROR LOGS

Deleted the stupid lines founded in /usr/portage/net-www/apache/files/conf/Vhosts.conf
Code:

#This is needed for Frontpage support
Port 80
ServerRoot /etc/apache
ResourceConfig /dev/null
AccessConfig /dev/null




i try deactivating DEFAULT_VHOST and the next vhost entry was picked up as default, as supose to be, but the others are not.

NOW THE MOST IMPORTANT
i do:

cat 666_SOME_VHOST.conf >> 00_DEFAULT_VHOST.conf

restarted apache2 and works.
aparently when apache founds a .conf file with a vhost entry, it stops looking more files

how can i fix it to have multiple files?

any ideas?
Back to top
View user's profile Send private message
c4
Guru
Guru


Joined: 21 Feb 2004
Posts: 312
Location: Sweden

PostPosted: Fri Jan 20, 2006 5:21 pm    Post subject: Reply with quote

Here's how I used to have my setup with apache and vhosts:
near the end of my /etc/apache2/httpd.conf
(changed real domainname to foobar.com)
Code:
NameVirtualHost *:80

<VirtualHost *:80>
ServerName foobar.com
ServerAlias foobar.com *.foobar.com
    DocumentRoot "/www/foobar.com"
    <Directory "/www/foobar.com">
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

#
# Gentoo VHosts
#
# For Gentoo we include External Virtual Hosts Files.
#
Include conf/vhosts.d/vhosts.conf


Now if you have multiple vhost files, try including them with "Include conf/vhosts.d/*.conf" or simular. Notice that "conf/vhosts.d/" is in fact the directory "/etc/apache2/vhosts.d/" though this will depend or your setup.

my vhosts.conf, again masked to cover actual domainnames:
Code:
#################################################

<VirtualHost *:80>
ServerName dummyhost.com
ServerAlias dummehost.com
DocumentRoot /home/user/www
   <Directory "/home/user/www">
     allow from all
    </Directory>
</VirtualHost>

#################################################

<VirtualHost *:80>
ServerName anothervhost.ca
ServerAlias anothervhost.ca
DocumentRoot /www/anothervhost.ca
   <Directory "/www/anothervhost.ca">
     allow from all
   </Directory>
</VirtualHost>

#################################################



Try something simular, as you see it's pretty easy. My guess is that you have an error with the included files or are perhaps not declairing them properly.


As a side note, I am not running apache with -D DEFAULT_VHOST in etc/conf.d/apache2 as I do not have my main www-root at /var/www/localhost/htdocs.
_________________
AMD64 Gentoo Hardened server
AMD64 Xubuntu Desktop
X86 Dreamlinux Vaio laptop
Back to top
View user's profile Send private message
epsilon_da
n00b
n00b


Joined: 17 Jan 2006
Posts: 28

PostPosted: Fri Jan 20, 2006 5:30 pm    Post subject: Reply with quote

Quote:
Try something simular, as you see it's pretty easy. My guess is that you have an error with the included files or are perhaps not declairing them properly.


i am so stupid.
My script to generate new vhosts was buggy. before configure and setup everything correctly, the file placed on vhosts.d was called 99_domain.com and not 99_domain.com.conf
so, without the .conf, nobody see it.



thanks. fixed
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