Drupal from Scratch provides a comprehensive guide to installing Drupal on a Debian-based system using command lines. The document outlines how to install Drupal Core, set up a MySQL database, configure a virtual host for local development, and complete the first Drupal site installation. Key steps include downloading and extracting Drupal Core, installing prerequisite software like PHP and Apache, creating a database, enabling virtual hosts, and navigating the Drupal installation process.
1 of 19
Downloaded 17 times
More Related Content
Drupal from scratch
1. A Comprehensive Guide to Drupal Installation in Debian-based Systems
By Rovic Honrado
2. Drupal from Scratch
A Comprehensive Guide to Drupal Installation in Debian-based
Systems
Pre-requisite:
Pre-installed debian-based system such as Linux Mint, Ubuntu
If running with Windows OS, should have VMWare that has
debian-based system
Training Objectives:
To be able to install the latest Drupal Core into the system
using command lines smoothly (Geek Mode )
To be able to install and setup you very own virtual servers,
MySQL database and latest PHP programming language
To be able to create fake domains instead of localhost on your
browser
You will learn how to setup your very own Drupal Site!!!
3. The Drupal Core
To install the latest version of Drupal,
go to drupal.org/project/drupal.
Download Drupal Core recommended
release drupal-7.22.zip -
https://drupal.org/project/drupal
Extract to your preferred folder, ex.
/home/user/. Rename the extracted
folder to any name you like.
4. 3. Download PHP5, Apache2 & MySQL Server to
prepare your local machine for Drupal installation.
a. Open Terminal, type below command to update
current OS version, this will avoid Failed to fetch
error:
~$ sudo apt-get update
b. Then install the following:
~$ sudo apt-get install mysql-server-5.5 php5
php5-mysql php5-gd apache2 -y
- include -y to your command to force decide as
yes for installation then press Enter
You will be prompt to set your MySQL root password. For
training
purposes, just set your password to 'root'. Then re-enter set
password. Installation will proceed.
5. d. After setting up of your local machine, configure
virtual host to create fake domain for local
machine web development:
Enable the rewrite module for apache with this
command; this will setup Clean URLs with
Apache2 on your system:
~$ sudo a2enmod rewrite
You can check to see if this worked by running:
~$ sudo apache2ctl -M
6. e. Create dynamic virtual hosts in Apache HTTP
with vhost_alias.
This module creates dynamically configured virtual
hosts, by allowing the IP address and/or the
Host: header of the HTTP request to be used as part of
the pathname to determine what files to serve.
Exactly what you need.
~$ sudo a2enmod vhost_alias
f. To activate new configuration, run:
~$ sudo service apache2 restart
7. f. You will now setup your Virtual Host by creating
the below configuration:
~$ sudo gedit /etc/apache2/sites-available/default
Note: select what text editor is installed in your
system (gedit, pluma, geany) and replace the
above command. You can change 'default' to
any virtual host you prefer.
ex. drupaltraining. This will open text editor to set
virtual host configuration. Type the following:
<Virtualhost *:80>
ServerName dev.drupaltraining.org
DocumentRoot /home/user/drupal
</Virtualhost>
note: For the DocumentRoot, provide the directory
path of your extracted drupal files. Ex.
8. g. Configure your localhost 127.0.1.1 to include
your fake domain to listing:
~$ sudo gedit /etc/hosts
Note: select what text editor is installed in your
system (gedit, pluma, geany) and replace the
above command.
This will open hosts file configuration. Include your
fake domain in host listing:
127.0.0.1 localhost
127.0.1.1 ubuntu.ubuntu-domain ubuntu
127.0.1.1 dev.drupaltraining.org
h. Enable Virtual Host configuration.
~$ sudo a2ensite drupaltraining
To activate new configuration, run:
~$ sudo service apache2 reload
10. Setting up your MySQL
Server
1. To access MySQL server, run the following command:
~$ sudo mysql -u root -p
You will be asked for your root password, type your
password that you set during installation, ex. 'root'.
When you see mysql>, it means that you have
successfully accessed your MySQL server.
2. Create your site database. You can create any
database name you want. For training purposes, I
created drupaltraining database. Type the below
command:
mysql> create database drupaltraining;
11. 3. To check if you have successfully created your
database, run:
mysql> show databases;
+------------------------------+
| Database |
+------------------------------+
| information_schema |
| d7 |
| drupaltraining |
| mysql |
| performance_schema |
+------------------------------+
5 rows in set (0.37 sec)
4. Type exit to go back to command prompt.
13. Caution!
Errors such as PDO, GD, missing
files
directory, no settings.php, sometimes
give us little frustrations on our first
Installation attempt.
To prevent this, we will prepare our
system
to correct these before Bugging us.
14. PREPARING REQUIRED DRUPAL SUB-FOLDER
AND SETTINGS.PHP FOR SMOOTH
INSTALLATION
Drupal installation requires 'files' directory under
/drupal/sites/default/
1. To create 'files' directory under
/drupal/sites/default/, run:
~$ mkdir ~/drupal/sites/default/files
Change 'files' directory permission to make it
writable by running below command:
~$ sudo chmod 777 ~/drupal/sites/default/files
15. 2. Copy and rename default.settings.php to settings.php
and save it to /drupal/sites/default directory. Run:
~$ cp drupal/sites/default/default.settings.php
drupal/sites/default/settings.php
3. Change settings.php permission to make it writable,
run:
~$ sudo chmod 777 drupal/sites/default/settings.php
Congratulations!
Youre almost there! You already eliminated the
errors that will block you from creating awesome
websites.
16. SETTING UP YOUR FIRST DRUPAL SITE
1. Open your browser and type your fake domain. ex.
dev.drupaltraining.org
2. You will be redirected to
dev.drupaltraining.org/install.php
3. Follow step by step installation.
a. Choose profile
- Standard
b. Choose language
- Default
c. Verify requirements. With all error-free preparation,
this will run smoothly
17. e. Install profile
- Drupal installation will now start, including 28
core modules
f. Configure site
- Type site information like Site name, site
email address, username, user email address,
password, server settings
- Uncheck 'Check for updates automatically
- Save and continue
Congratulations!
You can now view your new site!
18. Modules to install:
To install contributed modules, you need to create
'contrib' directory under /drupal/sites/all/modules/. To
create directory using command line, type:
~$ mkdir drupal/sites/all/modules/contrib
Download the following modules and extract to contrib
directory, not complete but essential:
- admin - feeds - pathauto
- ckeditor - feeds - token
- ctools - features - views
- devel - library - views_slideshow
- eva - module_filter