Skip navigation.
Home
Openness protects your investment.

Creating a couple of drupal sites.

Drupal

Starting looking at installing Drupal for use as Whitemice.Org and WhitemiceConsulting.Com. So far it looks very good. I've installed Drupal 4.6.2 on CentOS with PostgreSQL and Apache 2.0. For evaluation I surveyed both x-oops and drupal - drupal one merely by the fact that it had documentation. X-oops claimed to have documentation but all the links on the site to said documentation were broken.

To prepare the CentOS instance (in VMware for testing), after install I only had to do the following -
rpm --install /media/cdrom/CentOS/RPMS/php-gd-4.3.9-3.6.i386.rpm /media/cdrom/CentOS/RPMS/php-xmlrpc-4.3.9-3.6.i386.rpm /media/cdrom/CentOS/RPMS/php-imap-4.3.9-3.6.i386.rpm (from disc #4).
chkconfig cups off
chkconfig sendmail off
chkconfig xinetd off
chkconfig nfslock off
chkconfig portmap off
chkconfig httpd on
chkconfig postgresql on
reboot

Setting up drupal was equally as easy..
cd /tmp
mkdir /var/www/html/whitemiceconsulting.com
mkdir /var/www/html/whitemice.org
tar -zxvf /tmp/drupal-4.6.2.tar.gz
cp -R drupal-4.6.2/* drupal-4.6.2/.htaccess /var/www/html/whitemiceconsulting.com
cp -R drupal-4.6.2/* drupal-4.6.2/.htaccess /var/www/html/whitemice.org
su - postgres
createuser --pwprompt
Enter name of user to add: drupal
Enter password for new user:
Enter it again:
Shall the new user be allowed to create databases? (y/n) n
Shall the new user be allowed to create more new users? (y/n) n
postgres$ createdb -O drupal com
postgres$ createdb -O drupal org
postgres$ createlang plpgsql com
postgres$ createlang plpgsql org

**EDIT pghba.conf
+host org drupal 127.0.0.1 255.255.255.255 password
+host com drupal 127.0.0.1 255.255.255.255 password
**
**EDIT postgresql.con
tcpip_socket = true
superuser_reserved_connections = 2
port = 5432
virtual_host = 'localhost'
shared_buffers = 1024
**
pg_ctl reload
postgres$ psql -W -h localhost -U drupal -d org -f /tmp/drupal-4.6.2/database/database.pgsql
postgres$ psql -W -h localhost -U drupal -d com -f /tmp/drupal-4.6.2/database/database.pgsql
exit

# We are now back as the root use
#EDIT /var/www/html/whitemice.org/sites/default/settings.php
#db_url = 'pgsql://drupal:************@localhost/org';
#base_url = "http://www.whitemice.org";
#EDIT /var/www/html/whitemiceconsulting.com/sites/default/settings.php
#db_url = 'pgsql://drupal:************@localhost/com';
#base_url = "http://www.whitemiceconsulting.com";
#CREATE FILES DIRECTORY
mkdir /var/drupal
mkdir /var/drupal/com
mkdir /var/drupal/org
chown apache.apache /var/drupal
chmod 770 /var/drupal
chown apache.apache /var/drupal/com
chmod 770 /var/drupal/com
chown apache.apache /var/drupal/org
chmod 770 /var/drupal/org

The only troublesome part was configuring the virtual hosts. The last time I used a RedHat based server for a webserver was back on RH9. After trying out FC1 and FC2 on my workstation/laptop I'd never dream of using them on a production server. While I'm sad to say that the server configuration tools provided on CentOS (a RHEL derivative) are just as lousy what I remember from RH9. Setting up a virtual host resulted in warning when restarting the HTTP service and each edit made the httpd.conf file bigger by inserting large amounts of useless whitespace - including at the very beginning of the file. Yast is far and away a superior tool and RedHat still needs to learn the power and elegance of include files.

But if you have name based virtual hosting enabled all you need is -

# Virtual host Whitemice.Org
<VirtualHost *:80>
  DocumentRoot /var/www/html/whitemice.org
  ServerAdmin webmaster@whitemice.org
  ServerName www.whitemice.org
  DirectoryIndex index.php index.html index.htm index.shtml
  <Directory /var/www/html/whitemice.org>
    AllowOverride All
  </Directory>
</VirtualHost>


# Virtual host Whitemice Consulting
<VirtualHost *:80>
  DocumentRoot /var/www/html/whitemiceconsulting.com
  ServerAdmin webmaster@whitemiceconsulting.com
  ServerName www.whitemiceconsulting.com
  DirectoryIndex index.php index.html index.htm index.shtml
  <Directory /var/www/html/whitemiceconsulting.com>
    AllowOverride All
  </Directory>
</VirtualHost>

We will deal with adding SSL later. The "AllowOveride All" is required because drupal sets its neccesary PHP directives in an ".htaccess" file. This file, for these sites, contains the following...
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc 0
  php_value register_globals 0
  php_value session.auto_start 0
  php_value upload_max_filesize 8M
  php_value upload_tmp_dir /var/drupal
</IfModule>

... the first three are default, the last two we added - otherwise you need to change the PHP configuraion for the whole machine which is generally a bad idea for boxes hosting more than one site.

Restarting apache ("service httpd restart") should now proceeded with only a single innocuous warning. And once the two names were entered into /etc/hosts to point at the virtual machine I could load the initialization pages for both whitemice.org and whitemiceconsulting.com.

Very nice, and all done without a single Google. Especially since I am doing this while sitting on a porch overlooking lake Huron completely devoid of any Internet access.