Hi All, I have about 50 domains http://domain1.com http://domain2.com http://domain3.com http://domain4.com ... etc how I may to set "mail" subdomain for all domains? something about ... ServerName mail.* DocumentRoot /path/to/dir/squirrelmail) ... this work as wildcard all subdomains (test, rbr,rrrr, ... etc)opens squirrelmail but I need only "mail" open squirrelmail http://mail.domain1.com http://mail.domain2.com http://mail.domain3.com http://mail.domain4.com Thanks
You can create such vhosts in the main Apache configuration (right before Vhosts_ispconfig.conf gets included).
Hello Falko. But how to use name based vhosts before of "NameVirtualHost <IP>:80", which is included in Vhosts_ispconfig.conf? [1] I tried to include some RewriteCond/RewriteRule into the first ("catch-all") VirtualHost of Vhosts_ispconfig.conf, but this configuration got removed (as expected...) What i want to do: Redirect webmail.* and mailuser.* (for all domains without the need to configure every single domain) to two different locations. The rewrite part is: RewriteEngine On RewriteCond %{HTTP_HOST} ^webmail\.(.*) [NC] RewriteRule .* https://<IP>:81/squirrelmail/src/login.php [L,R] RewriteCond %{HTTP_HOST} ^mailuser\.(.*) [NC] RewriteRule .* https://<IP>:81/mailuser/login/index.php [L,R] How can i include this rewrites? [1] "The NameVirtualHost directive is a required directive if you want to configure name-based virtual hosts." http://httpd.apache.org/docs/2.2/en/mod/core.html#namevirtualhost
Solved: I wrote my configuration into /root/ispconfig/scripts/lib/config.lib.php Within funktion "make_vhost" you can find the default vhost. (You can search for "ServerAdmin root@localhost". This is the first vhost of Vhosts_ispconfig.conf.) I have included my configuration there and added a new Co-Domain to regenerate apache configuration. It's working ;-).