Drupal, a free and open source content-management framework written in PHP and distributed under the GNU General Public License.
In this tutorial, I will show you how to install Drupal 8.2.6 on Ubuntu 16.04 LTS Xenial Xerus with LEMP Stack (Linux, Nginx, MariaDB and PHP7). I assume that you have already set up a LEMP stack on Ubuntu 16.04. If not so, click the link below to check out how to install LEMP Stack on Ubuntu 16.04.
Install Nginx, MariaDB and PHP7 (LEMP Stack) on Ubuntu 16.04 LTS
Step 1. Download Drupal
First, upgrade all your system software to the latest version available in your software repository using the following command:
# sudo apt update && sudo apt upgrade
– Download Drupal from the official website using the following commands
# cd /tmp # wget https://ftp.drupal.org/files/projects/drupal-8.2.6.tar.gz # tar -xzvf drupal-8.2.6.tar.gz
– Create the web root directory of your site and move the drupal files to it
# mkdir -p /var/www/yallalabs.com/html # mv drupal-8.2.6/* /var/www/yallalabs.com/html
– Set the correct files/directories ownership:
# chown www-data: -R /var/www/yallalabs.com
Step 2. Create a database for the Drupal installation
– Connect to Mysql Server and use the following commands to create a databse and user for the drupal installation
# mysql -u root -p mysql> create database YOUR_DB_NAME; mysql> grant all privileges on YOUR_DB_NAME.* to YOUR_USER_NAME@localhost identified by 'YOUR_PASSWORD'; mysql> flush privileges; mysql> exit Bye
Step 3. Create a virtual block in Nginx
– Create a virtual block in Nginx so you can access Drupal with your domain. Replace the domain_ name with your real domain :
# vi /etc/nginx/sites-available/domain_ name.com.conf server { server_name domain_ name.com; access_log /var/log/nginx/domain_name.com-access.log; error_log /var/log/nginx/domain_name.com-error.log; root /var/www/domain_name.com/html/; location / { index index.php; try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }
– Enable your domain by creating a symlink of the configuration file under the site_enabled directory using the following command:
# ln -s /etc/nginx/sites-available/domain_ name.com.conf /etc/nginx/sites-enabled/
– Test the Nginx configuration using the following command:
# nginx -t
– If everything is successful, reload Nginx so the changes can take effect using the following command:
# systemctl reload nginx
– Now open your web browser and navigate to http://your_domain.com to finish the Drupal installation
We hope this tutorial was enough Helpful. If you need more information, or have any questions, just comment below and we will be glad to assist you!
PS. If you like this post please share it with your friends on the social networks using the buttons below.Thanks.