1

It seems that my original post is to confusing, so I rewrote it to be more clear (sry, english is not my first language):

my webcontent is hosted by a different company then my DNS records/domains. Lets call the first contenthoster and the second domainhoster.

The contenthoster uses plesk (v12 on CentOS 7). I also got a domain there, but I don't want to use it. Lets call this one something.com

My "real" domain at the domainprovider is called realthing.com.

Up until now my working setup looked like this:
sub1.realthing.com pointed via A-record to IP-Address of something.com. That works.
sub2.something.com has content and is working (content is showing in a browser)

What I want to do now: sub3.realthing.com point to sub2.something.com and then show the content of sub2.something.com.
I tried to do this with a CNAME entry but what happens is, that sub3.realthing.com shows the content of something.com.
Checking the reverse-DNS record with dnswatch.info shows the right setup (sub3.realthing.com CNAME sub2.something.com). So it seems that I need to do sth at the contentprovider side to enable apache to present the correct content. But I don't know how to do this with plesk.

Any help is much appreciated

Old post (same meaning): my domain there is some internal url (11-43-223-33.customer.company.com). I configured my real domain (mydomain.com) at my domain/dns provider to point to the IP-address (11.43.223.33) of the contenserver. That works.

Now what I want to do and until now am not able to accomplish: Using a subdomain (sub.mydomain.com) to point to a subdomain at my contenthoster (sub.11-43-223-33.customer.company.com). I used a CNAME entry for that (sub.mydomain.com CNAME sub.11-43-223-33.customer.company.com). Instead of showing the content of sub.11-43-223-33.customer.company.com when opening sub.mydomain.com in a browser I got presented with the content of mydomain.com.

As commented below, there is content behind sub.11-43-223-33.customer.company.com which I can access if I open that URL in a browser. So the subdomain at my contentprovider is up and running by itself.

Is it even possible to accomplish this with plesk? Do I need to add sth to the apache config so that it'll work? Any help is much appreciated

  • Do you have the sub-domain defined on the web server?? This may sound silly, however, it has been an answer here more times than not. – closetnoc Oct 7 '15 at 13:28
  • Yes... at least if I understand your question correctly: The website on the subdomain sub.11-43-223-33.customer.company.com is up and running, I can open it with that URL in any browser. Only won't work with the CNAME sub.mydomain.com.. that will open the website of mydomain.com instead. I appended that explanation to the topic, thx. – Joruus Oct 7 '15 at 13:50
  • If you change the CNAME to an IP address, does it work?? Some DNS servers do not like CNAMEs thought it is rare. Keep in mind that it takes a while for the new DNS entries to propagate. To avoid this delay in testing, I set my client computer to point to the DNS where the settings are made (usually the registrars DNS with SOA). You can try this trick before making any changes to an IP address just to make sure. – closetnoc Oct 7 '15 at 14:01
  • No, that results in the same. That's because I already pointed mydomain.com to the IP-address and now I wish to use a subdomain under the same IP-address. There is no way for the webserver to know that I want to open the subdomain when I just let DNS resolve to the IP address. So I thought "hey, CNAME is the way to go". Perhaps it is just not possible to access a subdomain with another DNS-entry Or I have to use some feature of apache instead of meddling with DNS? – Joruus Oct 7 '15 at 15:01
  • You have to have all websites defined on Apache for it to work. You would have one site for example.com and another for sub-domain.example.com. Otherwise, Apache will not be able to match the request in the request header to a location and often provides the first site defined. Depending upon the OS, Apache will install differently. For example, Redhat will be different than Ubuntu. Using a control panel should make this transparent if you use one. What OS do you have? Are you using a control panel? – closetnoc Oct 7 '15 at 15:07
1

Check your Web Server configuration.

How you do that via Plesk I can't say because I try to avoid these "Easy Web Control Panels" like the plague.

However, making an assumption that your underlying web server is most likely "Apache", in the virtual host entry in Apaches configuration for the target sub site your trying to access, you must fully alias the sub domain you wish to access.

I'm not near a server that I can use to grab you an example, but I'll come back to this post later today when I return to my office, and document a full virtual name/server set up.

Off the top of my head for now however, your virtual server needs to contain the following 2 lines (among the other options in there):

ServerName www.example.com
ServerAlias mysub.example.com another.example.com

ServerName MUST hold the name source name you wish that site (sub site) to respond to, which in your case I would suspect would be sub2.example.com , you'd then follow that with a ServerAlias line that would contain sub3.example.com

As long as your DNS is resolving the correct public IP address of the server where everything is hosted, the remainder of your configuration will be specific to what you call "Content Host"

  • Plesk came with the package and once it's there there is not going back ;) But you 're right, underlying is an apache webserver and I tried to add ServerName and ServerAlias to the vhost.conf and vhost_ssl.conf: <br>ServerName sub2.something.com <br>ServerAlias sub3.realthing.com<br></script> no change in bahaviour though :( – Joruus Oct 8 '15 at 13:30
  • ok, i was too impatient... After clearing every browsercache available to mankind it now works! Thanks a lot! – Joruus Oct 8 '15 at 13:39
  • Your welcome Joruus : If I had a penny for every time I'd solved this problem using these 2 little lines I'd be extremely wealthy by now :-) it's by far one of the most common problems I come across when folks try to perform sub site aliasing as you are. – shawty Oct 8 '15 at 14:24

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.