dongnong3799 2011-02-03 20:47
浏览 70
已采纳

在同一个apache web服务器中为多个域使用相同的php软件?

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!

  • 写回答

2条回答 默认 最新

  • drba1172 2011-02-03 22:46
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 有没有可以帮我搞一个微信建群链接,包括群名称和群资料群头像那种,不会让你白忙
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题