2

I have this (pseudo) domain setup, and hope to do any configuration via cPanel and/or WHM.

myclient.com - this hosts a development site and there is no public DNS for it yet (by choice) mycompany.com - this is my company's domain name and it's publicly accessible. myclient.mycompany.com - this is the domain I want to use to preview the myclient website during development.

Edit for clarity: All 3 are on the same server and same IP.

So, is it possible to point that subdomain (myclient.mycompany.com) to the webroot of myclient.com using cPanel or WHM?

I've looked at addon domains, redirects and parked domains but each of them can only relate to own account, or cannot be used with another domain if it's managed by the same server.

Any idea? :/

Mere Development
  • 2,439
  • 5
  • 32
  • 63
  • myclient.com data is on another server? if so, just create a DNS record on your mycompany.com domain to point to myclient.com servers IP address... – Flukey Feb 20 '12 at 11:30
  • No everything is on one server. I will edit question to make that more clear now. Thanks for looking! – Mere Development Feb 20 '12 at 11:31
  • Right, so add a DNS record for the subdomain. in cPanel create a virtual host (I don't now much about cPanel) with the server name of the subdomain and the document root as the location of where the myclient files are stored on the server. – Flukey Feb 20 '12 at 11:35
  • Should you point you in the right direction (but you won't be using asterisk as a wildcard, you'll be using 'myclient') http://www.nerdydork.com/setting-up-wildcard-dns-subdomains-on-cpanel.html – Flukey Feb 20 '12 at 11:36
  • Ok thanks all. So it's not possible without manually editing vhosts? Bum.. I wanted a way that we could use each time we do some development and something that non-techy users could undo easily. I'll continue to look and answer if I find something. – Mere Development Feb 20 '12 at 12:27

3 Answers3

3

I went there and did it! But not like I told earlier.

On WHM go to park a domain. Select the domain where you want to park another one.

On the right type the new subdomain. I mean, select "myclient.com" and type myclient.mycompany.com on the right.

Update or save. Wait just a few seconds and try it!

But you must not create the subdomain anywhere else.


The other way is just create an "A" entry on DNS of mycompany.com like this: myclient A "IP where myclient.com is". But it just works if you have an IP to myclient.com and no sharing! (shared ip doesn't work doing this...)

kurtzbot
  • 512
  • 6
  • 19
mauricio
  • 31
  • 2
1

For PLESK:

  1. add a new file named: vhost.conf in subdomain's conf folder with just one line: DocumentRoot [your new path]

Your new path may be: - for new domain root: /var/www/vhosts/(new domain)/httpdocs/ - for new domain subdomain: /var/www/vhosts/(new domain)/subdomains/(subdomain)/httpdocs/

  1. execute as root /usr/local/psa/admin/bin/websrvmng -a
  2. restart apache from plesk or execute: service httpd restart
Nirolf
  • 11
  • 2
1

If your cPanel main domain is mycompany.com just create an addon domain myclient.com

Create myclient.com
Automatically a subdomain myclient.mycompany.com that points to the webroot of myclient.com is created.
Just check it on Subdomains page.


enter image description here

If your cpanel main domain is something else, go to the Addon Domains page and create myclient.com. Note the Document Root automatically generated (most probably /public_html/myclient.com) here or type your own Document Root and copy it.

and then create a subdomain myclient.mycompany.com by pasting myclient.com's Document Root in the Document Root field.

myclient.com will be accessible through myclient.mycompany.com

Hope that helps...

Peace be upon you...

Tabrez Ahmed
  • 2,830
  • 6
  • 31
  • 48
  • Hi Ahmed, thanks for responding. I tried that earlier and get this response: "Error from park wrapper: myclient.com is already configured. Sorry, that domain is already setup (remove it from httpd.conf)" . myclient.com is already setup on that server, so I don't think what I want to do is possible via WHM/cPanel now. Any more thoughts? – Mere Development Feb 20 '12 at 14:49
  • Also check for any cname and a or aaa records that are as myclient.com. If they exist remove them and then try again... – Tabrez Ahmed Feb 20 '12 at 16:27