Create a subdomain (Apache2)

Let’s say you have a domain and you want to add a subdomain Here’s how to do it.

Create an apache config file:

touch /etc/apache2/site-available/
viĀ /etc/apache2/site-available/

Insert this configuration:

<VirtualHost *:80>
	ServerAdmin webmaster@localhost

	DocumentRoot /var/www/
	<Directory />
		Options FollowSymLinks
		AllowOverride All

	ErrorLog ${APACHE_LOG_DIR}/error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog ${APACHE_LOG_DIR}/access.log combined

Enable the new config


Put all files under /var/www/ and done!

P/S : To remove a subdomain, run :



Linux Screen Tutorial

Screen is a Linux tool to run multiple virtual terminal from a command line. It is useful when you need to run long processes and you need to close your SSH client. Screen is really life saver.


Start a new Screen

$ screen


Detach from Screen (left screen running in background)

$ ctrl a d


View running virtual terminal in background

$ screen -ls
There are screens on:
5311.pts-0.langkawi (08/23/2013 05:27:39 PM) (Detached)
5253.pts-0.langkawi (08/23/2013 05:27:09 PM) (Detached)
2 Sockets in /var/run/screen/S-ubuntu.


Resume existing Screen

$ screen -r 5253.pts-0.langkawi


To exit or close Screen, go inside the Screen and type exit or press ctrl a k.

$ exit


$ ctrl a k