Hi all !
I need something that I can't do with the actual version of ispcp... (nightly 20070627)
Some of my customer's websites have several domain names for the same content. If I add domain aliases, I have the choice between take another document_root or make a redirection. The solution seems to be the second case, because another document_root is not appropriate for a unique website.
But in some case, we don't want a redirection ! We want keeping the url with the domain alias (we can have several reasons for that... web indexing, dynamic content based upon the domain...)
So what I want is the possibility to define a domain alias with a mount point like "/" and also to have several domain aliases with the same mount point !
In order to have this working, I make two little modifications by shortcutting the checks in the web admin :
Code:
file /var/www/ispcp/gui/include/input-checks.php line 409 :
if (($token) && (!chk_username($token, $num)))
file /var/www/ispcp/gui/reseller/add_alias.php line 203 :
// whe have alias with same mount point !!! ERROR
//$err_al = tr("There are alias with same mount point");
It seems to be good for me... but I still have a problem : I think that you must have a good reason to forbidden this configuration ! And I don't find any answer about it.
I only see one bug with this method : when I create a domain on an existing mount point, the document_root seems to be overridden by the default content, and if I delete one of the aliases, the document_root will be erased.
But if this is the only problem, I think that it is not very difficult to check if another alias use the same mount point, and in this case to not overridden/erase the document_root.
please keep in mind - if you set an 2 domains at the same mountpoint they're not aware of each other... So if you delete one ... the complete directory (for both) will be deleted.
07-05-2007 06:47 PM
raphael
Member
Posts: 474
Group: Dev Team
Joined: Apr 2007
Status:
Offline Reputation: 8
please keep in mind - if you set an 2 domains at the same mountpoint they're not aware of each other... So if you delete one ... the complete directory (for both) will be deleted.
Okay but I think we can solve this problem. When a domain is deleted, this is the good moment for doing some checks into the database : if another domain is found with the same mount point, then the directory is not deleted.
note : if this solution is okay, I'm ready to do the work and then send you a patch
Now I think I have to tweak the file /var/www/ispcp/engine/ispcp-dmb-mngr
Into the subfunction dmn_add_httpd_file_data :
- ask the database if another domain already share the same mount point
- in this case, bypass some mkdir to avoid overridden of the content
Into the subfunction dmn_del_httpd_file_data :
- ask the database if another domain also share the same mount point
- in this case, bypass the deletion of the directories
Tell me if I'm wrong
Thanks
07-06-2007 03:48 AM
raphael
Member
Posts: 474
Group: Dev Team
Joined: Apr 2007
Status:
Offline Reputation: 8
I see another point about the backup : with a same mount point, I think that the unique web content is backuped several time (one backup for each domain). But it should work... so maybe it's not a big problem.
Do you think we have to tweak the backup system to keep only one backup for the first domain and disabled the others ?
I don't see another problems... Each domains should have their own log files with their own statistics, and this is normal. No common stats are possible with this configuration.
I need you expertize to know if I forget something else...
07-06-2007 04:22 AM
raphael
Member
Posts: 474
Group: Dev Team
Joined: Apr 2007
Status:
Offline Reputation: 8
There should be no problem if what you are allowing is to add an alias or subdomain on a same mount point. Because the backups engine is ran only once per domain, it doesn't take care of whether subdomains or aliases exist or not.
Here is my patch ! (based upon the nightly build version 20070717)
Some modifications in the web part :
I remove the "same mountpoint" check in the reseller GUI
I remove the "same mountpoint" check in the client GUI
I allow the mountpoint to be only "/" (same as the main domain)
And some others in the engine part :
When adding a domain alias, I skip the creation of the web root files if the mount point is already in use
When removing a domain alias, I skip the deletion of the web root files if the mount point is shared and still in use
I think it's an usefull modification, and if I forgot nothing, it's not very difficult to integrate...
So I hope this enhancement can be include in the 1.0.0 version