Drupal is an open-source content management system (CMS), written in PHP and released under GPL. It was first released in January 2001 to power personal blogs, corporations websites and any kind of websites that people may need. Today, Drupal is one of the most famous CMS in the world running millions of websites worldwide.
- Free and open-sourced.
- Basic features like the ability to publish posts, pages, and a comment system, RSS feed, users registration. install and modify templates & add-ons.
- More than 30000 available modules to download for free from the Drupal store.
- Available in more than 110 languages with support for RTL languages like Arabic.
- Multi-site support and Multi-user content editing and creation support.
- Support for creating blogs, forums, polls using modules that are installed by default.
- Customized Drupal releases called “Distributions”, like Linux distributions, Drupal distributions are a pre-configured Drupal installations for specific kind of websites, they have some pre-installed modules and templates as well.
- Very-well updates system to notify you about security updates.
- Many other features.
This article will guide you to install the latest version of Drupal 7.31 on Debian/Ubuntu Server.
Step 1: Install Apache, PHP and MySQL
1. To install Drupal, you will require a running web-server and a database server, in this article we will work with Apache2, PHP5 and MySQL, you can install them easily with the help of package manager tool called apt.
$ sudo apt-get install apache2 php5 php5-mysql mysql-client mysql-server
2. During package installation, it will ask you about the password for the MySQL root user. Enter the new password for MySQL root user.
Retype the password again.
That’s it, you’ve successfully installed all the required packages and also added MySQL password. Now it’s time to move forward and create database for drupal installation.
Step 2: Create Drupal Database
3. We’ll need to create a database for our Drupal installation, to do so, run the following command to connect to the mysql shell.
$ mysql -u root -p
Note: It will ask you to enter the MySQL root password, that you’ve entered while installing MySQL package, enter it and you will be prompted to the mysql terminal.
4. Next, run the following series of commands on the MySQL terminal to create new ‘drupal‘ user, database and grant privileges.
## Creating New User for Drupal Database ## CREATE USER drupal@localhost IDENTIFIED BY "your_password_here"; ## Create New Database ## create database drupal; ## Grant Privileges to Database ## GRANT ALL ON drupal.* TO drupal@localhost; ## FLUSH privileges ## FLUSH PRIVILEGES; ## Exit ## exit
Note: If you want, you can replace user name and database name with any other name.
Step 3: Download and Install Drupal 7.31
5. Drupal is available to download from the official Ubuntu/Debian repository as a package, however it is an old version from Drupal which has many security vulnerabilities (at the time of writing this article, it is 7.26, and the current Drupal version is 7.31), that’s why we will be downloading Drupal from the official website.
At the time of writing this article, the latest version from Drupal is 7.31 which we’ll be working with here, but you may check for the latest version from the link provided below.
6. Alternatively, you may use the following ‘wget‘ command to grab the latest version directly.
$ wget http://ftp.drupal.org/files/projects/drupal-7.31.tar.gz
7. Replace 7.31 with the latest version number, if it was different, now let’s extract the file and take it away to /var/www/html/ (which is the default root folder for apache2 after installation) inside the Drupal folder.
$ tar -xf drupal-7.31.tar.gz $ sudo mkdir -p /var/www/html/drupal $ sudo cp -R drupal-7.31/* /var/www/html/drupal
8. Now all, what you have to do is to, open your browser and go the any of following links to begin installation.
http://yourdomain.com/drupal OR http://your-ip-address/drupal
9. Now in the requirements page you will see many error messages like missing packages, missing configuration and permission issues.
10. To fix these above errors, run the following commands.
$ sudo apt-get install php5-gd $ sudo service apache2 restart $ sudo mkdir -p /var/www/html/drupal/sites/default/files $ sudo chmod 777 /var/www/html/drupal/sites/default/files $ sudo cp -R /var/www/html/drupal/sites/default/default.settings.php /var/www/html/drupal/sites/default/settings.php $ sudo chmod 777 /var/www/html/drupal/sites/default/settings.php
Once you done with the above commands, refresh the page in the browser.. and you will be able to continue to the next step.
11. In the Database configuration, enter the database name “drupal”, the username “drupal” and the password you’ve set in the step #4 above, and continue.
12. In the Configure site section, you will be asked to configure your website information, like site name, email address, username and password, fill those boxes as you want.
13. After installation finishes, don’t forget to change the permissions of configuration files to avoid security risks if any.
$ sudo chmod -R 755 /var/www/html/drupal/sites/default/ $ sudo chmod 755 /var/www/html/drupal/sites/default/files
That’s it your installation is ready to use.
Now go to any of following links and your website will be there.
http://yourdomain.com/drupal OR http://your-ip-address/drupal
Step 4: Configure Drupal
Drupal is a very configurable CMS, you may check those settings pages that you see at the top bar to change the settings you need.
If you want to install templates, head to following link and download the template you want, extract it to /var/www/html/drupal/themes/, where all themes are stored, and go to the “Appearance” tab to change the default theme.
If you want to install modules, head to following link and download the modules you need, extract them to /var/www/html/drupal/modules/, where all modules are stored, and head to the “Modules” tab in order to install the new modules and configure them.
For further documentation, you may visit the official docs that are provided by the Drupal project at.
Have you ever installed Drupal before? What do you think about it comparing it to other CMS’s like WordPress and Joomla? Please give your feedbacks at our comment section below.