Websites in minutes
Just over a week ago, a good friend passed away. I wanted to do something special as a memorial for him, so I put together a website where his friends and family can post pictures and stories about him.
I run Drupal on my server, and (at that point) had four web sites up and running. I figured that building a new site for my friend, Mike, would be fairly simple.
First, I put a bid in on a domain name for the site. Not difficult, especially if you already have a relationship with a registrar. The name took about 36 hours to confirm, and by that time, I had a website all ready to go.
While I waited for the domain name, I set up a "cooker" website. That's a site (in my own, internal domain) that I use to "cook" production sites before releasing them. I already had a "cooker" domain set up internally ("cooker.my.lan"), and an Apache VHOST defined for it, so I reused this site rather than building a new one. The VHOST and internal domain name permit me to access the site from my lan, which allows me to configure and populate it without exposing it to the internet.
I created a "cooker" subdirectory in my drupal6 sites directory. The directory drupal6/sites/cooker.my.lan directory hosts the settings.php file for the cooker.my.lan VHOST, which I copied and modified from the drupal6/sites/default/settings.php file. Here, I altered the $base_url setting to name my internal website, and the $db_url to name the database connections that the site would need. While I would later change $base_url to match the external URL name for the production website, I gave the $db_url the "production" values for the database.
I couldn't use the site yet, though, as the database did not yet exist. With previous versions of Drupal, you had to both define and populate the initial database, but with Drupal 6, you only have to define it. So, I broke out the commandline tools, and I issued CREATE DATABASE and GRANT PRIVILEGES SQL with the mysql administration commands.
Next, to populate the database. This, we do from the web browser by pointing ourselves at (the now active) http://cooker.my.lan/install.php. Drupal initializes the databases, and collects some initial user and site information. The site is now "live", although it is still only accessible through my internal lan.
I spent several hours customizing the site, setting the theme, the features (both modules and blocks), and generally getting the site to look and act the way I wanted it to. By the time I was finished, I had a good looking site that only needed an internet domain to be complete.
And that didn't take too long to come about; I received notice that the domain name was mine early the next morning. Now comes some of the trickier parts, setting up external access.
First, I set up a live subdirectory in my drupal6 sites directory, copied the settings.php from the "cooker" site, and changed the $base_url to the external site name. I added a new VHOST to my Apache configuration, giving it a ServerName that matched the new domain name. A quick restart of Apache, and the webserver was ready to serve up the memorial site.
Next, I added the new domain to my /etc/mail/local-host-names file, and abuse@, postmaster@, and webmaster@ email addresses for the new domain to my /etc/mail/virtusertable, and ran "make" to enable the new email domain.
I set up the domain name with my DNS service, so that it resolved to the proper IP address. I added an MX record to the domain records so that I could resolve and handle email for the site. The site was now "live" to the internet, for both web and mail.
Finally, I took care of some minor Drupal configuration issues by setting the website's email responder to the previously defined webmaster@ email address, and setting up a cron job to initiate the website scheduler.
Elapsed time from inception to live: 36 hours.
Out of pocket expenses: $11
Memorial for a friend: priceless