10 Minutes To An Elegant Web Site Setup

Here is the step by step process to get a properly configured Drupal with Linux web server configured and running a basic web site in 10 minutes. The assumption is that the installer is proficient with both the Drupal development platform and Linux operating system.
- Server: LAMP (Linux, Apache HTTP, MySQL, and Perl/PHP/Pytthon)
- SSH (telnet) Client: ssh (PuTTY if you are using Windows to access your LAMP host)
- Must have root access to your server.
If website in question is an addon domain, i.e., addon.example.com, then substitute "addon" for "www" in steps below.
Here we go:
[login via ssh / PuTTY]
Debian and offshoot distributions (e.g. Ubuntu) make installation and configuration very easy. This was done on a Debian distribution, Ubuntu should work identically.
Installation
Assumption: apache2 and mysql are already installed. If not, use apt-get install to install and configure them.
# apt-get install drupal6
Answer the questions. This will install everything necessary to run drupal and do the basic configuration, including creating an empty database for drupal.
- Configure database for drupal6 with dbconfig-common? [YES]
- Database type to be used by drupal6: [mysql]
- Password of your database's administrative user: [enter mysql root password]
- MySQL application password for drupal6: [create a password for your drupal6 db]
- (enter the password again for verification)
You now have a basic unconfigured Drupal6 installation using the database drupal6 and accessible at http://www.example.com/drupal6. Do not use it. This is the "prototype" installation that we will use to create the sites we really want to use.
Create Site Databases
The easiest way to create databases for your sites is to use dpkg-reconfigure and answer the questions.
# dpkg-reconfigure drupal6
- Re-install database for drupal6? [YES]
- Database type to be used by drupal6: [mysql]
- Connection method for MySQL database of drupal6: [unix socket]
- Name of your database's administrative user: [root]
- Password of your database's administrative user: [enter mysql root password]
- username for drupal6: [ENTER YOUR DB SITE *USERNAME* HERE (e.g. mysite)]
- database name for drupal6: [ENTER YOUR DB *SITE* NAME HERE (e.g. mysite)]
Notes:
- Repeat the above for each site you want to support.
- I use the same name for the database and the site. KISS.
- Don't use periods (e.g. mysite.com is a bad choice). If you want to spell out the whole name, use underscores instead of periods (e.g. mysite_com).
- The above method ends up using the same site database password for all the sites you create. Advice: use mysql-admin (or mysql) to use different passwords for each site.
Configure Apache2 for Sites
Before you jump to configure your virtual hosts do not forget to add host names in /etc/hosts file.
your.ip.add.res vritualhost_1.name
your.2.ip.add.res virtualhost_2.name
Apache2 needs to be configured to support vhost access to your new sites.
Create vhost site configuration files in /etc/apache2/sites-available/
#
# Virtual hosting configuration for Drupal
#
<VirtualHost *:80>
ServerAdmin [your email address]
DocumentRoot /usr/share/drupal6/
ServerName [your vhost#1 name]
ServerAlias [if you want to support www.example.com and example.com]
RewriteEngine On
RewriteOptions inherit
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [your email address]
DocumentRoot /usr/share/drupal6/
ServerName [your vhost#2 name]
ServerAlias [if you want to support www.example1.com and example1.com]
RewriteEngine On
RewriteOptions inherit
</VirtualHost>
[...repeat for all your vhosts]
Notes:
- Modify the above items that are in [square brackets].
- You likely will want to support port 443 (https) as well. See Apache documentation for detailed instructions.
- I've chosen to put all the vhosts in one file named drupal. You may want to use one file per vhost.
Sym-link the drupal file in the sites-enabled directory to enable it in your site:
# cd /etc/apache2/sites-enabled
# ln -s ../sites-available/drupal .
...and reload Apache2 to pick up your configuration changes...
# /etc/init.d/apache2 reload
Create Drupal Site Configurations
We need to create Drupal configurations for each site by copying the default configuration to the Drupal site subdirectory.
# cd /etc/drupal/6/sites/
# cp -a default [site1.com]
# cp -a default [site2.com]
...and edit the configurations to use the right database, MySQL user name, and password...
# vi site1.com/dbconfig.php
# vi site2.com/dbconfig.php
Notes:
Modify the above items that are in [square brackets].
Run Drupal and Configure Your Sites
Browse to your sites, running install.php (e.g. http://www.example.com/install.php) to configure them.
You are done!
Please request a FREE website analysis by providing us with your information HERE:
- gearylewis's blog
- Login to post comments

