Skip to main content

Secure nginx with Let's Encrypt on Ubuntu 18.04

how to install and configure drupal on ubuntu

Drupal is an opensource content management system that allows anyone to build amazing websites. It’s free and has a community of dedicated supporters building cool tools to enhance it. Drupal is a free and open source content-management framework written in PHP and distributed under the GNU General Public License. Drupal runs on any computing platform that supports both a Web server capable of running PHP and a database to store content and configuration.


Uptate the ubuntu packages.
#apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove


Install apache2 services and enable
# apt-get install apache2
# systemctl start apache2.service
# systemctl enable apache2.service


Install Mysql service and configure database.
# apt-get -y install mysql-server mysql-client
# systemctl start mysql.service
# systemctl enable mysql.service


Run the commands below to secure MySQL server.
# mysql_secure_installation


Login to mysql and configure database :
# mysql -u root -p


root@ip-10-0-1-59:/home/ubuntu# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.21-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE drupal;
Query OK, 1 row affected (0.00 sec)


mysql> CREATE USER drupaluser@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL ON drupal.* TO drupaluser@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> exit;
Bye



Install Php and other modules :

# apt-get install php libapache2-mod-php php-mysql php-xml php-mysql php-curl php-gd php-imagick php-imap php-mcrypt php-recode php-tidy php-xmlrpc


Download latest drupal content :
# cd /tmp && wget ftp.drupal.org/files/projects/drupal-8.3.5.tar.gz


Extract the downloaded file
# tar xzvf drupal*


Move drupal content to apache root directory :
# mv drupal-8.3.5/* /var/www/html



Create setting.php file by copying the default.settings.php file.
# cp /var/www/html/sites/default/default.settings.php /var/www/html/sites/default/settings.php


Set permission and ownership of root directory :
# chmod -R 755 /var/www/html/*
# chown -R www-data:www-data /var/www/html/*


Enable Apache2 modules:
# a2enmod rewrite
# a2enmod env
# a2enmod dir
# a2enmod mime



Edit apache configuration file and change the setting as given below :
# vim /etc/apache2/sites-enabled/000-default.conf


<VirtualHost *:80>

     ServerAdmin vishal@vishalvyas.com
     DocumentRoot /var/www/html/
     ServerName vishalvyas.com
     ServerAlias www.vishalvyas.com
     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

      <Directory /var/www/html/>
           Options FollowSymlinks
           AllowOverride All
           Require all granted
      </Directory>
      <Directory /var/www/html/>
           RewriteEngine on
           RewriteBase /
           RewriteCond %{REQUEST_FILENAME} !-f
           RewriteCond %{REQUEST_FILENAME} !-d
           RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
      </Directory>

</VirtualHost>


Restart apache service :

# systemctl restart apache2

After restart Apache, open your web browser and browse your ip and you should see Drupal configuration wizard.







Select Standard installation and continue



Enter Database Information and continue.


Installing Drupal.



Enter your details and configure site.



It's Done.

Your Drupal site is ready to use and implement.




By VishalVyas






Comments

Popular posts from this blog

Another instance of Certbot is already running - Solved - Linux guru

Error : Another instance of Certbot is already runningcertbot --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns --installer nginx -d *.vishalvyas.com Another instance of Certbot is already running Reason : when you run certbot form your machine and unexpectedly stop the command, Then cert bot is not running but it left some .certbot.lock files behind.You need to kill the certbot instance form your machine. Solution : Run the below command to find killed certbot.find / -type f -name ".certbot.lock" You can see result of the command, If there are, you can remove them. Run below command to remove them.find / -type f -name ".certbot.lock" -exec rm {} \; And try again.

Install Apache Using Ansible Playbooks

Ansible is a automation tool which is widely used, you can install and install, configure and manage number of system and services remotely. you can install software and manage services and tasks without needing manually log in to each servers. you have to install ansible in one machine and use ssh to communicate host each other.



Ansible uses Playbooks which is written in YAML format. it's uses module base format. with playbook can run multiple tasks at time and provide more advance functionality, YAML file always start with "---" syntax. In this article we will see how to install and configure apahce2 using ansible YAML script. Master server : 10.80.253.11 [Ansible server, ] Slave 1 : 10.80.253.12 [need to install apache2 in slave 1] Slave 2 : 10.80.253.13 [need to install apache2 in slave 2] We need to configure slave server info in our ansible configuration file, click here to know how to add client machine to ansible. Let's update our apache2.yml file and install…

Create aws s3 bucket using cli

In this article i will explain you to how to manage s3 bucket and objects using AWS cli command line interface. for that you will have to configure AWS cli interface to your local linux machine. You can configure cli from. HERE.




After configured aws cli to your local machine, you can run all below commands. How to create bucket using AWS Cli.root@master:~# aws s3 mb s3://linuxgurubucket make_bucket: linuxgurubucket Listing Bucket : To list all bucket : root@master:~# aws s3 ls 2018-05-01 15:28:37 linuxgurubucket To list all objects from bucket :root@master:~# aws s3 ls s3://linuxgurubucket 2018-05-01 15:32:16 71515 vishal.jpg How to copy local file to s3 using aws cp command :root@master:~# aws s3 cp ansible.sh s3://linuxgurubucket/ upload: ./ansible.sh to s3://linuxgurubucket/ansible.sh To check it's upload or not :root@master:~# aws s3 ls s3://linuxgurubucket/ 2018-05-01 15:34:19 82 ansible.sh 2018-05-01 15:32:16 71515 vishal.jpg To remove file from s3 bucket using cli: