I was trying to install drupal on my machine, being jobless for one month and things left to be done it was necessary for me to do some freelance jobs and the only one left for me was the one related to drupal. Buts it was out of the question to use windows for the sake of easiness. Anyway I decided to configure Drupal on my Slackware machine.
As everyone out there I also referred drupal site for installation steps, and it was like the following
Step 1: Download and uncompress Drupal
Step 2: Create the database
Step 3: The settings.php file
Step 4: Run the installation script
So I got the latest drupal-7.14.tar.gz file from the Drupal site. And uncompressed it to the /var/www/ directory.
$ wget http://ftp.drupal.org/files/projects/drupal-7.14.tar.gz $ tar -xzvf drupal-7.14.tar.gz
then I moved the uncompressed drupal directory to the directory /var/www/
# mv drupal-7.14/ /var/www/ # mv /var/www/drupal-7.14/ /var/www/test/
And thus I completed my first step and the second step was the creation of a database. The steps are given below.
bash-4.1# mysql -u root -p; Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.1.56 Source distribution Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE drupal; Query OK, 1 row affected (0.03 sec) mysql> CREATE USER 'drupal'@'localhost' IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.00 sec) 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)
Please check if your MySQl is configured correctly, if you are getting any error. For any help you can follow this link “LAMP on Slackware”
So the second step was done.
In the third step I had to create a ‘settings.php’ file from the default.settings.php and assigning the correct permissions.
root@aaron:/var/www/htdocs/test# mv sites/default/default.settings.php sites/default/settings.php root@aaron:/var/www/htdocs/test# chmod 777 sites/default/settings.php
In the fourth step I pointed the browser to http://localhost/test/ but what I got was a 404 message.
I couldn’t get the reason at first but then understood that this happened because in slackware the web root is at /var/www/htdocs/ instead of /var/www/. So I copied the ‘test’ directory to the /var/www/htdocs/ and then pointed the browser to http://localhost/test, but instead of showing the installation page it just showed me the directory contents.
So I checked my LAMP configuration and found that php wasn’t enabled in the /etc/httpd/httpd.config file. After configuring it correctly (here is the link for configuring the LAMP in Slackware LAMP on Slackware)and pointing the browser to “http://localhost/test/”, which led me to the installation page.
Then everything went as given in the drupal site, So in short follow the below steps for successful installation of Drupal on localhost.
- Check the LAMP installation, refer the following link for help “LAMP on Slackware”, (this one is an awesome tutorial for lamp configuration).
- Read the instructions in the drupal site properly.
- Get the drupal package from the drupal site.
- Uncompress it to /var/www/htdocs/ with any name you like to refer.
- Create a database and a database user with the full permission to the created database.
- Create a ‘settings.php’ file from ‘default.settings.php’ in the website root directory.
- Run the installation script by pointing the browser to the drupal directory, for example: http://localhost/test/ if you have uncompressed the drupal compressed package to the /var/www/htdocs/ by the name ‘test’.
- Do whatever you want to do with your new drupal site !!!
Happy slacking buddies 🙂