• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

How do I install SSL certificates for domain aliases?

D

dillybar1

Guest
I have a domain with several aliases, each of which needs its own SSL certificate. Is there any way to do this with Plesk? If not, is there any way to do this manually?
 
There's no real way to do it through plesk, and it won't really work. I'd just create domains for each of them with symbolic links. Would probably make more sense than trying to hack a way around plesk.
 
Thanks for the reply dasmo. I'll post my solution here as it may help someone else in the future.

I created seperate domains and tried to symlink the DocumentRoots to the main site's DocumentRoot directory, but Apache wasn't having any of that despite setting the +FollowSymLinks directive. I think that applies to symlinks within DocumentRoot and not the DocumentRoot itself.

Anyways, what I ended up doing is overwriting the DocumentRoot setting in vhost.conf and vhost_ssl.conf . I also had to add a Directory block for the new doc root.

So basically within /var/www/vhosts/aliasofmainsite.com/conf/ I created the files vhost.conf and vhost_ssl.conf, both with the same contents:

DocumentRoot /var/www/vhosts/mainsite.com/httpdocs
<Directory /var/www/vhosts/mainsite.com/httpdocs>
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mainsite.com/httpdocs:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mainsite.com/httpdocs:/tmp"
</IfModule>
Options +Includes +ExecCGI
</Directory>

Rebuild the vhost config with the following command:
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<domain_name>

Restart Apache:
/etc/init.d/httpd restart

Note that vhost.conf and vhost_ssl.conf now become the configuration for this site and overwrite the plesk control panel, at least as far as php, cgi, ssi, etc settings.

I was then able to install SSL certs for each domain, and the domains still act as aliases of mainsite. The bonus is each domain now has its own logs, stats and email, which wouldn't be the case if they were aliased and is beneficial in my case. This has been working well so far, hopefully this will help someone else with the same problem.
 
Back
Top