Home » Hosting Panel » ZPanel » Install ZPanel On CentOS 6.4

Install ZPanel On CentOS 6.4

Tutorial Overview

  • Install ZPanel on CentOS
  • Configure self-signed SSL for ZPanel access
  • Remove conflicting software
  • Check iptables

ZPanel Overview

At the time of writing ZPanel is one of the newer web hosting control panels available for both CentOS 6.4, Ubuntu 12.04 and Microsoft Windows, however, it is already reached version 10.1.1.

It offers many of the features available in other commercial control panels, but without the cost.

Some feature include:

  • Web server
  • Email with webmail, SMTP, POP3 and IMAP4
  • FTP
  • DNS

Prepare The CentOS VPS

Conflicting Software

ZPanel installs its own version of a number of applications, thus any current installations should be removed prior to installing ZPanel. They are:

  • MySQL
  • Apache
  • Bind
  • Dovecot
  • Postfix
  • proFTPd

The following command will remove the above applications from your CentOS VPS:

yum -y group-remove "Web Server" "Mail Server" "DNS Name Server" "FTP Server" "MySQL Database" "Network Servers" "News Server"
yum -y mysql* apache* bind* dovecot* postfix* proftpd*

You should also ensure that any other applications providing the following services are removed:

  • FTP servers
  • Web servers
  • DNS servers
  • POP3/IMAP servers

Network Ports

In addition, you must ensure that the following ports are open in any software filrewall you have running (e.g. iptables, etc.):

  • 20 and 21 : TCP / UDP (FTP)
  • 25 : TCP (SMTP)
  • 53 : TCP / UDP (DNS)
  • 80 : TCP / UDP (HTTP)
  • 443 : TCP / UDP (HTTPS)
  • 110 : TCP (POP3)
  • 143 : TCP (IMAP)

To view your current IPtables configuration, run the following command:

iptables -L -n -v

Hostname Setup

In order to work correctly, your CentOS VPS must be a member of a domain that you own and have a fully qualified domain name (FQDN).

For example, zpanel.example.com. To check your current VPS hostname run the following command:

hostname

Unlike many other web hosting control panels, ZPanel does not run the control panel on a non-standard HTTP port, thus it will be running by default on port 80, on the FQDN that you specify.

So if the FQDN of your CentOS VPS was zpanel.example.com, you would access ZPanel using the following URL http://zpanel.example.com.

It is for this reason that you should ensure the hostname is not something that you may want to use for other services such as www.example.com, mail.example.com, etc.

If you need to change your hostname you can do so by editing the HOSTNAME setting in the /etc/sysconfig/network file.

Then restart the networking service (WARNING: restarting the networking service may disconnect your current SSH session):

/etc/init.d/network restart

Installing ZPanel

Prior to installing you should check the ZPanel website to ensure that you are installing the latest version of the control panel.

At the time of writing this article, ZPanel was on version 10.1.1.

For security reasons, it is recommended that you only install the latest stable release in your production environment.

After your CentOS VPS has been prepared you should download the latest copy of the ZPanel installer.

Replace [ZPANEL VERSION] with the current version of ZPanel in the following format X_X_X, for example, version 10.1.1 would be 10_1_1:

cd /root/
wget https://raw.github.com/zpanel/installers/master/install/CentOS-6_4/[ZPANEL VERSION].sh

Now we need to start the installation:

sh ./[ZPANEL VERSION].sh

The installation process currently runs as follows:

  • Agree to the GPL license
  • Enter your timezone information
  • Choose to install ZPanel as opposed to upgrade
  • Enter the fully qualified domain name (FQDN) of your CentOS VPS (e.g. zpanel.example.com)
  • Enter your VPS public IP address
  • Enter the root password used for MySQL

Once you have completed the above, ZPanel will begin to download and install the required software to your VPS.

After installation has completed, you can access your ZPanel installation using either of the following:

http://[VPS FQDN] - e.g. http://zpanel.example.com
http://[DOMAIN NAME] - e.g. http://example.com
http://[VPS IP] - e.g. http://192.168.1.1

Your ZPanel server is now up and running!

Configuring Self Signed SSL Access

First we need to make sure that OpenSSL is installed on your VPS:

yum -y install openssl

Next we need to create the self-signed certificate to use for HTTPS access to ZPanel:

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

After creating the SSL certificate we need to make sure that the ZPanel Apache web server is configured to use it:

nano /etc/httpd/conf.d/ssl.conf

Find the SSLCertificateFile and SSLCertificateKeyFile entries and configure them as follows:

SSLCertificateFile /etc/pki/tls/certs/zpanel.crt
SSLCertificateKeyFile /etc/pki/tls/certs/zpanel.key

Once you have made the changes, save and exit from the file.

Finally, we need to make sure that any attempts to log in to ZPanel using the HTTP URL are instead redirected to the secure HTTPS.

To do this you will need to login to ZPanel and navigate to the following location:

Zpanel -> Admin -> Module Admin -> Apache Admin

Within the Global Zpanel section, insert the following:

Redirect Permanent / https://[VPS FQDN]/

Finally, you need to restart the Apache server in order for the changes to take effect:

service httpd restart

You can now access your ZPanel installation via secure HTTPS (SSL)!