Having a dedicated Linux box without any form of control panel on it is becoming the norm for me. To help me out, I created a small shell script to create the necessary files in the right places.

It takes 2 inputs at the command line.

The first is a domain name – this is used to create a folder and within the “sites-available” definition.

The second is a username. A new FTP only (i.e. locked out of SSH) user is created.

The script doesn’t really have much validation in it and is probably very easy to break.

The script relies on a default site definition (~/sites-available.txt) with the keyword “MYWEBSITE” where the script replaces the domain name. It also relies on a default template (~/TEMPLATE/) for the site. For me, this just includes 3 folders – httpdocs, conf and logs.

Image Credit: Rosa Menkman