同一目录中的多个站点但不同的数据库 [英] Multiple sites in the same directory but separate database

查看:18
本文介绍了同一目录中的多个站点但不同的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我使用 HostGator 的基于 Linux 的共享主机帐户中,很快就会有十几个站点.我的帐户中有 CPanel 备份的文件数限制.

In my Linux based shared hosting account with HostGator, it is soon going to be dozen of sites. There is files count limitation for CPanel backups in my account.

为了减少文件总数,我需要大家的建议,以便我继续使用 Drupal-6 添加新的网站.

To reduce the total number of files I need suggestion from you all so that I continue to add new bunch of sites using Drupal-6.

我不想共享同一个数据库只是为了让我的维护简单.我知道 Drupal 允许在同一个数据库中有多个站点.但我想避免它.

I don't want to share the same database just to keep my maintenance simple. I know Drupal allows multiple sites in the same DB. But I want to avoid it.

我可以在旧站点中重复使用相同的 Drupal 文件并使用它们从我的新站点创建符号链接吗? root/sites 目录除外,因为它可能包含临时文件或使用/上传的文件特定于每个站点.

Can I reuse the same Drupal files in my old site and use them to create symbolic link from my new site? Except for root/sites directory because it may contain temporary files or files used/uploaded specific to each site.

因此,如果我的 Drupal 6 站点 site1.com 在那里,那么我可以通过在 site2.com 中创建指向 sat1.com 的符号链接(sites 除外)将其文件重用于我的新站点 site2.com目录:

So if my Drupal 6 site site1.com is there then I can reuse its files for my new site site2.com by creating symbolic links in site2.com pointing to sit1.com except for sites directory:

site2.com/includes->site1.com/includes

site2.com/includes->site1.com/includes

site2.com/modules->site1.com/modules

site2.com/modules-> site1.com/modules

site2.com/sites(未共享)

site2.com/sites ( not shared)

site2.com/misc -> site1.com/misc

site2.com/misc -> site1.com/misc

....

我已经浏览了相关主题:在 Drupal 中组合数据库 但我没有想按照里面的建议去做.

I've gone through related thread: Combining databases in Drupal but I don't want to go as per suggestions in it.

对这个想法有什么建议吗?

推荐答案

您需要的是 Drupal 的多站点功能.这旨在处理单独的数据库和上传的文件,但跨站点共享代码.基本上,您将每个虚拟主机的文档根目录指向同一个 Drupal 安装,然后 Drupal 负责加载正确的数据库.

What you want is Drupal's multisite feature. This is intended to work separate database and uploaded files but with shared code across the sites. Basically you point the document root for each virtualhost at the same Drupal installation and Drupal takes care of loading the correct database.

此处的详细信息:http://drupal.org/getting-started/6/安装/多站点

这篇关于同一目录中的多个站点但不同的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆