Domain mapping not working

I followed the instructions for the Domain mapping plugin and I keep getting a server error. My A record is pointing to my servers IP. I have a VPS with WHM/Cpanel. I don't know if there's something else I need to configure. Wanted to test one of my domains, so when a customer made a site and purchased a domain from somewhere they would be able to map their domain as well just fine.

  • Dimitris

    Hey there Matthew Valadez,

    hope you're doing good and thanks for reaching us! :slight_smile:

    I followed the instructions for the Domain mapping plugin

    Do you mean the instructions steps in usage page of Domain Mapping plugin here, is that right?
    https://premium.wpmudev.org/project/domain-mapping/#product-usage

    I keep getting a server error.

    Could you please inform us about the error message you're getting?

    I presume that as you've got a VPS, you should have a static IP, is that right?
    Have you made sure that the DocumentRoot of this IP address is also pointing to the actual folder of your multisite installation? So that if you use the IP address in a browser tab, it should get you to the main site of your multisite.

    Also, the mapped domains should also point via a A record to the same IP address. If these are added to your server as add-on domains, the DocumentRoot of these, should also point to the same directory that your multisite installation lies, just like I mentioned about IP address just above.

    Finally, please keep in mind that any changes of nameservers in domain name registrar and/or changes of the actual DNS records, need some time (30min~48hours) to propagate.

    Warm regards,
    Dimitris

    • Matthew Valadez

      Hi,

      Yes I followed the instructions on the WPMU page for Domain mapping. One thing I was confused about was the DocumentRoot. *.yourdomain.com is pointed to the public_html, but after re-reading your post I found the issue.

      I presume that as you've got a VPS, you should have a static IP, is that right?
      Have you made sure that the DocumentRoot of this IP address is also pointing to the actual folder of your multisite installation? So that if you use the IP address in a browser tab, it should get you to the main site of your multisite.

      I typed in the IP address and it gives me the default CGI page (cgi-sys/defaultwebpage.cgi) for cPanel. How would I fix this? I have two domains on the server (both different multisite installations). Guessing once I fix this, than my problem would be solved.

      But....when fixed will it break anything, since there is two multisite installations on the server? If so, I would have to merge them, which would be fine (or just get another VPS). One multisite installation is for a company, when users signup they would get their own site, etc. Another is for me for my personal websites and demo site I create.

      Hopefully I didn't confuse you much. Thanks again for the quick reply.

      -Matta

  • Adam Czajczyk

    Hello Matta!

    Setting the document root for an IP to point to the document root of your Multisite (the one with Domain Mapping) should solve the issue but if there's only a single IP that's used for both your Multisite installs, that would indeed break the other one.

    The best solution would be to get a second IP to be used with that other install. An alternative option would be to make a change to "domain to be mapped" configuration and instead of pointing it to an IP via A record, just add it to your VPS and point name servers at domain provider to it. That's similar to how you add any other domain that you wish to use for the site on your server.

    Then instead of settings a root folder (document root) for an IP address, you would set it for that add-on domain and that would work equally well.

    Best regards,
    Adam

    • Matthew Valadez

      Adam,

      Found out I have three dedicated IP's total, so I went ahead in WHM and changed the site's IP address and updated DNS records.

      Logged back into wordpress to update the Domain mapping plugin to reflect the new IP address.
      Mapped site1.yourdomain.com with domain.com. Says "valid". Went to test it out and still default cgi page.

      Open putty to check document root:

      # vim /var/cpanel/userdata/USER/DOMAIN.COM
      =documentroot: /home/USER/public_html

      Cleared browser cache, flush computer DNS, still same effect. Am I missing something???

  • Matthew Valadez

    I can now say I successfully resolved the issue and this is how:

    On the Network Admin side on checked my Domain mapping settings. I changed the admin/login setting to mapped domain and for Verify Domain DNS/domain propagation set to yes. When I went to site1.yourdomain.com it took me to the mapped domain (yourdomain.com/wp-admin) to log in. Yes!

    Under site1.yourdomain.com Domain Mapping settings I clicked the star and made sure it was set to "Direct to mapped (primary) domain".

    Still got the default cgi page, but knowing everything was fixed, I simply cleared browser cache and everything is good.

    Since I have two multisite installations, I needed another dedicated IP, so each multisite could point to it's own IP address.

    I hope this helps someone else. Thanks again WPMU!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.