View Single Post
  #1  
Old 15th May 2010, 02:20
apoana apoana is offline
Junior Member
 
Join Date: Feb 2010
Posts: 3
Thanks: 0
Thanked 5 Times in 2 Posts
Default automatic temporary URL for new sites

This is not heavly tested, but, it's an hack to have an temporary URL for a new site/domain.

Please, ready this:

1) Tested on multi domain setup
2) server hosting sites have the name - in this example: isp01-ww1.myhost.com
3) You need to alter the DNS provider for myhost.com
4) Don't blame me for problens
5) All temporary site URL will become yoursite.vsite.isp01-ww1.myhost.com in this example

Let's go:

1) add in you master site (or hosting site) DNS an entry like this:

Code:
*.vsite.isp01-ww1.myhost      Alias (CNAME)     Default       isp01-ww1.myhost.
or

Code:
*.vsite.isp01-ww1.myhost      A     Default       1.2.3.4
2) edit "/usr/local/ispconfig/server/plugins-available/apache2_plugin.inc.php" - in the server where the apache server hosting is running

3) Find in the above script:

PHP Code:
// begin a new ServerAlias line after 30 alias domains
foreach($server_alias as $tmp_alias) {
   if(
$n 30 == 0$server_alias_str .= "\n    ServerAlias ";
   
$server_alias_str .= $tmp_alias;


4) Change to:

PHP Code:
foreach($server_alias as $tmp_alias) {
    if(
$n 30 == 0$server_alias_str .= "\n    ServerAlias ";
    
$daliases explode(" "trim($tmp_alias));
    foreach(
$daliases as $dalias) {
        if (
trim($dalias) != "") {
            
$server_alias_str .=  trim($dalias) . " " trim($dalias) . ".vsite." trim($conf['serverconfig']['server']['hostname']) . " ";
       }
    }

5) Save the file

6) Now, every time you add an new site or alias site, ISPCONFIG generate an apache configuration like:

ServerAlias www.newdomain.com www.newdomain.com.vsite.isp01-ww1.myhost.com

and this allow your client to access an new domain/site in ISPCONFIG without need to change the DNS pointing for the new site/domain. This is done using URL www.newdomain.com.vsite.isp01-ww1.myhost.com, as in case of this example.


TODO;

1) Display in cleint area where to access new site using the temporary URL
Reply With Quote
Sponsored Links