WordPress多站点设置为子域 - 通配符DNS记录设置 [英] WordPress multisite setup as subdomain - wildcard DNS record setup

查看:406
本文介绍了WordPress多站点设置为子域 - 通配符DNS记录设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是WP多站点环境的新手。我想在我本地的Ubuntu 14.04环境中设置多站点。我已经将本地主机作为我的主站点配置为carbazarlocal.com并运行正常。当我转到工具>网络设置时,我可以看到两个选项 - 子域和子目录。我想将我的多元化作为子域,如dealer1.carbazarlocal.com,dealer2.carbazarlocal.com等。



在这个页面上WordPress说你会如果要使用虚拟主机(子域)功能,则需要通配符DNS记录。如何做到这一点和哪里?



在/ etc / hosts我有以下条目:



  127.0.0.1 carbazarlocal.com 



在/ etc / apache2 / apache2中。 conf我有以下内容:



 < Directory / var / www / html / carbazar> 
选项索引FollowSymLinks
AllowOverride全部
要求所有已授予
< / Directory>



在/etc/apache2/sites-available/carbazarlocal.com.conf我有这个: h2>

 < VirtualHost *:80> 
ServerAdmin admin@carbazarlocal.com
服务器名称carbazarlocal.com
ServerAlias * .carbazarlocal.com
DocumentRoot / var / www / html / carbazar
< / VirtualHost>



在/ var / www / html / carbazar / wp-config我有这个:



  define('WP_ALLOW_MULTISITE',true); 

还需要做什么以及在哪里完成以下步骤:
你会需要通配符DNS记录,如果要使用虚拟主机(子域)功能?

解决方案

如果您使用Apache服务器然后...



在httpd.conf文件或包含您的Web帐户的VirtualHost部分的包含文件中,添加如下尚未存在):



ServerAlias * .example.com



还要创建一个通配符DNS记录,如:



*。example.com A 192.0.43.10

REF https://codex.wordpress.org/Configuring_Wildcard_Subdomains


I am new to WP multisite environment. I want to setup multisite in my local Ubuntu 14.04 environment. I already have localhost for my main site configured as carbazarlocal.com and its running OK. When I go to Tools > Network Setup I can see two options - Sub-domain and Sub-directory. I want to setup my multisites as sub-domains like dealer1.carbazarlocal.com, dealer2.carbazarlocal.com etc.

On this page WordPress says "You will need a wildcard DNS record if you are going to use the virtual host (sub-domain) functionality". How to do this and where?

In /etc/hosts I have the following entry:

127.0.0.1   carbazarlocal.com

In /etc/apache2/apache2.conf I have the following:

<Directory /var/www/html/carbazar>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

In /etc/apache2/sites-available/carbazarlocal.com.conf I have this:

<VirtualHost *:80>
     ServerAdmin admin@carbazarlocal.com
     ServerName carbazarlocal.com
     ServerAlias *.carbazarlocal.com
     DocumentRoot /var/www/html/carbazar
</VirtualHost>

And in /var/www/html/carbazar/wp-config I have this:

define('WP_ALLOW_MULTISITE', true);

What else I need to do and where to complete the following step: "You will need a wildcard DNS record if you are going to use the virtual host (sub-domain) functionality"?

解决方案

If you use Apache server then ...

In the httpd.conf file, or in the include file containing the VirtualHost section for your web account, add a line like this (if it is not already present):

ServerAlias *.example.com

Also create a wildcard DNS record like:

*.example.com A 192.0.43.10

REF https://codex.wordpress.org/Configuring_Wildcard_Subdomains

这篇关于WordPress多站点设置为子域 - 通配符DNS记录设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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