Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using the same php sofware for multiple domains inside the same apache webserver?

Basically, lets say i have a webserver and i resell hosting specifically for local churches.

i have 5 churches as clients, i have a simple CMS made for them they are equal copies of the same files, for each website i install the CMS , database and the website, i think it's a waste of resources.

i would like to know if i can do the following, afaik most webhosts have the following structure:

  • A main directory (home)
    • www.church1.com (church1)
    • www.church2.com (church2)
    • www.church3.com (church3)
    • www.church4.com (church4)
    • www.church5.com (church5)

basically i want the CMS to be on the Home directory, and each one of the Churches (clients) would only have a Config file, a Database ant the template regarding their websites.

so the system source code would be shared, but the website design and the database files would be completelly separated.

i'm not a webhosting or a development expert, but i know my way around, i'm sorry if the question is too basic, i'm having a hard time finding if this is possible.

EDIT: I Think Rudu's reference pretty much solved my problem!

like image 302
Johny Smith Avatar asked Feb 25 '26 16:02

Johny Smith


1 Answers

Since you are building it yourself, put the include files (application logic) in a folder or include path that is accessible to all the domains. Then you can put your template files, images and stylesheets in the individual domain folders. If you are database driven you can check the domain $_SERVER['HTTP_HOST'] and load results from a certain table or database based off of that. You really can go a lot of different directions here if you are building it yourself.

like image 67
Josh Avatar answered Feb 27 '26 04:02

Josh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!