zPanel https Configuration Issues

  • Post author:
  • Post category:IT / Network

Issue:

After deploying zPanel for a week, seems that most of the domains, subdomains, mail server are fine. But as the webmail using Roundcube cannot be executed as it forces https.

Solution:

General another pair of self-generated keys from CentOS

Configure /etc/httpd/conf.d/ssl.conf to

  1. use some other https port, in my case, use 8443 and configure it in /etc/httpd/conf.d/ssl.conf
  2. add DocumentRoot “/etc/zpanel/panel
  3. add ServerName [DOMAIN.TLD]:443
  4. uncomment SSLCertificateFile /etc/pki/tls/certs/[YOURCERT.crt]
  5. uncomment SSLCertificateKeyFile /etc/pki/tls/private/[YOURKEY.key]

Open the https port in Firewall and Router port-forwarding (if any)

Add directives into a new file /etc/zpanel/configs/apache/httpd-ssl-vhosts.conf to include the following:

############################################
# Configuration for ZPanel control panel.
<VirtualHost *:8443>
ServerAdmin [email protected]
DocumentRoot “/etc/zpanel/panel/”
ServerName zpanel.erbeauty.com
AddType application/x-httpd-php .php
<Directory “/etc/zpanel/panel/”>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Custom settings are loaded below this line (if any exist)
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/[YOURCERT.crt]
SSLCertificateKeyFile /etc/pki/tls/private/[YOURKEY.key]
#
</VirtualHost>
##############################################

Add following line to file: /etc/httpd/conf/httpd.conf

Include /etc/zpanel/configs/apache/httpd-ssl-vhosts.conf

Config:

  • CentOS      6.5(x86_64)
  • zPanel        10.1.0
  • Apache      2.2.15
  • php             5.3.3

Tricks:

Most of the solution on the web cannot fix the issue as some are probably for old zPanel versions that they are not aware that changing directly the httpd-vhosts.conf is inappropriate as whenever “Run Daemon Now” in zPanel Config, the httpd-vhosts.conf will be re-generated according to the Config change or unchange in the zPanel config interface.

Don’t directly input the httpd-vhost directives into “Module Admin” -> “Apache Config” -> “Global zPanel Entry”. In my experience, it doesn’t work. In practice, adding the directives into a new httpd-ssl-vhosts.conf will ensure nothing changed unexpectedly during every “Run Daemon Now” under Admin -> zPanel Config.