Sub.domain now I know

November 28, 2007

Eventually have my subdomains setup correctly last night. Subdomain using namebased virtualhost is like an ordinary domain therefore the key is setting the DNS records right.

Say you want to have these sites and * running Habari at folder /var/www/habari running WordPress at folder /var/www/wp

You’ll need DNS setup below (in the case of Slicehost) (name) (data) A (type) (name) (data) NS (type) (name) ns2..... (data) NS (type) (name) ns1..... (data) NS (type)

www (name) (data) A (type) (name) (data) CNAME (type) (name) (data) CNAME (type)

One other setup which may also be key is to add (create if it’s not there) below lines to this file /etc/apache2/conf.d/virtual.conf.


# enable multiple virtual hosts


NameVirtualHost *

Also the first line #NameVirtualHost * in all site config files stored under /etc/apache2/sites-available should also be commented out.

Last night I also have Shorewall installed, transferred content from this site using WXR export to that WP test site. During import found that I have chmod 777 . folder /wp-content/ such that the uploads folder can be created by the import script.

May be my apache or mysql aren’t properly optimized yet as I found out from stat at SliceManager that CPU was running flat out. I did a soft reboot and it’s now back to normal. free -m gave me 88M used out of 256 which is weird as I remember seeing a lot more consumed last night.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: