Setup and configure Drupal 6 in Slackware Linux tutorial

This is a basic guide on how to setup and configure Drupal 6 in Slackware Linux. Many beginner webmaster out there still haven't heard of Drupal.Here is a little information. Drupal is an open source Content Management System like Joomla. It has been awarded The best open source content management system (CMS) for a couple of years already. The official Drupal website is drupal.org. You can read more about drupal in the Drupal founder's personal website, Dries Buytaert - Personal website and see for yourself who's using Drupal.

Basically, we need to setup web server, Mysql and PHP in Slackware before begin setting up Drupal. When you got all those servers running then it's time to begin the Drupal installation. See user guides below on how to setup and configure Drupal in Slackware Linux:

Get latest Drupal 6 released

Download latest Drupal 6 released from official drupal website. You can also using wget command from Linux command line terminal to download Drupal package. See example below:

root@slackware:~# wget http://ftp.drupal.org/files/projects/drupal-6.13.tar.gz
--2009-07-06 03:57:04-- http://ftp.drupal.org/files/projects/drupal-6.13.tar.gz
Resolving ftp.drupal.org... 64.50.238.52
Connecting to ftp.drupal.org|64.50.238.52|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1080373 (1.0M) [application/x-gzip]
Saving to: `drupal-6.13.tar.gz'

100%[======================================>] 1,080,373 113K/s in 12s

2009-07-06 03:57:16 (91.2 KB/s) - `drupal-6.13.tar.gz' saved [1080373/1080373]

root@slackware:~#

Change directory to the Slackware web server directory. The default location is /var/www/htdocs. See example below:

root@slackware:~# cd /var/www/htdocs/

Extract Drupal 6 package here.

root@slackware:/var/www/htdocs# tar zxvf /root/drupal-6.13.tar.gz
drupal-6.13/
drupal-6.13/includes/
drupal-6.13/includes/actions.inc
drupal-6.13/includes/batch.inc
drupal-6.13/includes/bootstrap.inc
drupal-6.13/includes/cache-install.inc
drupal-6.13/includes/cache.inc
...
...
...

If Drupal package has been extracted without any error, then we can rename the extracted directory as the website name. See an example below:

root@slackware:/var/www/htdocs# mv drupal-6.13/ testdrupal

Rename /testdrupal/sites/default/default.settings.php as /testdrupal/sites/default/settings.php. Give all permission to settings.php file. See command example below:

root@slackware:/var/www/htdocs/testdrupal# mv sites/default/default.settings.php sites/default/settings.php
root@slackware:/var/www/htdocs/testdrupal# chmod 777 sites/default/settings.php

Create a new directory named files in sites/default directory. Give permission to all. See example step below:

root@slackware:/var/www/htdocs/testdrupal# mkdir sites/default/files
root@slackware:/var/www/htdocs/testdrupal# chmod -R 777 sites/default/files/

Create database for the new drupal cms

We already installed Mysql and now it's time to create a database for Drupal cms. Login into mysql and create a new database with privilege user. You can also use Phpmyadmin if you have it in your Slackware. See step by step example below:

Create a new database for the drupal website:

root@slackware:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 63
Server version: 5.0.67-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE drupal;
Query OK, 1 row affected (0.00 sec)

mysql>

Create a new Mysql user:

mysql> CREATE USER 'drupal'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

Give the new user privilege for the drupal database and run flush privileges command. See example below:

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON drupal.* TO 'drupal'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

Edit Apache httpd server configuration file

Open /etc/httpd/httpd.conf file using text editor. Change AllowOverride None to AllowOverride All enable Drupal clean-url.

<Directory "/srv/httpd/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
#AllowOverride None
AllowOverride All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

Add the following lines to the httpd.conf file:


RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Restart httpd service:

root@slackware:/etc/httpd# /etc/rc.d/rc.httpd restart

Drupal 6 installation and configuration

Open Mozilla Firefox and type drupal website url.

Install drupal - Choose language

Choose installation language that you prefer.

Drupal installation screenshot image

Install drupal - Verify requirements

We already created a file named settings.php and a new directory named files in /sites/default/ directory. There should be no problem here.

Install drupal - Database configuration

Enter Database name, Database username and Database password for drupal 6. Click 'Save and continue' when you are done.

Drupal database configuration screenshot image

Error:

Fatal error: Trying to clone an uncloneable object of class mysqli in /var/www/htdocs/linuxbasicconfig/includes/install.mysqli.inc on line 36

To fix this, set "zend.ze1_compatibility_mode = off" in Apache's php.ini file.

root@slackware:~# vim /etc/httpd/php.ini

Apache php.ini configuration screenshot image

Refresh or reload the page.

Install site

When you are done, please change the permission of 'settings.php' file back to the way it was.

All necessary changes to ./sites/default and ./sites/default/settings.php have been made,
so you should remove write permissions to them now in order to avoid security risks.
If you are unsure how to do so, please consult the on-line handbook.

That's all. Good luck!

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.