One of the most popular free CMS with more travel is Drupal. In this tutorial we will see how to install Drupal in Ubuntu step by step.
According to some experts, Drupal is also one of the most difficult to learn CMS, since it is quite generic and can do almost everything. Perhaps something simpler would be the Joomla, with a somewhat similar philosophy.
If you are looking for an excellent hosting provider for drupal we recommend SiteGround.
We will start by opening the Ubuntu virtual machine that we created in a previous tutorial: how to install Ubuntu in a VirtualBox virtual machine . In this tutorial we started with an Ubuntu system with Apache, PHP and MySQL installed.
Check the tutorial how to install and configure Apache, PHP and MySQL in Ubuntu if you have not already done so. By the way, you can consult our tutorial entitled what is PHP to make a contact with that language.
The first thing we are going to do when starting the operating system is to open a terminal with the key combination Ctrl + Alt + T. Once we are inside we will create the database that will hold the necessary data to use Drupal.
Installing the database
For this we are going to connect to the database through the mysql client:
mysql -u root -p
Next we will create the database with the following statement (you can call it with the name you want):
CREATE DATABASE drupal;
Now we will create a user (with a password) that will be called drup to connect to the database from the Drupal CMS:
CREATE USER drup @ localhost IDENTIFIED BY 'drup1234';
Next we will give privileges to that user for the objects in the drupal database:
GRANT ALL PRIVILEGES ON drupal. * TO drup @ localhost;
To consolidate these permits we must record them with the following command:
Once these actions are done, we will write exit to exit the mysql client.
Next we will go to the official website of Drupal to download and install Drupal in its latest version 8 .
To do it directly we will go to our main user directory in the Linux terminal by typing the cd statement and download the latest available version with the wget statement:
We will unpack it using the tar command:
tar zxvf drupal-8.0.5.tar.gz
Once this process is finished, we will delete the drupal-8.0.5.tar.gz file to free up disk space.
We will have it available in the following directory:
cd ~ / drupal-8.0.5
Once the file is unpacked, we will have to copy all that drupal-8.0.5 directory to the directory where we have the html files that the Apache web server uses.
In our case we will create a blog directory just below html .
In this way if we want to design and publish a web later, we would access the blog under the context / blog .
If instead we want our website to be only the Drupal CMS engine, then we could locate the drupal files right inside html :
sudo mkdir / var / www / html / blog
sudo cp -rp ~ / drupal-8.0.5 / * / var / www / html / blog /
The sudo will ask you to enter the user password.
Now we must change the owner of the files to be www-data, which is the user that Apache habitually uses.
sudo chown -R www-data: www-data / var / www / html / *
Now we will continue the installation from the web browser.
Installing the Drupal CMS
For this we will enter the browser specifying our IP address (or localhost) and access the Drupal installation screen.
http: // localhost / blog
In the Drupal installation screen, we will select the "Spanish" language and click on the "Save and c ontinue " button.
Then we will have to enter the installation profile.
We will select Standard and then click on the " Save and continue " button.
In the next screen we will see a revision of the requirements necessary to install it. We can click on " continue anyway " or enable the recommendations described. In our case we had to correct the issue of " clean URLs ".
To configure it now, we will have to make sure that Apache has the " rewrite " module enabled. If you do not have it, we can activate it and restart it with:
sudo a2enmod rewrite
restart sudo service apache2 restart
In the same way it will be necessary to have " AllowOverride " configured in the virtualhost of the configuration file of the site, to edit it with the VI we will do:
sudo vi /etc/apache2/sites-enabled/000-default.conf
Note : Add the part in bold. <virtualhost> ServerAdmin webmaster @ localhost DocumentRoot / var / www / html / <strong> <Directory / var / www / html / blog> AllowOverride All
We will also need to have the file .htaccess in the root of / var / www / html / blog , for that we will copy this file from the Drupal download folder, if we do not have it already copied.
sudo cp /home/carlos/drupal-8.0.5/.htaccess / var / www / html / blog /
In the next screen we will show the database configuration " drupal " to enter in the administration panel, so we will have to introduce the user " drup " and the password " drup1234 " that we have previously created. Then click on the " Save and continue " button.
Once done we will see a progress bar that will indicate the percentage of installation completed Drupal .
Then the translations will be updated as well.
Finally we will see the screen to configure site .
We will see that we will have to specify the name of the website, and an email for notifications.
As well as an administrator account, with your password and mail.
Finally we must specify the country and the time zone.
Click on the "Save and continue" button.
With that we will get to the Drupal administration screen where we will offer an example entry.
The "philosophy" of Drupal is a little different from the rest of CMS as wordpress.
In the administration screen we will see that we can create contents (pages, nodes), define data structures, define the appearance, configure users, roles and permissions, and generate reports, among other things.
So here comes this little tutorial to install and configure Drupal in Ubuntu.