Installing Drupal In Linux

Contributing to Drupal:
To contribute to Drupal we need to first build it on our localhost. So now let us discuss how to build Drupal on our localhost.STEP 0
Get into www.drupal.org and sign up for Drupal and then create an account in Drupal Ladder and complete the ladder simultaneously.STEP 1
Installing Git. Install git using the given commands. For Linux users:$ sudo apt-get update $ sudo apt-get install git
STEP 2
Installing Composers Dependencies.
The composer is a dependency manager for PHP. The composer will manage the dependencies you require on a project by project basis. This means that Composer will pull in all the required libraries, dependencies and manage them all in one place.$ sudo apt-get update $ sudo apt-get install curl php-cli php-mbstring git unzip
Installing and configuring Composer
$ cd ~ $ curl -sS https://getcomposer.org/installer -o composer-setup.phpTo install composer globally, use the following command :
$ sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composerThe output should be something like this:
Output All settings correct for using Composer Downloading 1.1.1... Composer successfully installed to: /usr/local/bin/composer Use it: php /usr/local/bin/composerTo test whether the composer is working or not please enter :
$ composerThen you should be getting something like this: Output
______ / ____/___ ____ ___ ____ ____ ________ _____ / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/ / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ / \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/ /_/ Composer version 1.1.1 2016-05-17 12:25:44 Usage: command [options] [arguments] Options: -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question --profile Display timing and memory usage information --no-plugins Whether to disable plugins. . . .
STEP 3
Installing Drush
$ composer global require drush/drush:8.*Navigate to the Drupal directory using the cd command and then type:
$ drush core-statusThis should return the version of the Drush. Here comes the main part of our build.
STEP 4
Installing LAMP/WAMP
This is the major step of our build which involves installing lamp and configuring it.LAMP is an open source Web development platform that uses
Linux as the operating system,
Apache as the Web server, MySQL as the relational database management system and
PHP as the object-oriented scripting language.


Installing Apache
We can get started by typing these commands:$ sudo apt-get update $ sudo apt-get install apache2Press Y and hit Enter to continue, and the installation will proceed. To check for errors please type:
$ apache2ctl configtest
You should be getting something like this if everything is working fine:
If you see this page, then your web server is now correctly installed and accessible through your firewall.
Run a simple security script that will remove some dangerous defaults and lock down access to our database system. For that type:
Output Syntax OKRestart Apache to implement your changes:
$ systemctl restart apache2To check everything is working fine in your browser :
http://your_server_IP_addressYou should get the Ubuntu start page which looks like this:

Installing MySQL
Now we have to install MySQL-Structured Query Language by entering the command :$ apt-get install mysql-serverTo get our MySQL environment set up securely we need to tell MySQL to create its database directory structure where it will store its information. You can do this by typing:
$sudo mysql_install_db
$ sudo mysql_secure_installationAt this point, your database system is now set up and we can move on.
Installing PHP
This should install PHP without any problems.$ sudo apt-get install php5 libapache2-mod-php5 php5-mcryptApache will first look for a file called index.html. We want to tell our web server to prefer PHP files, so we'll make Apache look for an index.php file first. To save all the changes we have done restart apache2:
$ sudo service apache2 restartThis is how you Install LAMP. If you face any errors then try the single line command to install Lamp along with phpmyadmin:
$ sudo apt-get install lamp-server^ phpmyadmin
This will automatically configure lamp on your desktop.
STEP 5
Configuring phpmyadmin
After installing phpmyadmin with the command$ sudo apt-get update $ sudo apt-get install phpmyadminWhich will open the below screen....



$ sudo systemctl reload apache2To check phpmyadmin is working please open the given address in your browser.
Now log on to it using the root username with the same password you gave for MySQL.
STEP 6
Clone Drupal8
After logging in we have to clone the Drupal repository.$ cd /var/www/html $ git clone --branch 8.5.x http://git.drupal.org/project/drupal.git drupal8
STEP 7
Now as you have cloned the website into your localhost. Now create a database named Drupal in phpmyadmin.
localhost/name_of_sitewhich should give you this page:

STEP 8
The main requirements will be
$ cd sites/default $ mkdir files $ chmod 777 filesThese are the basic requirements and then click on continue anyway and then you get the next page as:

STEP 9
Now you have your website on your localhost. To check it please type:localhost/site_name

Subscribe to FOSS-BLOG
Get the latest posts delivered right to your inbox