简体   繁体   English

Plesk WordPress 使用非 www 域进行多站点安装

[英]Plesk WordPress Multisite Install with Non-www Domains

I'm trying to do something that's pretty straight-forward in cPanel, but I wish to use Plesk instead.我正在尝试在 cPanel 中做一些非常简单的事情,但我希望改用 Plesk。 I'd like to create a WordPress multi-site install and point various domains and sub-domains to it.我想创建一个 WordPress 多站点安装并将各种域和子域指向它。 Here are examples:以下是示例:

www.mymaindomain.com
test.mymaindomain.com
www.newdomain.com
multi.anotherdomain.com

In cPanel, it's pretty painless:在 cPanel 中,它非常轻松:

  1. Create a WordPress multi-site install under www.mymaindomain.com在www.mymaindomain.com下创建一个WordPress多站点安装
  2. Point the domains to cPanel's IP address in DNS将域指向 cPanel 在 DNS 中的 IP 地址
  3. Add sub-domains (eg test.mymaindomain.com) and addon domains (eg multi.anotherdomain.com) and point them to the folder of the install.添加子域(例如 test.mymaindomain.com)和附加域(例如 multi.anotherdomain.com)并将它们指向安装文件夹。
  4. Within WordPress multi-site, add the new sites, 1 for each domain/subdomain pointed.在 WordPress 多站点中,添加新站点,每个指向的域/子域 1 个。

It's similar in Plesk.在 Plesk 中也是如此。 However, the complication comes when trying to point non-www domains that are not sub-domains of the main domain (eg multi.anotherdomain.com) to the site.然而,当试图将不是主域的子域的非 www 域(例如 multi.anotherdomain.com)指向该站点时,就会出现复杂情况。 Plesk doesn't have 'Addon' domains like cPanel. Plesk 没有像 cPanel 这样的“插件”域。 Instead it has 'Domain Aliases' where it forces you to use a www domain.相反,它具有“域别名”,它会强制您使用 www 域。

I'm not finding any good simple instructions for this in Plesk.我在 Plesk 中没有找到任何好的简单说明。 Are there any?有吗?

在此处输入图像描述

If you know the differences between cPanel and Plesk, the answer is straight-forward.如果您知道 cPanel 和 Plesk 之间的区别,那么答案很简单。 Basically, if you want to point a subdomain to a subscription (ie one group of domains) for a WordPress multi-site, then even if the main domain isn't pointing to the server, you still need to add it first, then create the subdomain after that and point it to the httpdocs folder of the main subscription domain.基本上,如果您想将子域指向 WordPress 多站点的订阅(即一组域),那么即使主域没有指向服务器,您仍然需要先添加它,然后创建之后的子域并将其指向主订阅域的 httpdocs 文件夹。

Although it is an old question, I will answer this because the situation has not changed since then.虽然这是一个老问题,但我会回答这个问题,因为从那时起情况没有改变。

cPanel's "add-on domain" is the same thing with "alias domain" in Plesk, however, Plesk does not support adding an alias for subdomains. cPanel 的“附加域”与 Plesk 中的“别名域”相同,但是,Plesk 不支持为子域添加别名。 See this KB article: https://www.plesk.com/kb/support/how-to-add-an-alias-for-subdomain-in-plesk-for-linux/请参阅此知识库文章: https://www.plesk.com/kb/support/how-to-add-an-alias-for-subdomain-in-plesk-for-linux/

In the same article they also provide two work arounds one of which involves only adding a top level domain as an alias to a subdomain.在同一篇文章中,他们还提供了两种解决方法,其中一种仅涉及将顶级域作为别名添加到子域。 The second work around however doesn't have this limitation.然而,第二个解决方法没有这个限制。 You can add extra directives for Apache and nginx to Plesk configuration of that domain like;您可以将 Apache 和 nginx 的额外指令添加到该域的 Plesk 配置中,例如:

For Apache:对于 Apache:

ServerAlias subdomain.example.com
ServerAlias example.com
ServerAlias www.example.com

For nginx:对于 nginx:

server_name subdomain.example.com
server_name example.com
server_name www.example.com

If you are using nginx as a proxy to Apache, then you will most probably need to do both.如果您使用 nginx 作为 Apache 的代理,那么您很可能需要同时执行这两个操作。 The downside is that you won't see anything about these aliases in any place of Plesk and nothing is configurable about them from the GUI.缺点是您在 Plesk 的任何地方都看不到有关这些别名的任何信息,并且无法从 GUI 配置它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM