Page 1 of 1

How to configure Apache for domain multitenancy

PostPosted: 25. February 2012 02:53
by rbravoz
I have a web app running on a dedicated Xamp Linux server. This app provides a "private" community portal for each customer account that registers. works in multitenant mode, meaning that there is one instance of the software and there is one database (MySQL) running. My app is developed in PHP. Currently every customer can to login to its account (and portal) using: www.abcd.com/Login.php?account=customerxyz. They can also login using a subdomain: customerxyz.abcd.com.

However, I want to offer my customers the feature "use your own domain" (also called custom domain) where my customer's can point their domain (www.customerxyz.com) to our domain (www.abcd.com). So when they type their domain (www.customerxyz.com) actually they get the page as when using the subdomain option (customerxyz.abcd.com), and that all the app pages come out from their custom domain. Our app is built with relative page references, so it is ready for "custom domains".

I need some advice as to how to setup my Apache server (or a PHP script) to be able to accept these custom domains. I googled but I got only references to how to setup multidomain hosting (virtual hosting of different domains) which is a different matter. Also I am looking for an answer that can minimize or eliminate having to do manual configuration for each and every new custom domain, as I have many customers signing-up every month. So a configurationsolution that can tackle all posible new custom domains would be excellent.

Any help is appreciated.

Re: How to configure Apache for domain multitenancy

PostPosted: 25. February 2012 08:02
by JonB
Maybe you should get a provisioning system.

hopefully you aren't trying to bend a development system to this task.

Good Luck
8)

Re: How to configure Apache for domain multitenancy

PostPosted: 25. February 2012 08:34
by rbravoz
JonB, what do you mean by "get a provisioning system"?

Re: How to configure Apache for domain multitenancy

PostPosted: 25. February 2012 17:19
by JonB
what do you mean by "get a provisioning system"?


http://en.wikipedia.org/wiki/Provisioning

In this context it means a Control Panel system of some sort that can also provision new servers or virtual servers and new users through templating. There are already tools for these things, including Open Source ones. The fact is that 'home-brew' systems that attempt to do these things are inhernetly insecure and troublesome, as there is no way of really testing them adequately -- it is impossible for you to predict the application or security scenrios. You will invariably discover what is wrong with 'the system' through train wrecks. Unfortunately the trainwrecks occur "on your watch". I just got through dealing with a situatuion like this professionally, and the work I did took a week, rather than a day (it did not involve XAMPP or Linux - it was a Windows-based Hosting operation).

You can't really run webhosting, portal or ISP services on LAMPP sucessfully for more reasons than I can enumerate (or have the interest in doing so). Read some of the inquiries here about adding or changing components, and you should get the drift. As XAMPP is Open Source software, so no one can actively prevent you from using it improperly. The project leaders have repeatedly advised everyone "XAMPP is not appropriate for production environments".

These are "my opinions" only, not those of the XAMPP project, however they are based on 25+ years as a systems engineer on Unix, Linux, Windows and 'mainframe' based systems. I run a private ISP and hosting service, so I have a fair amount of insight on these things.

Good Luck

Re: How to configure Apache for domain multitenancy

PostPosted: 25. April 2012 21:36
by gloo
:)

Re: How to configure Apache for domain multitenancy

PostPosted: 27. April 2012 16:43
by JonB
Gee gloo, those are some pretty good directions,

... other than you won't have a /var/www folder under LAMPP, will you??

or - that Apache is controlled by a bash file in this case... :shock:

Please advice folks on subjects you actually might know something about, huh???

see ya.

8)