install zpanel on chicagovps

Click here to find the best cheap VPS.

After giving up webmin/virtualmin, I resort to zpanel. But as chicagovps preloaded CentOS is lack of many important software, I get some trouble to install ZPanel.

First the official instructions for installing ZPanel on CentOS 6 failed.

bash <(curl -Ss

I have to download the script and execute it manually:

yum install wget


chmod +x

The script was then running. After selecting the time zone, the sub domain name to access zpanel, the script repeatedly asked you for mysql root password:

enter your root mysql password

. After checking the code in the script, I found the mysql package had not been installed successfully and the script could not communicate with mysqld. The first error message before asking you for mysql password was:

GPG key retrieval failed: [Errno 14] Could not open/read file: ….

After researching, I found it was caused by the lack of epel-release package on the system. And the following command also failed:

yum install epel-release

I tried to intall the rpm package directly.

rpm -Uvh

Please pay attention to the architecture which should be consistent with your OS.

Then I re-executed the script and this time the script went smoothly. After the script finished and a restart of VPS, I could access the zpanel login page in the browser.  But the https version did not not work. This is because the ssl not work properly. To find how to enable https(ssl) for zpanel, I searched google for a while and got the following method(from

1) install openssl (yum install openssl) which is used to generate certifications.

2) yum install mod_ssl which will add a file in /etc/httpd/modules/

2) generate a certification file and a key file.

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -out /etc/pki/tls/certs/zpanel.crt -keyout /etc/pki/tls/certs/zpanel.key

3) create a file ssl.conf in /etc/httpd/conf.d with the following content:

LoadModule ssl_module modules/
SSLCertificateFile /etc/pki/tls/certs/zpanel.crt
SSLCertificateKeyFile /etc/pki/tls/certs/zpanel.key

4) restart httpd: service httpd restart

But httpd failed to start with the following error message:

Starting httpd: Syntax error on line 1 of /etc/httpd/conf.d/ssl.conf:
Invalid command ‘SSLCertificateFile’, perhaps misspelled or defined by a module not included in the server configuration

Should I turn SSL Engine on?

Adding a line: SSLEngine On before the SSLCertificateFile command in the ssl.conf file I got the following error:

Starting httpd: Syntax error on line 1 of /etc/httpd/conf.d/ssl.conf:
Invalid command ‘SSLEngine’, perhaps misspelled or defined by a module not included in the server configuration

I realized that I should load the ssl module before using the ssl related commands, so I added a line at the beginning of ssl.conf

LoadModule ssl_module modules/
However, httpd still failed to start but the error message changed to:

Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name, using for ServerName

This message is very confusing because it made me think the httpd failure is due to the dns resolve failure of the server name( And I went to /etc/hosts to see there was some error in it. However, the file is just ok with associated with So why httpd did not work? To debug httpd(apache) problems, you should remember the names of some files and directories:
/var/log/httpd/error_log, this is where error messages of httpd are put.
/etc/httpd/conf/httpd.conf, which is the main configuration file of apache.
/etc/httpd/conf.d/*, which will be included in the httpd main configuration file.
/etc/zpanel/configs/apache/*, which are zpanel configuration files for apache and also included in the main configuration file.

I opened the error log file and saw the following error:

[error] Illegal attempt to re-initialise SSL for server (theoretically shouldn’t happen!)

Googling this error message brought me to the post, which is the first website in SERP. The post tells me that the error occurs if a virtual hosts at port 443 has “SSLEngine On” statement missing. But I looked through all the conf files and could not see a single virtual host at 443 port. Further researching revealed a fact that “SSLEngine On” cannot be used globally as what I did in ssl.conf. The researching also gave me another method( to enable ssl for zpanel by adding a new virtual host in zpanel’s apache configuration file. So I decided to delete the “SSLEngine On” line in ssl.conf and moved towards adding a new virtual host for zpanel, which resulted in the following code:

NameVirtualHost *:443

ServerAdmin zadmin@localhost
DocumentRoot “/etc/zpanel/panel/”
ServerAlias *
AddType application/x-httpd-php .php
<Directory “/etc/zpanel/panel/”>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

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

This time httpd started successfully and there was no error messages in the log file. But I still could not access the zpanel login page via https. Using netstat command I found httpd listened on port 80,not 443 which is used by https. So I added a line Listen 443 before the newly created virtual host. After restarting httpd, the same error occured:

[error] Illegal attempt to re-initialise SSL for server (theoretically shouldn’t happen!)

Now it is time to add “SSLEngine On” to the custom settings of the newly created virtual host. The reason why this error did not occur before adding the “Listen 443″ statement is probably that apache only initialises SSL when it is configured to listen on port 443.

Finally! I can access the zpanel using https now.


Posted in tips of hosting

Leave a Reply