The MU forums have moved to WordPress.org

Sub-domain mapping on CPanel (13 posts)

  1. VentureMaker
    Member
    Posted 5 years ago #

    Hey, guys

    Got a challenge mapping a remote sub-domain to WPMU on CPanel :)

    So, WPMU is hosted on CPanel, remote (mapped) domain is hosted elsewhere.

    I want to map blog.remotedomain.com sub-domain to WPMU.
    CNAME record blog.remotedomain.com is set to point to username.mywpmu.com

    The issue is that blog.remotedomain.com 'points' to my server, but displays standard CPanel page instead of displaying username.mywpmu.com

    In readme for Donncha's domain mapping plugin I see this:

    Make sure the default Apache virtual host points at your WordPress MU site so it will handle unknown domains correctly. (Need info on cpanel, etc. How do you get them to respond to any domain?)

    So, does anyone have this 'info on cpanel - how do you get them to respond to any domain?'

  2. Ovidiu
    Member
    Posted 5 years ago #

    basically there is no default vhost, the first one is the one that responds to unknown domains.
    But if you're on shared hosting, :-( I mean if you are on shared hosting I *guess* your hosting provider will have a default vhost of his own, so I am pretty sure you can't set your own domain as the "default" one...

  3. VentureMaker
    Member
    Posted 5 years ago #

    Ovi, this is a dedicated server with WHM :)

  4. Ovidiu
    Member
    Posted 5 years ago #

    well than, which one is your FIRST vhost?

    try and point a new domain to your server, then after DNS has propagated, browse to that domain. You should end up at the FIRST vhost.

    ###edit###
    maybe I understood you completely wrong, but here is another try:

    so you pointed blog.remotedomain.com to point to this servers IP, then you made sure the wpmu blog it is pointing to has been setup with the wildcard DNS and this "ServerAlias *.domain.tld" exists but when you browse to blog.remotedomain.com you see the default cpanel page, right?

    that simply means that cpanel has installed a default vhost, meaning nothing less than it has set up a default vhost that kinda catches all that is not specifically defined. you would need to get rid of this, so the wpmu site can be the first vhost and catch all, right?

  5. VentureMaker
    Member
    Posted 5 years ago #

    so you pointed blog.remotedomain.com to point to this servers IP

    Not exactly. I created a CNAME record blog.remotedomain.com that points to username.mywpmu.com
    I only created a CNAME record, not A record.

    Then I added blog.remotedomain.com in Domain Mapping section of username.mywpmu.com

    then you made sure the wpmu blog it is pointing to has been setup with the wildcard DNS and this "ServerAlias *.domain.tld" exists but when you browse to blog.remotedomain.com you see the default cpanel page, right?

    Exactly.

    that simply means that cpanel has installed a default vhost, meaning nothing less than it has set up a default vhost that kinda catches all that is not specifically defined. you would need to get rid of this, so the wpmu site can be the first vhost and catch all

    So, you mean that mywpmu.com is not the first vhost in httpd.conf and this causes the problem?

  6. awarner20
    Member
    Posted 5 years ago #

    I'm not sure if this will help, but I had to figure out some steps to get the Domain Mapping plugin to work with cPanel...

    See my comment here for a step by step that worked for me:

    http://mu.wordpress.org/forums/topic.php?id=11122#post-68946

  7. VentureMaker
    Member
    Posted 5 years ago #

    Well, I have no problems mapping a domain :)
    My issue is with SUB-domain.

  8. Ovidiu
    Member
    Posted 5 years ago #

    oh, so on exactly the same server domain mapping works except that sub domain mapping doesn't?

  9. VentureMaker
    Member
    Posted 5 years ago #

    O-o-ops :)
    Just tested on this server.
    Mapping a domain produces exactly the same result - default CPanel page.

  10. andrea_r
    Moderator
    Posted 5 years ago #

    It's not really cpanel, although it may be the order in which cpanel set stuff up..

    go look at the httpd.conf file. Stuff is in the wrong order.

  11. VentureMaker
    Member
    Posted 5 years ago #

    In my case it looks like this:

    <VirtualHost xxx.xxx.xxx.xxx:80>
    ServerName domain.net
    ServerAlias *.domain.net http://www.domain.net
    ServerAdmin webmaster@domain.net
    DocumentRoot /home/xxxxxxxx/public_html
    <IfModule mod_suphp.c>
    suPHP_UserGroup realesta realesta
    </IfModule>
    <IfModule !mod_disable_suexec.c>
    User xxxxxxxx
    Group xxxxxxxx
    </IfModule>

    <DIRECTORY /home/xxxxxxxx/public_html>
    OPTIONS Indexes Includes ExecCGI FollowSymLinks
    AllowOverride FileInfo Options
    </DIRECTORY>
    </VirtualHost>

  12. lunabyte
    Member
    Posted 5 years ago #

    For mapped domains and cpanel (puke), you have to "park" domains onto the main domain you're using. Including parking a *.domain2.tld as well (if your serving sub domains off of it).

    You can also use the include file listed in the virtual host for the primary domain (by un-commenting it), and then just edit the include file when you add a domain/subdomain.

    The include file would be just a server alias line, where you can add whatever to it.

  13. VentureMaker
    Member
    Posted 5 years ago #

    So how the included server alias should look like in this case?

About this Topic

  • Started 5 years ago by VentureMaker
  • Latest reply from VentureMaker