VPS - Vesta - Wordpress multisite - Domain mapping

I am trying to make a multisite with subdomains. I am using a clean server with debian 8, and have installed the panel Vesta. The IP is dedicated. I have installed wordpress on the main domain and activated multisite. The multisite consists of 3 individual domains, all having A records pointing at the dedicated server/IP. The 2 other domains are created on the network - however they are not working..

I think that I need to point the 2 other domains to the folder (public_html) of the main domain - but how do I do it?

  • Kasia Swiderska

    Hello Tommy,

    The 2 other domains are created on the network - however they are not working..

    I'm not sure I understand correctly that - what do you mean by "created on the network"? You mean you edited subsites and there you entered the Top Level Domain?

    I think that I need to point the 2 other domains to the folder (public_html) of the main domain - but how do I do it?

    Usually you do that by add-on domain and then point them to root directory of your network installation (I'm not familiar with Vesta panel - found this thread about adding add-on domain https://forum.vestacp.com/viewtopic.php?t=4430 ).

    kind regards,
    Kasia

  • Rupok

    Hi Tommy,

    In the mean time anyone responds you in that forum, let me give you a workaround and I believe, this will help.

    At first, add your second and third domain in VestaCP in the way you added your first domain. Please check the attached screenshot for reference.

    Now login to your server with SSH with root account. After you login successfully, run the following command in terminal:

    cd /home/admin/conf/web/
    sudo nano apache2.conf

    First line will take you to the location where virtual host file is saved. I assume, your admin user name is "admin". If you have another admin user (e.g. "serveradmin" ) , then the command will be:
    cd /home/serveradmin/conf/web/
    The virtual host config filename is "apache2.conf". Second line will open that file with nano editor. You can open that file with vim or any other way you prefer.

    Now when the file is opened, you will find configuration for all three domain you added through yoru Vesta Panel. It will most probably look like this:

    Now change the path for all lines to the path of the first domain. For example, your first domain is "one.com" and second domain is "two.com"
    So change every instance of "/home/admin/web/two.com/" to "/home/admin/web/one.com/". Do this for your third domain too.
    Now save the file and restart your server.
    I believe, this will change the root path of your second and third domain to the root folder of your first domain. And now your mapping will work.

    If your issue is still there, then please let us know. I'll try to troubleshoot further.

    Have a nice day. Cheers!
    Rupok

  • Tommy

    Hey Rupok,

    You are my hero :slight_smile:

    It worked, even though I changed only the lines containing ..../public_html for domain 2+3.
    However when trying to map domain 2+3, then I get an infobox telling me that they are already mapped - but in the controlpanel for the whole multisite I cannot see the mapped domains.

    Should I worry about that, or just be happy that it is working? I can grant you access if you want to.

    Again a lot of thanks, Rupok :wink:

    /Tommy

  • Rupok

    Hi Tommy,

    Should I worry about that, or just be happy that it is working? I can grant you access if you want to.

    If your mapping is working fine, then you can leave it as it is now. But if you want us to have a look regarding why your mapped domains are not being shown in Domain Mapping Network Settings section, I'll be glad to have a look.

    Would you mind allowing Support Access so we can have a closer look at this?

    To enable support access you can follow this guide here:
    http://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Have a nice day. Cheers!
    Rupok

  • Kasia Swiderska

    Hello Tommy,

    I just meant that the 2 other domains were added as websites in Wordpress.

    In that case you don't need Domain Mapping plugin at all (if you plan to map more than one domain to one subsite, then you will need it).
    Domain mapping is used to map domain like two.com to subsite that has url like two.first.com or first.com/two (I created test subsite in your Network, you can check how it's url looks like and you can map domain to that subsite).
    If your subsite is already using top level domain there is no need for any additional mapping (and that how its looks like on your site).

    kind regards,
    Kasia

  • Rupok

    Hi Tommy,

    Thanks for granting Support Access. I think something on your Multisite configuration is customized. Because your multisite network is a Subdomain Multisite Network, but I don't think wildcard subdomain entry is there in your Vesta setup. To set up wildcard subdomain in Vesta, please go edit your Web in vesta control panel, and in the "Aliases" box, replace "www.yourdomain.com" with " *.yourdomain.com" and save. That will create wildcard subdomain alias. I'm confirming this issue because I created a test subsite on your network, but when I went to the Dashboard of that subsite, it returned with 404.

    the 2 other domains were added as websites in Wordpress

    Another thing was interesting, when I went to edit one of your subsites, it was showing your second or third domain in the "Website address (URL)" box under the "Info" tab. Normally you should not edit that URL. Suppose, you create a subsite called "hello.yoursite.com", so that field should have "hello.yoursite.com" in the "Website Address" box, not "second.com".

    That's why your mapping is working, but it's not being shown under Domain Mapping. Technically it's fine, you added "en********er.dk" domain for your subsite and as all files are there, it's serving all files required for that site. But this is *adding* a site, not *mapping*. If you want to map your second domain, then the "Website Address" field must have URL in this format: "hello.yoursite.com".

    This is the reason you can not map "en********er.dk" to any other subsite.

    So now you have two choices:
    1. You can add more sites in the same way
    2. I change your site address to a subsite, and then map "en********er.dk" domain to that subsite with Domain Mapping.

    Please note, if you choose the second option, then you can use all features of Domain Mapping like cross domain autologin, force HTTPS etc. but if you choose to continue with the first option, then I'm afraid, Domain Mapping plugin has nothing to do there.

    Please let us know which way you prefer. I'll continue in that path. If you choose the second option, then I'll suggest you to take a full backup of your site including the database. Because when I'll try to edit the site address URL, things may mess up a little bit initially as this is the core of a site. So we can always revert back to current state if anything goes wrong. I'll also need your VestaCP login credentials to add wildcard subdomain alias if you can't do this by yourself. In that case, can you send me message with VestaCP access credentials through our secure contact form here: https://premium.wpmudev.org/contact/ ?

    Subject: "Attn: Rupok"
    - VestaCP admin Username
    - VestaCP admin Password
    - VestaCP Login URL
    - Link back to this thread for reference
    - Any other relevant URLs

    Select "I have a different question" for your topic. This and the subject line ensure that it gets assigned to me.

    Please let us know when you are done sending (if you want us to do this for you). I'm looking forward to hear from you and resolve this issue as soon as possible.

    Have a nice day. Cheers!
    Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.