Hello,
I am in the process of developing a PHP application/system. As per the client requirement this application should be supplied a logo, color scheme and few other information and it should output a website with those settings. He wants to create website everyday using this system. One of the main requirements of the client is that in future whenever there is a change (additions, appending, removal) of feature(s) in this system then it should reflect the changes in all the websites that have been created from this system.
Now, the first idea that hit my mind was to create websites and upload them on their respective ftp server. In future whenever there was a change in the parent Application/system, then we will manually transfer the files to every ftp server. This of course becomes a tedious job when the site number increases.
Today another architecture hit my mind and this one seems to be more logical in terms of meeting the client requirements, specially the updating part. I am thinking of developing one application and host it on a server. Now, whenever we want to create a site then we will create a website profile table in a the database with every setting necessary to run the application like name, logo, colors, database information etc. Now this way I will have only one application running with several website profiles existing in the database. Whenever a user wants to open a site http://www.abc.com then it will redirect it to my main application with user entered URL as POST and then using this value I will fetch the website profile information from the database, substitute the values in the application and show it to the user. So if another user types http://www.xyz.com then it will take it to the main application with xyz as the site name. I will then pull out the website profile from the database, fetch the values, substitute them in the main application and show it to the user.
So this way I will have to maintain only one application and the variations will actually take place using the various website profile info that exists in the database. Now, I have few queries with this:
1.) Do you think this will work?
2.) When the user is directed to the main application then the browser addess bar URL will change. Is there any way through which I can display the user entered URL in the browser so as to make the user feel that he/she is browsing (say) http://www.abc.com and not http://www.parentapplication.com?
3.) What do you think about its performance? Will the performance get affected? I mean the load time and query running times?
4.) What are the downsides of this approach? One of them which I can think right now is the overhead of fetching the database info on every page. But, I think I can solve this problem by using the session variables.
Please let the thoughts flow in. I really believe in this second approach and I would want honest suggests, advices and criticism for this approach.
Thanks.
Central Application System
Moderator: General Moderators
Re: Central Application System
Ideally all the code would be in one place. Obviously you can host numerous domains on the same server. I don't see any need to forward one domain to another. You can build one application, and in each public_html folder you can execute the application and supply the site id. The application files could be stored in a central place such as /usr/lib/appName/. I don't see any performance issues with that but you'd probably want to ensure that it's scalable. There are numerous things you can do to increase performance such as using memcache or just caching pages that hit the database server hard.