Tinyan would like to create a new blog for her travel experiences, so i take the chance to install Drupal in the server and let her try it and i can also take a look on this very popular CMS.
1. Follow the System Requirement and make sure everything works fine. Those pre-requisites are
- Apache / IIS
- PHP
- MySQL / Postgresql
2. Download the installation package from the Drupal Official Website. The version which i am going to install is 6.14.
3. Get the root privilege. Extract the .gz to /var/www/druapl
- tar -xzf ./drupal-6.14.tar.gz
- cp -r ./drupal-6.14 /var/www/drupal
4. Create a new database for Drupal. Since i use MySQL as the database server, i just create it through the phpmyadmin which is much more convenient compared with typing commands. but if you do not have phpmyadmin, just make it in the console. (Postgresql user can refer to the Drupal Documentation)
Login as root
mysql -u root -p
Create a new MySQL user for the Drupal to connect to the database (Keep the single quotes)
CREATE USER <drupal_user> IDENTIFIED BY ‘<password>’;
Create a database called Drupal (Has to be UTF-8 (Unicode) encoding)
CREATE DATABASE Drupal CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;
Grant the privileges
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON Drupal.* TO ‘<drupal_user>’@’localhost’ IDENTIFIED BY ‘<password>’;
Update privilege
FLUSH PRIVILEGES;
5. Go to /var/www/drupal/sites/default and copy default.settings.php to settings.php. Also grant the write privilege
- chmod 666 sites/default/settings.php
6. Edit the $db_url and $base_url in settings.php
- $db_url = ‘mysql://<drupal_user>:<password>@localhost/Drupal’;
- $base_url = ‘http://<host_domain>/drupal’;
7. Create the folder ~/sites/default/file.
8. Change the owner of the drupal folder and its files to www-data.
- chown -R www-data:www-data drupal
9. Browse http://<host_domain>/drupal/install.php. Oops, there are so many warning messages.

10. If you find the above warning messages, check the php.ini and make sure the include path is starting with [.:]. Restart the Apache afterwards.

11. Browse the installation link again and now you can start the installation.
12. After the installation, change the file permission of the settings.php to read only
- chmod 444 sites/default/settings.php
Your Drupal installation is Done =)
