Drupal is an open source Content Management Software (CMS). It is used to make websites and applications we use daily. Drupal comprises great features, like easy content authoring, reliable performance, and excellent security.
Below are the steps to install Drupal :
Before installation the following requirement should be met:
1.LAMP server ( view my previous post )
step 1 : Get drupal from drupal.org
- First of all,download drupal 8.2.3 from here.
- extract the file by using the following command
sudo tar -xvzf drupal-8.2.3.tar.gz
- copy the file to the following directory
sudo cp -r drupal.8.2.3 /var/www/html
step2 : Create database for drupal
- start MYSQL
mysql -u username -p
(*change username to your actual username for mysql-server)
- create database
CREATE DATABASE drupal;
- grant privileges
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON drupal.* TO 'username'@'localhost' IDENTIFIED BY 'PASSWORD';
- do the following to reload permissions on new database
step 3 : ONE more step before installation process begins
- set poper permissions to necessary folders inside drupal and the settings.php file must be present.
sudo mkdir /var/www/html/drupal-8.2.3/sites/default/files
sudo cp /var/www/html/drupal-8.2.3/sites/default/default.settings.php /var/www/html/drupal-8.2.3/sites/default/settings.php
sudo chmod 760 /var/www/html/drupal-8.2.3/sites/default/settings.php
sudo chmod 760 /var/www/html/drupal-8.2.3/sites/default/files
step 4 : Installing drupal
- Open http url for the local apache web session.In my case, it is http://127.0.0.1/drupal-8.2.3/
- this page should appear:
- You may face some errors on the next page, displaying requirements reviews. Make sure you meet all the requirements needed, specially, concerning the clean urls, before proceeding
Here are the steps i did to solve the clean urls requirements:
- Enable mod_rewrite for Apache. To test if mod_rewrite is available in Apache2:
- In the output, check to see if the
rewrite_moduleis included in the list of modules.
- If the rewrite module is not in the list, you can tell Apache to load the module by including:
- restart apache
- check apache status
systemctl status apache2
- The next step is to locate the appropriate Apache configuration file for your site.The appropriate Apache configuration file could be httpd.conf, a virtual-host-specific file (vhost.conf), a specific site file (e.g. “default”), or apache2.conf.
- use a text editor to modify the following content:
- search for the following :
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>
- change it into :
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>
- save and quit the apache2.conf. This should solve the clean URL requirements.
- Apache needs to be explicitly told to respect the instructions in your sites .htaccess file. This is off by default, though most hosts will have turned it on. That is what the
AllowOverride Alldirective above does – it makes .htaccess start working.
Refresh your browser.
You’re done. Drupal should now be running successfully on your browser.