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

查看:99
本文介绍了一个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环境.我们在这个网络上只有两个站点;主站点和一个网络站点.

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 Multisite.为此,我们在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 表中检查不同环境的设置.是否将其设置为开发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天全站免登陆