24 Jan 2012

ZPanel 6 on AWS EC2 - 1 : Installation

This is a two-part post continuing along a hosting theme, today looking at ZPanel, why you should use it and how to install it on an AWS EC2 instance with linked Route53 DNS management.
We've previously looked at EHCP, discussed it's DNS inclusive feature set and highlighted its intuitive interface and ease of install, however if you're looking for complete resolution resilience, and even more polish, I think we might have just the thing. Read on....

We'll skip the basics of AWS and dive straight in to the install, which is easy enough but does require a couple of tweaks to get it functioning on an EC2 instance. The installation listed here covers a 64 bit Ubuntu Linux 10.04LTS 'Micro'.

After launch allocate an elastic IP (EIP), update & upgrade your instance and set both hostname and hosts file to match the AWS public DNS name as per the attached EIP, once done log on as root (su) and install ZPanel as follows..

wget http://sourceforge.net/projects/zpanelcp/files/releases/6.1.1/zpanel-6.1.1.tar.gz
mkdir /etc/zpanel

tar -zxvf zpanel-6.1.1.tar.gz -C /etc/zpanel/

chmod +x /etc/zpanel/lib/dev/zpinstall_ubuntu.sh
/etc/zpanel/lib/dev/zpinstall_ubuntu.sh

You'll be asked various bits and bobs during install, the usual stuff, internet site for postfix, hostname etc and will have to choose usernames and passwords here and there. The most important entry is what you give when asked for the installation sub-domain. EC2 instances can't handle subdomains, as such you need to list a sub FOLDER, i.e use your EC2 public FQDN but add a forward slash + name of folder (/zpanel). When you're done note down the MySQL and panel access details, reboot the server and log in when it comes back up.

Below is a grab of the ZPanel GUI, which I personally think is the cleanest and most simply coherent of any other hosting panel.


Tweaks : 

On checking Service Status you'll notice that both MySQL and SMTP aren't started, getting them fired up is an easy fix and just requires editing a couple of config files. 

SSH into your instance and we'll sort SMTP (Postfix) first..

nano /etc/postfix/main.cf

Simply locate the two hostname entries (they're near the top of the file) and remove the trailing folder from the FQDN as listed (i.e /zpanel), save the file and start Postfix..

service postfix start

All good, now MySQL..

nano /etc/mysql/my.cnf

Comment out the following lines (with the #)..

socket = /var/run/mysqld/mysqld.sock
bind-address = 127.0.0.1

Save the file and restart MySQL..

service mysql restart

With everything running you'll probably now move on to create a domain, and on doing so you may wonder why it shows 'Pending' once created. This is because by default ZPanel runs an hourly Cron job to update the Daemon, it's a simple file edit to alter this to something a bit more dynamic..

nano /etc/cron.d/zdaemon

..and change to 0 to */10 to run every 10 minutes.

The rest of the admin utilities are quite self explanatory to those familiar with hosting, and there's no more behind the scenes tweaking required to get things running smoothly. You will, of course, require some form of DNS management to get your newly created website (and eMail) live and in the next post I'll show you how to do so via Amazons superb Route53.

*UPDATE*  10.10.2013 - Please note, this article is for ZPanel 6. ZPanel 6 is end of life now and is not supported, it is recommended you upgrade to ZPanelX - http://www.zpanelcp.com/


2 comments:

Donovan said...

Hi, thanks for the great tutorials! It was really useful.

I edited the main.cf file as you explained above but I'm having the problem that POP3 and IMAP are not running and I can't get them started. Did you experience the same?

I was also wondering if you could share how you set up your security group.

Thanks!

RichBos said...

Hi, no, well, only until I discovered the postfix main.cf hostname problem, I'm presuming you've removed the trailing folder from the x2 entries as advised? Note that you need to remove the / also as well as what comes after it.

As for port settings, just the basics, port 80 for http, ssh port 22, ftp 21 and the regular TCP mail ports for POP3/POP3S, IMAP/IMAPS and SMTP/SMTPS - 25,110, 143, 465, 587, 993 and 995.

Post a Comment