一个 EC2 实例 (AWS) 下的多个 WordPress Multisite [英] Multiple WordPress Multisite under one EC2 instance (AWS)

查看:29
本文介绍了一个 EC2 实例 (AWS) 下的多个 WordPress Multisite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试为一个 EC2 实例下的多站点配置 DNS 路由.

We are trying to to configure the DNS routing for our multisites under one EC2 instance.

具体来说,我们正在设置 WordPress Multisite 的 DEV、TEST 和 UAT 环境.我们在这个网络上只有 2 个站点;主站点和一个网络站点.

Specifically we are setting up DEV, TEST, and UAT environments of a WordPress Multisite. We only just have 2 sites on this network; the main site and one network site.

现在我已经成功地将我们生产站点(在不同的 EC2 实例上)的副本(使用 Duplicator Pro)迁移到我们的 DEV 并且 WordPress 多站点工作.为此,我们在 route53 上设置了通配符条目(稍后将提供屏幕截图).

Now I have successfully migrated a copy (using Duplicator Pro) of our production site (on a different EC2 instance) to our DEV and the WordPress Multisite works. We have set the wildcard entries on our route53 for this (will provide a screenshot later).

但是当我将同一个副本迁移到 TEST 和 UAT 时,主站点可以运行,但网络站点无法运行,只能重定向到我们的 DEV 站点.

But when I migrated the same copy to TEST and UAT, the main site works but the network site is not working and only redirects to our DEV site.

您能否建议为此设置设置 DNS 和通配符的正确方法?或者这是不可能的,应该为每个环境在单独的 EC2 实例上?

Can you suggest the correct way of setting up the DNS and wildcards for this setup? Or it's not possible and should be on separate EC2 instances for each environment?

推荐答案

检查您在 wp_options 表中的设置以适应不同的环境.是否设置为 dev URL.

Check your setting in wp_options table for different environment. Whethere its set to dev URL or not.

select * from wp_options where option_name like 'siteurl';

wp-config.php

define('WP_SITEURL','http://localhost/xyz'); 

不同的环境应该是不同的.如果可能,请提供您的 URL 示例.

it should be different for different environment. If possible give your URL sample.

您可以将单个 EC2 用于多个 wordpress 实例.您必须设置服务器配置文件以接受 80 或 443 端口下的域请求.

You can use single EC2 for multiple wordpress instance. You have to set server configuration file to accept domain request under 80 or 443 port.

/etc/apache2/site-available/000-default.conf

<VirtualHost *:80>
        ServerName www.example.com
        DocumentRoot /var/www/html/project_name/public/
</VirtualHost>
<VirtualHost *:80>
        ServerName example.com
        DocumentRoot /var/www/html/project_name/public/
</VirtualHost>


<VirtualHost *:80>
        ServerName www.abc.com
        DocumentRoot /var/www/html/project_name1/public/
</VirtualHost>
<VirtualHost *:80>
        ServerName abc.com
        DocumentRoot /var/www/html/project_name1/public/
</VirtualHost>

这篇关于一个 EC2 实例 (AWS) 下的多个 WordPress Multisite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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