Amazon EC2 - Ubuntu Apache2 Virtual Hosts Setup procedures

Procedures tested on Amazon EC2/ubuntu/Apache2 Instance (Procedures should also work on Debain Distribution but we did not test it)
Note1: These steps assume FTP server is already installed on the EC2 Instance (good docs on Installing vsftpd on an Amazon EC2 Ubuntu instance can be found here)
Note2: all commands require sudo for ubuntu (unless you are logged in as root user which is unlikely since you are using Amazon EC2 Instance )

Step0: Change DNS Records to point to the new Amazon EC2 IP address
Step1: Open Command Line Terminal (PuTTY for example)
Step2: Add a user with full access permissions to the site

adduser New-User-Name
Enter Password, Full Name, Room Number, etc.
Answer y to is this info correct question
Step2.1:Verify the user created by goin to the new user name directory under /home
cd /home/New-User-Name

Step3: Change the new user directory access writes to all allow write permisions

chmod a-w /home/New-User-Name

Step4: Create directory structure of your choice- we will use apps directory under which we will add all our site contents

mkdir apps
chown New-User-Name apps (change the owner of the directory to the new user
chgrp New-User-Name apps (change the group to the new user)
Step4.1: create site structure of your choice
using FTP create you site directory structure for example or htpdocs or mamboy or blablabla

Step5: Enable site through apache

cd /etc/apache2/sites-available
creat a file with the name that looks like this:
<VirtualHost *>

# Indexes + Directory Root.
DirectoryIndex index.html index.php
DocumentRoot /home/your-site/www/
# Logfiles
ErrorLog /home/your-site/logs/error.log
CustomLog /home/your-site/logs/access.log combined


Step5.1: enable the site


Step6: Reload Apache service

service apache2 reload
service apache2 status

Potential Issues after Setup

FTP Issues:

500 OOPS: vsftpd: refusing to run with writable root inside chroot ()

Solution: chmod a-w /home/user (you are not allowed to make the root directory for a user writable (just set the permisions to 555 instead of 755)

Application & Script


We tested these procedures on Parallels Plesk Panel Version 9.2.3

Issue New Plesk installation does not come with webmail installed, you need to install it yourself. see resolution

Mailman mailing list manager support and Installation on a dedicated server

You will not be able to enable mailing lists unless this software is installed. see resolution

Retrieve your Plesk Control Panel Password from SSH - see resolution