View previous topic :: View next topic |
Author |
Message |
epsilon_da n00b
Joined: 17 Jan 2006 Posts: 28
|
Posted: Fri Jan 20, 2006 2:14 am Post subject: apache2 and vhosts |
|
|
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 |
|
|
epsilon_da n00b
Joined: 17 Jan 2006 Posts: 28
|
Posted: Fri Jan 20, 2006 2:34 am Post subject: update |
|
|
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 |
|
|
epsilon_da n00b
Joined: 17 Jan 2006 Posts: 28
|
Posted: Fri Jan 20, 2006 3:28 pm Post subject: |
|
|
**up** |
|
Back to top |
|
|
c4 Guru
Joined: 21 Feb 2004 Posts: 312 Location: Sweden
|
Posted: Fri Jan 20, 2006 3:53 pm Post subject: |
|
|
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 |
|
|
minskpower Tux's lil' helper
Joined: 16 Jun 2005 Posts: 94 Location: /dev/null
|
Posted: Fri Jan 20, 2006 4:39 pm Post subject: |
|
|
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 |
|
|
epsilon_da n00b
Joined: 17 Jan 2006 Posts: 28
|
Posted: Fri Jan 20, 2006 4:59 pm Post subject: *** update *** |
|
|
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 |
|
|
c4 Guru
Joined: 21 Feb 2004 Posts: 312 Location: Sweden
|
Posted: Fri Jan 20, 2006 5:21 pm Post subject: |
|
|
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 |
|
|
epsilon_da n00b
Joined: 17 Jan 2006 Posts: 28
|
Posted: Fri Jan 20, 2006 5:30 pm Post subject: |
|
|
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 |
|
|
|