Installing Drupal 7 on centOS 6.3



Drupal is a free and open-source content management system written in PHP and distributed under the terms of the GNU GPL. It is used for personal blogging, data storage, knowledge management, political and business sites.

This guide is about installing and configuring Drupal 7 on centOS 6.3.


Requirements (before starting the steps):
- Install LAMP (Linux Apache MySQL PHP) by following the steps found in this link.
- Install the REMI repository by following step 2 in this link, alternatively if you want to install phpMyAdmin, you can do so by following the steps on the said link, but it is not required for this guide.

 Once the aforementioned requirements are installed you may now proceed with this guide.

1. On your terminal, log in as admin / root, by typing su.

2. Type cd /var/www/html/ to go to the apache directory.

3. Download the Drupal 7 package by typing this command wget http://ftp.drupal.org/files/projects/drupal-7.0.tar.gz

4. Create a folder for drupal by typing mkdir drupal

5. Extract the contents of your drupal 7 package by typing tar xzf drupal-7.0.tar.gz

6. Move the contents of drupal-7.0 to the drupal directory (for simplicity's sake later on), by typing mv drupal-7.0/* drupal


7. Remove the drupal-7.0 directory and the drupal package by typing rm -fr drupal-7.0 drupal-7.0.tar.gz (optional, but you can do this, so that your apache folder won't be messy later on).



8. Now let us start with the installation proper, first go the /sites/default directory by typing cd /var/www/html/drupal/sites/default/


9. Duplicate the file named 'default.settings.php' to 'settings.php' by typing cp -p default.settings.php settings.php (because drupal requires a file called settings.php.. by default - settings.php is named default.settings.php, thus we have to duplicate and rename it to settings.php -- at the same time not deleting default.settings.php -- in case your drupal cms would go nuts in the future).




10. Update the permissions (read/write) of the directory /var/www/html/drupal/sites/ by typing the command chcon -R -t httpd_sys_content_rw_t /var/www/html/drupal/sites/ 


11. Also update the permissions of the apache directory by typing the command chown -R apache.apache /var/www/html


12. Create the drupal database in mysql by typing mysql and typing create database drupal;



13. Go to your browser and access Drupal 7 by typing localhost/drupal/ the screen below will appear. In this selection I'm choosing standard (it's your decision what you'd pick :D), then click on Save and continue (until you reach the Verify requirements part).


14. If you encounter this error - do the following steps:


a. Go to your terminal and type yum --enablerepo=remi install php-xml

b. Restart your apache server by typing service httpd restart

c. Go back to your browser and hit refresh, this screen should appear:


15. Fill up the Database name text box with whatever database name you have assigned for drupal in step 12 (in our case it should be drupal). Also input your root username and password. Click on the Save on continue button to proceed.


16. Fill up the text fields in the Configure site part and press save and continue.

17. If you reach this screen, you have successfully installed Drupal for CentOS 6!