Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 3rd January 2009, 01:34
enigmatic enigmatic is offline
Junior Member
 
Join Date: Feb 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default subdomain for all domains in Vhosts

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
Reply With Quote
Sponsored Links
  #2  
Old 3rd January 2009, 17:09
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

You can create such vhosts in the main Apache configuration (right before Vhosts_ispconfig.conf gets included).
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 20th January 2009, 13:21
sein sein is offline
Junior Member
 
Join Date: Jan 2009
Location: Germany
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Falko.

Quote:
Originally Posted by falko View Post
You can create such vhosts in the main Apache configuration (right before Vhosts_ispconfig.conf gets included).
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/...amevirtualhost
Reply With Quote
  #4  
Old 20th January 2009, 16:32
sein sein is offline
Junior Member
 
Join Date: Jan 2009
Location: Germany
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by sein View Post
I tried to include some RewriteCond/RewriteRule into the first ("catch-all") VirtualHost of Vhosts_ispconfig.conf, but this configuration got removed (as expected...)
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 ;-).
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange email problem for one of my domains... any help appreciated paulrobert_a Installation/Configuration 5 9th August 2010 15:15
Web Hosting Only For Individual Domains bails Installation/Configuration 2 19th August 2008 17:35
Domains limit not enforced for resellers? mrvanes General 3 3rd January 2008 12:07
different counting of domains torusturtle Feature Requests 7 9th May 2007 23:18
Is there a Script to add Multiple Domains (websites) to ISPCONFIG??? bpmee Programming/Scripts 2 23rd February 2007 02:33


All times are GMT +2. The time now is 11:33.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.