WordPress Multisite with VVV

时间:2017-06-15 作者:Jake

在命令行中,我使用vv create 要创建新的WordPress多站点,请在设置期间在多站点选项上选择“y”。该过程完成后,即创建了站点,但尚未设置网络。我进入wp配置文件,并添加/* Multisite */ define( \'WP_ALLOW_MULTISITE\', true ); 获取管理区域中的网络选项。现在我被困了,因为在设置网络时,它会显示“警告:检测到现有WordPress网络。请完成配置步骤。要创建新网络,您需要清空或删除网络数据库表”在代码块上方启用网络。此外,虽然我能够将代码添加到wp配置文件中,但没有。htaccess文件可用。。。我认为可能不需要创建一个。我没有在网上找到太多的文档,但我所看到的似乎表明这些需求是以另一种方式处理的。有人能帮我弄清楚如何进行多站点设置吗?我觉得我错过了一些非常简单的东西,除了我,每个人都知道,而不是在网上讨论它。。。多尴尬啊。

1 个回复
SO网友:fuxia

You need the VVV Custom site template to enable multisite. And you have to let the main Vagrant instance load it automatically.

Open the vvv-config.yml in the main directory, under sites: add the following entry:

  msvagrant:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template
    hosts:
      - msvagrant.dev
      - en.msvagrant.dev
      - de.msvagrant.dev
    custom:
      wp_type: subdomain

Then run vagrant up, and it should install this multisite with two subdomains.

You will need access to nginx\' error logs. They aren\'t accessible by default, because even as root user, you cannot read anything that directory. :/

In order to fix that, move to the directory provision/ and create a file named vvv-nginx.conf there. Add the following content to it:

server {
    listen       80;
    listen       443 ssl;
    server_name  {{DOMAINS_HERE}};
    root         {vvv_path_to_site}/public_html;

    error_log    {vvv_path_to_site}/log/error.log;
    access_log   {vvv_path_to_site}/log/access.log;

    set          $upstream {upstream};

    include      /etc/nginx/nginx-wp-common.conf;
}

This will create a directory log/ in every site\'s root directory with error.log and access.log in it.

结束

相关推荐

New Site URL for Multisite

我想创建新的网络,但有问题,因为Wordpress说它是无效的。我有一个基本urlhttp://website.com 然后我正试图在那之后创建一个新的网络。我希望我的新网络的名称如下:http://website.com/network1/football/page1http://website.com/network1/baseball/page2http://website.com/network1/soccer/page3http://website.com/network2/football/p