且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

一个 EC2 实例 (AWS) 下的多个 WordPress Multisite

更新时间:2023-11-22 20:04:28

检查您在 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>