enable https for Sentora

By default, Sentora does not support https. We will add https support to Sentora most like we have done for zPanel.

First, install ssl module for apache:

yum install mod_ssl

Now the configuration file of httpd have been changed to enable ssl. In /etc/httpd/conf.d, there is a file ssl.conf which is included in /etc/httpd/conf/httpd.conf(this main apache configuration file also includes /etc/sentora/configs/apache/httpd.conf). Edit ssl.conf to only include the following lines:
LoadModule ssl_module modules/mod_ssl.so
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

We will create another configuration file http-panel-ssl.conf(included in /etc/sentora/configs/apache/httpd.conf)  in /etc/sentora/configs/apache to add more ssl stuff. The content of this file is:

Listen 443
NameVirtualHost *:443

# Configuration for ZPanel control panel.
<VirtualHost *:443>
ServerAdmin zadmin@localhost
DocumentRoot “/etc/sentora/panel/”
ServerName panel.domainhostseotool.com:443
ServerAlias *.panel.domainhostseotool.com
AddType application/x-httpd-php .php
<Directory “/etc/sentora/panel/”>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

# Custom settings are loaded below this line (if any exist)
SSLEngine On

Restart httpd, you will find https://panel.domainhostseotool.com is online.

Note that if you are doing work on CentOS 7, you should replace the two lines in the <Directory> instruction:

Order allow,deny
Allow from all

with the following line:

Require all granted

Otherwise, you will get the following error:

AH01630: client denied by server configuration: /etc/sentora/panel/

when you visit sentora panel. You will get a 403 forbidden error and then be redirected to the Apache welcome page.

Posted in tips of hosting