View Full Version : catch all for apache?
lerra
24th February 2006, 23:08
Is that posseble? I cant get it working to catch all mail.* domains to point that to a webmail page.
<VirtualHost ip:80>
Servername mail.domain.com
ServerAlias mail.*
ServerAdmin me@domain.com
DocumentRoot /var/www/webmail/
</VirtualHost>
Any tip?
till
25th February 2006, 11:38
I'am not sure, but as far as i remember you can do wildcards like *.domain.com but not host.*
lerra
1st March 2006, 01:14
So with other words, there is no sollution? What about site/webmail etc? that woud be nice too..
falko
1st March 2006, 11:05
So with other words, there is no sollution?
No.
What about site/webmail etc? that woud be nice too..Can you explain a bit more?
st2xo
2nd March 2006, 12:10
I set up that webmail-host configuration at my site and it works well.
/etc/apache2/vhosts/Vhosts_ispconfig.conf
NameVirtualHost 213.133.100.91:80
<VirtualHost 213.133.100.91:80>
# edit this vHost template in /root/ispconfig/scripts/lib/config.lib.php
# otherwise it will be overwritte on every host change in ISPConfig!
ServerName localhost
ServerAdmin root@localhost
# This will be the default root for domains connected on this server
# but with no ISPConfig setup
# put in there a index.html like "this domain is connected - no homepage available"
DocumentRoot /home/HOSTNAME/public_n05
</VirtualHost>
this is the first virtual host setting in Vhosts_ispconfig.conf and will be overwritten every time you change host settings with ISPConfig - so you have to patch the config.lib.php near line 1231 - search for the textphrase "NameVirtualHost schreiben"
now adding the subdomain webmail.* for every host on the system:
/etc/apache2/vhosts.d/HOSTNAME.conf
<VirtualHost 192.168.0.1:80>
ServerName webmail.HOSTNAME.de
ServerAlias webmail.*
ServerAdmin root@localhost
DocumentRoot /home/USER/public_webmail
CustomLog /var/log/apache2/webmail.HOSTNAME.de.log combined
</VirtualHost>
I dont know what happens, if you add a subdomain "webmail" directly in the ISPConfig Hostsetting. Look in httpd.conf which *conf-directory will be read by apache at first. I think the first *.conf wins the match ...
other virtual hosts in vhosts.d will work with the same procedure, e.g.
ServerAlias config.*
ServerAlias phpmyadmin.*
the index.html´s in that public_html - directorys redirects the users to the correct sites
https://HOSTNAME.de:81/phpmyadmin/
https://HOSTNAME.de:81/login.php
and so the users only have to know the easy to type hostname like webmail.MySite.de or phpmyadmin.MySite.com and what ever you like.
hope that helps ....
st2xo
2nd March 2006, 12:29
I forget something
you have to edit the /etc/apache/httpd.conf
insert
<directory ~ "/public_webmail|public_phpmyadmin|public_config/">
AllowOverride None
Order allow,deny
Allow from all
</directory>
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.