使用来自不同域的子目录创建 Drupal 多站点 [英] Creating Drupal Multisite with Subdirectory from different Domain

查看:21
本文介绍了使用来自不同域的子目录创建 Drupal 多站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建 Drupal Multisite.目前假设我们在表单中具有以下实时站点

I'm attempting to create Drupal Multisite. Currently lets say we have below Live Sites in the form

abc.example.com
def.example.com
xyz.example.com

所有站点都存在于目录中的同一服务器(Nginx 服务器)上

All the Sites are present on the Same server (Nginx Server) in the directories

/var/www/vhosts/abc.example.com/httpdocs
/var/www/vhosts/def.example.com/httpdocs
/var/www/vhosts/xyz.example.com/httpdocs

现在我们必须为每个 Live Site 创建博客,我们正在研究相同的 Drupal Mutlisite 架构,因此所有站点都应该指向相同的代码库,这将简化我们的维护任务.

Now we have to create Blogs for each Live Site, we are looking into Drupal Mutlisite Architecture for the same, so all Sites should point to same codebase, which would ease our maintenance tasks.

我们目前已经为安装在 blogs.example.com 的主/默认域站点目录创建了符号链接,因此符号链接被创建为

We have currently created symlinks for to main/default domain Site directory which is installed at blogs.example.com so symlink is created as

ln -s/var/www/vhosts/blogs.example.com/httpdocs//var/www/vhosts/xyz.example.com/httpdocs/blog

ln -s /var/www/vhosts/blogs.example.com/httpdocs/ /var/www/vhosts/xyz.example.com/httpdocs/blog

并在 sites 下创建了一个文件夹作为 sites/xyz.example.com.blog

And created a folder under sites as sites/xyz.example.com.blog

但是当我们在浏览器中打开 URL 时,我们得到未指定输入文件"

But when we open the URL in browser we get "No input file Specified"

我们不确定上述错误是否是由于 .htaccess 中的某些问题造成的,我们也很困惑在哪里添加与 MutliSite 相关的 htacess 配置.

We are not sure if the above error is due to some issue in .htaccess, also we are consfused where to add htacess configuration related to MutliSite.

任何帮助将不胜感激.

推荐答案

如前所述这里 您的符号链接应位于 /var/www/vhosts/blogs.example.com/httpdocs 作为安装目录以及创建的 sites 文件夹.还尝试删除符号链接上 httpdocs/ 上的结尾斜杠:

As explained here your symbolic link shall be under /var/www/vhosts/blogs.example.com/httpdocs as the installed directory as well as the created sites folder. Try also to remove the end slash on httpdocs/ on your symbolic link:

ln -s /var/www/vhosts/blogs.example.com/httpdocs/ /var/www/vhosts/xyz.example.com/httpdocs/blog

只到 httpdocs,像这样:

ln -s /var/www/vhosts/blogs.example.com/httpdocs blog

或在 2 行命令中执行:

or do it in 2 lines command:

cd /var/www/vhosts/blogs.example.com/httpdocs
ln -s . blog

还要确保 xyz.example.comblogs.example.comCNAME 相同并且 >xyz.example.com 在您的虚拟主机上设置为 ServerAliasblogs.example.com.因此,当您将浏览器指向 http://xyz.example.com/blog 时,您应该会得到您的网站.

Make sure also that CNAME of both xyz.example.com and blogs.example.com are the same and that the xyz.example.com is set as ServerAlias to blogs.example.com on your vhost. So you should get your site when point your browser to http://xyz.example.com/blog.

当您以管理员身份登录新站点后,检查或将 公共文件系统路径 的正确路径放在以下管理菜单下的 sites/xyz.example.com.博客/文件:

Once you have login to your new site as the admin, check or put the correct path for Public file system path under the following admin menu to sites/xyz.example.com.blog/files:

Home » Administration » Configuration » Media » File System

这篇关于使用来自不同域的子目录创建 Drupal 多站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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