4

I've dug around the web without much luck in finding a solution. Hopefully I can get some insight here.

I have a VPS with a dedicated IP address running WHM. Let's say I have two cPanel accounts in this example.

  1. ip.address/~user1 has an addon domain example.com which has both email and web localhost. We want to keep the email here but point the web to a second cPanel.

  2. ip.address/~user2 has their website but will not have their email here as it will stay at user1.

There doesn't seem to be a straightforward approach to this so I am looking for any feedback.

Revised question

After some more research on different approaches I want to clarify my specific situation.

Per the example above, ip.address/~user1 has their example.com as an addon and both web and email are localhost. The destination for the web host is at ip.address/~user2, however it is a WordPress MU site setup as subdirectories. So the destination for the example.com new website, on the same VPS but in a different cPanel, looks like multisite.com/user1-domain

Would it be possible to create a CNAME record for example.com web host so web traffic at that address, example.com, sees the MU site? I hope that makes sense.

  • I do not know cPanel at all, however, you can simply change the web sites DocumentRoot and Directory directives in the configuration files to point to whatever directory you want. If you have access to the shell, you can simply go to /etc/apache2/ and look for httpd.conf or /etc/apache2/sites-available/ and look for 000-default.conf or domainname.tld.conf and edit these files. You will have to restart Apache to reload the file. – closetnoc May 13 '16 at 0:06
  • Are you using the whm DNS or some other DNS service? Don't edit the Apache config as root, whm will overwrite it. – Howard E May 13 '16 at 0:36
  • @HowardE I am using WHM DNS – user195439 May 13 '16 at 0:44
  • 2
    This question has nothing to do with DNS. It is a simple Apache configuration change to achieve the OPs goal. – closetnoc May 13 '16 at 4:26
  • 1
    Changing Apache config from command line as root in whm is counter productive. It's not recommended. You have to either add the IP to your whm, adjust your dns, or mange Apache via whm. – Howard E May 13 '16 at 10:35
1

What you are trying to do is incredibly difficult to do using WHM as cPanel/WHM is simply not designed with this use-case in mind. The easiest solution would be adding a second IP address which has been identified in the comments however if that is out of the question then in this case it would almost be easier for you if you where to remove the WordPress multi-site from the cPanel server and move it onto its own virtual server under the Apache default vhost. Then you can provide the servers IP address for all DNS entries for sites that are hosted through the WordPress multi-site. This would have the added benefit of not requiring configuration changes to the server and so not needing service restarts every time a new site is added to the WordPress multi-site installation.

  • I ended up going with a second IP. – user195439 Oct 13 '16 at 4:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.