0

I have a domain with a SSL at https:/www.example.com.

I want that http://www.example.net shows the same website as example.com (same website folder).

I've tried with domain alias in Plesk but it's redirecting to https://www.example.com .

9
  • You need to add CNAME in your DNS. Oct 1, 2013 at 8:50
  • please could you illustrate with an example, or some instructions
    – xavip
    Oct 1, 2013 at 8:53
  • where do I add the CNAME, in the main domain or the alias?
    – xavip
    Oct 1, 2013 at 8:57
  • What DNS provider you are using? Oct 1, 2013 at 9:08
  • I have full access to the server and plesk, I use plesk DNS servers, my domains point to my server nameservers and IP
    – xavip
    Oct 1, 2013 at 9:19

2 Answers 2

0

There are multiple things to consider to get this setup to work (and I dont know how much of it plesk handles... We DO have a webmaster exchange site now, as far as i know).

1) Get domain2 to point to the webserver at domain1.

Either change the A record in domain2 to point to an IP address associated with the webserver running at domain1, or change the A record to a CNAME and point domain2 directly at domain1.

2) Get a valid SSL certificate for domain2

You can't use the SSL certificate from domain1 for domain2. You can't do any kind of pre-redirect over SSL to point domain2 at domain1. You will need a valid certificate from a trusted certificate authority otherwise users will see warning about the SSL connection. You could instruct users to click the continue anyway option in their browsers but there is a good chance that a swat team of IT Security Professionals will kick down your door and beat you with metal bats for training users to do something so insecure and silly (Read up on WHY SSL exists).

3) Configure a means to differentiate between domain1 and domain2

When an SSL connection is made, ..traditionally Apache HTTPd must provide a copt of its certificate before any information is exchanged. At this point, the only thing Apache knows, is the remote IP and the local Apache IP and the relecant ports (and various other TCP headers that are largely unimportant to us). Because Apache knows nothing about the domain name that was used it must attempt to serve a valid certificate for an unknown domain (Apache's Strategy: Use the first one listed in the config).

SSL connections are generally made on port 443. So generally speaking, most external SSL connections to your website will come in on TCP port 443. The remote IP and port are chosen by the client, so in most cases, you can only control which IP the request comes to. Assigning separate IP addresses to domain1 and domain2 is the easiest way to get apache to recognize which domain is being used before all the fancy SSL handshaking and HTTP headers come through.

Many people that have websites don't have the luxury of owning multiple IP addresses. The dirtiest and most useless solution to this issue is to run domain2 at domain1's IP but on a different port (IE: 8443). This causes all sorts of issues. The biggest is: https://domain2.com/ will send requests to domain1 and raise all kinds of SSL errors as a result. This is because with no port specified in the URL and HTTPS listed as the protocol to use, the client browser happily assumes you wanted port 443. No one uses this method and keeps their sanity. (Ir if they do, we haven't heard of them).

The solution that basically everyone uses is Server Name Indication (SNI). This is an extension to the TLS (See: SSL) protocol that essentially adds a Host: header to the request. Read about it here: http://en.wikipedia.org/wiki/Server_Name_Indication . The Relevant RFCs are listed in the sources if you care.

Plesk probably supports SNI but again, I don't play with plesk. Configuring SNI with plesk should be a googlable affair.

4) Create separate virtual hosts in apache for the domains

This is important because of the above SSL considerations. You can't simply use Apache's ServerName or ServerAlias because apache will serve the wrong certificate for one of the domains. Apache will need Distinct Virtual Hosts that point to the same DocumentRoot. My guess is plesk handles this via a Add new host or add new domain option.

.

I Never said I needed SSL on domain2!!!!!


Ok. Good news (If that is the case). Create a CNAME in the DNS for domain2 that points to Domain1. Just know that: You will lay awake at night wondering if users are ever typing: https://domain2.com into the address bar manually and seeing the SSL warning.

And finally, I'd love to give you specific Plesk instructions with screenshots, but I don't know Plesk and I think you (and anyone researching this in the future) might benefit more from a little fundamental knowledge on the backend operations than the point and click solutions. Good Luck. :)

1
  • Thanks for the write up! You provided lots of useful information. I'm planning to host my own webspace (plus maybe my litte REST-ful service for android) and hopefully some simple websites from small businesses. What would you recommend me to do? Is setting up the customer pages ("simple websites") manually (aka "via Terminal") the better approach or is Plesk's GUI flexible enough to save some time? To be able hosting multiple SSL-secured websites is important to me. Is there a LAMP-config you can recommend? Feb 19, 2017 at 11:25
-1

In order to navigate to the DNS Editor in Plesk, please follow the instructions below:

 Log into Plesk.
 Under Hosting Services, click on Domains.
 Find the domain to be edited, and click on the corresponding Control Panel link on the far right.
 Click the Websites & Domains tab.
 Click the DNS Settings link.
 Click on [Manage] to select the appropriate domain.

CNAME Records

To edit a CNAME Record:

Click on the existing CNAME Record under Host to edit.
Change the Record type to CNAME (if necessary).
For Domain name, put in the subdomain you want to host (if necessary).
For Canonical name, enter the name of your desired server.

After making your changes, click OK.

1
  • appreciate you trying to answer, but I already know where to edit DNS settings, you are not answering my question
    – xavip
    Oct 1, 2013 at 9:28

Not the answer you're looking for? Browse other questions tagged .