Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to secure a domain example.com and subdomains, dash.example.com, sql.example.com, etc...

I didn't set up the server so I don't really know the DNS entries. As you may notice I'm really new to this. I noticed that example.com and the subdomains dash.example.com, sql... don't have the same IP address and not the same web host. So are they really subdomains?

Can I still purchase a certificate for www.example.com and use ServerAlias of virtual host of Apache to secure the subdomains? Or should i purchase a wildcard certificate for *.example.com and somehow add example.com to the virtualhost?

It may be a bit confusing as I don't really know what i'm talking about so please understand!

share|improve this question

closed as off-topic by ceejayoz, Flup, mdpc, Ward, Falcon Momot Jul 24 at 8:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – ceejayoz, Flup, Ward, Falcon Momot
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Yes, they're still subdomains if they're hosted on different servers. This is common. In fact, it's common for a single domain like www.facebook.com to be handled by thousands of different servers. –  ceejayoz Jul 22 at 17:43

2 Answers 2

up vote 0 down vote accepted

Certificates can be mapped in just about any combination you may need.

I noticed that example.com and the subdomains dash.example.com, sql... don't have the same IP address and not the same web host.

Based on this description you will need at least two certificates, one for example.com and the other a wildcard for *.example.com. Depending on your exact situation - notably if all of these are running on the same server or not - it may be cheaper to purchase individual host names. Many vendors license your SSL certificates by the number of servers they are installed on.

Can I still purchase a certificate for www.example.com and use ServerAlias of virtual host of Apache to secure the subdomains? Or should i purchase a wildcard certificate for *.example.com and somehow add example.com to the virtualhost?

Ideally you don't want to change any of the existing virtual host directives but add duplicates for them, mapped to the correct HTTPS port (443).

For example:

<VirtualHost ipaddress:80>
    ServerName example.com
    .... <your existing definition> 
</VirtualHost>

You copy this to a new block like the following.

<VirtualHost ipaddress:443>
    ServerName example.com
    ....
    SSLProxyEngine on
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/server.crt
    SSLCertificateKeyFile /etc/ssl/private/server.key
</VirtualHost>
share|improve this answer
  1. Yes, they are really subdomains - subdomain should not neccesary sit on the same IP.

  2. You will need two certificates: one for example.com, second for *.example.com, and mind that * does not include a dot - so, bought *.example.com will not help you so use SSL with subdomain.subdomain.example.com

Some providers use SubjectAltName - then you can use one certificate with example.com and *.example.com

share|improve this answer

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