Tuesday, August 18, 2009

Setting up Hardy Heron with Apache2 and multiple Domains

Finally cracked setting up multiple domains on my shiny new Ubuntu server. In case it helps anyone else out of a hold, here are my tips for easy domain management.

1. Use GoDaddy and their total DNS option (google for instructions) This means you don't have to worry about a name server. Just setup your domains and subdomains with an A record that points to your IP address. If your domain is currently pointing to a nameserver other than GoDaddy's change the nameserver option to Forwarding - wait a few mins, then you use Total DNS.


2. in /etc/apache2/site-available, create one file for each domain, I just used the domain name for the filename, eg. mydomain.com This should contain something like:



ServerName mydomain.com
ServerAlias www. mydomain.com
DocumentRoot /home/django/mydomain

...and all the other usual stuff ...




3. in /etc/apache2/sites-enabled create a dynamic link to the file you just created in sites-available. Ordering is import so add a sequence number to the beginning of the name. Ensure sub-domains come before main domain entry.

eg.

ln -s /etc/apache2/sites-available/blog.mydomain.com 010-blog.mydomain.com
ln -s /etc/apache2/sites-available/mydomain.com 011-mydomain.com


4. And this is what I had missed. Ensure there is a default file in your sites-available that includes this line:

NameVirtualHost *:80


That's all I have in mine. And have a dynamic link in sites-enabled so that DEFAULT IS RUN FIRST.

eg, ln -s /etc/apache2/sites-available/default 000-default

5. restart apache eg. /etc/init.d/apache2 restart

6. Cross fingers and enter domain in the browser.

If you are doing this all at once, it takes a while for the changes to propogate through from godaddy, so be patient.

Dead Cat Bounce


I'm not filled with optimism by the 'green shoots' spotted here and there. I think this is the dead cat bounce phase, or put even better in the Editorial of the FT this weekend "... unexploded ordinance still litters the financial landscape".

Have a nice day...


Travelled up to Dublin on the new intercity trains last week. The toilets have these huge curved doors that you open and close with a button. There is another large button to press once you are inside to lock it and when you do the door says "Thank you"!? Whatever next. Reminded of the doors and drinks machines in Hitch Hiker's Guide to the Galaxy... "Have a nice day!"

Catchup


Got out of the blogging habit with the long (wet) summer days so going to try and get going again with a number of small blogets. Items of note in the last months?

Christophe and Jérôme, two french wwoofers, have just left after a month that has transformed the farm. Everything is strimmed, the fencing is not only repaired but has handles to open on every field and a bank of switches from which I can turn each field on and off. (You probably have no idea how great this is!).

Great multicultural BBQ Polish, Irish, French, German, Brits and Americans. Great pics here: web4u.ie/phoebehouse/

Managed to make haylage after 7 weeks trying but never a gap of 3 dry days. Started raining as we were baling so not sure how good it's going to be.

Had a great Jumpstart with Fish Publishing and came up with a raft of new ideas on how to get more entries to their competitions.
Recession much in evidence, but life and showjumping go on...