Post Reply  Post Thread 
Pages (2): « First [1] 2 Next > Last »
Domain aliases with same mount point
Author Message
greg
Junior Member
*


Posts: 27
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 1
Post: #1
Domain aliases with same mount point

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.

Thanks.

07-05-2007 02:10 PM
Find all posts by this user Quote this message in a reply
ephigenie
Administrator
*******
Administrators

Posts: 658
Group: Administrators
Joined: Oct 2006
Status: Offline
Reputation: 12
Post: #2
RE: Domain aliases with same mount point

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
Visit this user's website Find all posts by this user Quote this message in a reply
raphael
Member
****
Dev Team

Posts: 474
Group: Dev Team
Joined: Apr 2007
Status: Offline
Reputation: 8
Post: #3
RE: Domain aliases with same mount point

The engine is the one that needs to be tweaked


YaHost Me | Text Link Ads | my Debian repository | Donate! | No OOXML! | Project HoneyPot | ... and more

Quote:
This is Linux land. In silent nights you can hear the Windows machines rebooting.

If you want to be helped, don't PM me but post in the forums | If you want private support PM me and we'll discuss the price

07-06-2007 02:11 AM
Visit this user's website Find all posts by this user Quote this message in a reply
greg
Junior Member
*


Posts: 27
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 1
Post: #4
RE: Domain aliases with same mount point

ephigenie Wrote:
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

07-06-2007 03:18 AM
Find all posts by this user Quote this message in a reply
greg
Junior Member
*


Posts: 27
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 1
Post: #5
RE: Domain aliases with same mount point

raphael Wrote:
The engine is the one that needs to be tweaked


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
Find all posts by this user Quote this message in a reply
raphael
Member
****
Dev Team

Posts: 474
Group: Dev Team
Joined: Apr 2007
Status: Offline
Reputation: 8
Post: #6
RE: Domain aliases with same mount point

I think it's all right Wink


YaHost Me | Text Link Ads | my Debian repository | Donate! | No OOXML! | Project HoneyPot | ... and more

Quote:
This is Linux land. In silent nights you can hear the Windows machines rebooting.

If you want to be helped, don't PM me but post in the forums | If you want private support PM me and we'll discuss the price

07-06-2007 04:05 AM
Visit this user's website Find all posts by this user Quote this message in a reply
greg
Junior Member
*


Posts: 27
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 1
Post: #7
Smile  RE: Domain aliases with same mount point

raphael Wrote:
I think it's all right Wink


Good Smile

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
Find all posts by this user Quote this message in a reply
raphael
Member
****
Dev Team

Posts: 474
Group: Dev Team
Joined: Apr 2007
Status: Offline
Reputation: 8
Post: #8
RE: Domain aliases with same mount point

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.


YaHost Me | Text Link Ads | my Debian repository | Donate! | No OOXML! | Project HoneyPot | ... and more

Quote:
This is Linux land. In silent nights you can hear the Windows machines rebooting.

If you want to be helped, don't PM me but post in the forums | If you want private support PM me and we'll discuss the price

07-06-2007 08:06 AM
Visit this user's website Find all posts by this user Quote this message in a reply
greg
Junior Member
*


Posts: 27
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 1
Post: #9
RE: Domain aliases with same mount point

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 Smile

PS: the ticket is here http://www.isp-control.net/ispcp/ticket/483



Attached File(s)
.txt File  domain-aliases-with-same-mount-point.diff.txt (Size: 3.11 KB / Downloads: 42)

This post was last modified: 07-17-2007 05:27 PM by greg.

07-17-2007 05:17 PM
Find all posts by this user Quote this message in a reply
Zothos
Member
****
Dev Team

Posts: 647
Group: Dev Team
Joined: Feb 2007
Status: Offline
Reputation: 7
Post: #10
RE: Domain aliases with same mount point

nice greg, thanks for contributing your stuff Wink


Real programmers don't comment their code - it was hard to write, it should be hard to understand

OS : Gentoo 32bit Stage1
ispCP Version : RC4
Mods : Dovecot | Pure-ftpd

No Support via PM - Payed Support via request
07-17-2007 06:23 PM
Find all posts by this user Quote this message in a reply
Pages (2): « First [1] 2 Next > Last »
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump:

| All rights reserved : isp-control.net |