How to Configure Apache Web Server in Debian 8

line5

DEBIAN SERIES

  1. How to Install Debian 10 Manual Partition for /boot, /swap, root, /home, /tmp
  2. How To Install Debian 8 by Manually Creating LVM Linux Partitions
  3. How to Update Software packages in Debian 8
  4. How to Configure DHCP Server in Debian 8
  5. How to Configure Apache Web Server in Debian 8

TUTORIAL

Go to Terminal

Debian 8.2-2018-03-15-13-37-40

Switch to root user so you don’t need sudo to execute commands

su -

Debian 8.2-2018-03-15-13-37-46

Install web server

aptitude install apache2

Debian 8.2-2018-03-18-21-57-03

Check web server (apache2) service status

service apache2 status

Debian 8.2-2018-03-18-21-57-04

change computer name (hostname)

nano /etc/hostname

Debian 8.2-2018-03-18-21-57-06

give the hostname (computer name) of the debian web server

abc

Debian 8.2-2018-03-18-21-57-07

change the domain name

nano /etc/hosts

Debian 8.2-2018-03-18-21-57-08

change the hostname (computer name) and domain name

hostname = abc

domain name = teche.lk

192.168.1.10         abc.teche.lk         abc

Debian 8.2-2018-03-18-21-57-09

Check the configuration

to check the hostname

hostname

to check the domain name

hostname -d

to check the FQDN name

hostname -f

Debian 8.2-2018-03-18-23-56-22.png

Go to the web browser

192.168.1.10

Debian 8.2-2018-03-18-23-56-23

abc.teche.lk

Debian 8.2-2018-03-19-15-04-08

How to Configure DHCP Server in Debian 8

line5

DHCP Server

Switch to root user

su -

Debian 8.2-2018-03-15-13-37-46

(if it is a fresh install update the source.list file to update software through internet)

https://techencyclopedia.wordpress.com/2018/03/18/update-software-packages-in-debian-8/

Install DHCP service

aptitude install isc-dhcp-server

Debian 8.2-2018-03-15-13-38-28

Debian 8.2-2018-03-15-13-39-09

Search for DHCP service

aptitude search isc-dhcp-server

Debian 8.2-2018-03-15-18-50-39

Open and configure dhcpd.conf file

nano /etc/dhcp/dhcpd.conf

Debian 8.2-2018-03-16-13-10-42Debian 8.2-2018-03-16-13-11-04

Make necessary changes

ddns-update-style none;

ignore client-updates;

authoritative;


# state The network 
subnet 192.168.1.0 netmask 255.255.255.0 

{

#State The Default gateway 
option routers 192.168.1.1;

#State the Subnet mask 
option subnet-mask 255.255.255.0;

#State the Broadcast IP address 
option broadcast-address 192.168.1.255;

#State DNS domain name 
option domain-name "teche.com";

#State the DNS server IPs 
option domain-name-servers 192.168.1.10;

#State the range of DHCP IPs 
range 192.168.1.200 192.168.1.220;

#State default lease time
default-lease-time 600;

#State the maximum lease time
max-lease-time 7200;

}

Debian 8.2-2018-03-16-16-31-02.png

Start the DHCP service

service isc-dhcp-server start

OR

systemctl restart isc-dhcp-server

Debian 8.2-2018-03-16-13-24-25

Check the DHCP status

service isc-dhcp-server status

OR

systemctl status isc-dhcp-server

Debian 8.2-2018-03-16-13-25-00

DHCP CLIENT

Change the network configuration to accept DHCP IP address

Debian 8.2 second-2018-03-16-13-58-39

Debian 8.2 second-2018-03-16-13-58-44

 

How to Update Software Packages in Debian 8

line5

In a fresh Debian 8 install you will get an error when you try to install a software package if you don’t update the source list properly

Debian 8.2-2018-03-15-13-37-47.png

 

Go to Terminal

Debian 8.2-2018-03-15-13-37-40

Switch to root user

su -

Debian 8.2-2018-03-15-13-37-46.png

Open the source configuration file

nano /etc/apt/sources.list

Debian 8.2-2018-03-15-13-37-55.png

Change the mirror list in source configuration file in Debian 8

deb http://ftp.debian.org/debian/ wheezy main contrib non-free

deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free

deb http://security.debian.org/ wheezy/updates main contrib non-free


Primary Debian mirror sites

https://www.debian.org/mirror/list

Debian 8.2-2018-03-15-13-37-56.png

Update the software sources

aptitude update

Debian 8.2-2018-03-15-13-37-57.png

Now you can install/ update software packages in Debian 8 using following commands

To search for a software package in Debian 8

aptitude search packagename

To install a software package in Debian 8

aptitude install packagename

To remove a software package in Debian 8

aptitude purge packagename

To get information of a software package in Debian 8

aptitude show packagename

REFERENCE

https://wiki.debian.org/SourcesList

https://www.debian.org/doc/manuals/debian-faq/ch-pkgtools.en.html

How To Install Debian 8 by Manually Creating LVM Linux Partitions

line5

TECH ENCYCLOPEDIA DEBIAN SERIES

  1. How to Install Debian 10 Manual Partition for /boot, /swap, root, /home, /tmp
  2. How to Install Debian 8 by Manually Creating LVM Linux Partitions
  3. How to Update Software packages in Debian 8
  4. How to Configure DHCP Server in Debian 8
  5. How to Configure Apache Web Server in Debian 8

What Is Debian Linux Computer Operating System?

more at [https://www.debian.org/intro/about]

Lab Configuration

In this lab scenario 100 Gb hard disk is used to manually create LVM (Logical Volume Manager) Linux partitions namely /swap, / (root), /home, /var, /srv. Standard /boot partition is created separately to keep the boot files and linux kernal as the system cannot boot from LVM partition. Feel free to adjust the sizes of the partitions accordingly to the requirement of your organization.

TUTORIAL

Firstly download Debian 8 at https://www.debian.org/CD/http-ftp/  and create a bootable CD/DVD

Select “Graphical install”

Debian 8-2018-03-08-15-01-29.png

Select appropriate language

In this case English is chosen

Debian 8-2018-03-08-15-02-25.png

Select your location

Debian 8-2018-03-08-15-02-35

Configure the keyboard

Debian 8-2018-03-08-15-02-45

Debian 8-2018-03-08-15-03-04

In this case the network configuration fails because there is no DHCP server

press continue to manually configure the network

Debian 8-2018-03-08-15-07-33

configure network manually

Debian 8-2018-03-08-15-08-30.png

Provide the ip address

192.168.1.10

Debian 8-2018-03-08-15-08-55

Provide the netmask

Debian 8-2018-03-08-15-09-03

provide the gateway address

Debian 8-2018-03-08-15-09-11

Provide the name server address

Debian 8-2018-03-08-15-09-27

Provide the hostname for the system

Debian 8-2018-03-08-15-11-18

Provide the domain name

Debian 8-2018-03-08-15-11-48

Provide the root password

Debian 8-2018-03-08-15-12-32

Provide the name of the new user account

Debian 8-2018-03-08-15-12-44

Provide the username for the new account

Debian 8-2018-03-08-15-12-58

Provide the password for the newly created user account

Debian 8-2018-03-08-15-13-14

Configure the clock

Debian 8-2018-03-08-15-18-15

Partition disks

In this case manual option is selected

Debian 8.2-2018-03-10-23-21-49.png

Debian 8.2-2018-03-10-23-21-59

Debian 8.2-2018-03-10-23-22-28

Firstly Create a Standard boot partition

  • Size of the partiton: 1 GB
  • Type for the new partition: primary
  • Location of the new partition: beginning
  • use as: Ext4 journaling file system
  • Mount point: /boot
  • label: boot
  • bootable flag: on

Debian 8.2-2018-03-10-23-26-55

Debian 8.2-2018-03-10-23-27-00

Debian 8.2-2018-03-10-23-27-08

Debian 8.2-2018-03-10-23-27-13

Debian 8.2-2018-03-10-23-27-18

Debian 8.2-2018-03-10-23-34-08

Debian 8.2-2018-03-10-23-36-31

Configure the logical volume manager

  • Firstly create a LVM physical volume
  • Then create other partitions as LVM logical volumes within the LVM physical volume

Debian 8.2-2018-03-10-23-36-47.png

Create a logical volume group

LVMGroup

Debian 8.2-2018-03-10-23-47-40

Debian 8.2-2018-03-10-23-47-50

Debian 8.2-2018-03-10-23-48-10.png

Debian 8.2-2018-03-10-23-48-20

Debian 8.2-2018-03-10-23-48-29

Debian 8.2-2018-03-10-23-53-58.png

Create Logical volumes for following partitions

  • /swap
  • /       – (root)
  • /home
  • /srv
  • /var

please note that in this tutorial only swap partition creation is shown

Debian 8.2-2018-03-11-00-04-17

Debian 8.2-2018-03-11-00-04-24

Debian 8.2-2018-03-11-00-05-40

Debian 8.2-2018-03-11-00-10-01.png

Swap partition

  • Size of the LVM logical volume partition: 2.5 GB [since the system RAM is 2 GB, 2 GB + 500 mb]
  • use as: swap area

Desired capacity is calculated according to the system RAM. If the system RAM is less than 2 GB it should be multiplied by 2, if the system RAM is more than 2 GB, should add 500 mb to the system RAM.

EX -:
system RAM is 250 mb —> Desired Capacity is 500 mb [250 mb * 2]
system RAM is 3 GB —> Desired Capacity is 3.5 GB [3 GB + 500 mb]

Debian 8.2-2018-03-11-00-16-29

Debian 8.2-2018-03-11-00-17-33

Home partition

  • Size of the LVM logical volume partition: 40 GB
  • use as: Ext4 journaling file system
  • Mount point: /home
  • label: home

Debian 8.2-2018-03-11-00-19-04

Debian 8.2-2018-03-11-00-19-13

Debian 8.2-2018-03-11-00-19-36

Root partition

  • Size of the LVM logical volume partition: 30 GB
  • use as: Ext4 journaling file system
  • Mount point: /
  • label: root

Srv partition

  • Size of the LVM logical volume partition: 15 GB
  • use as: Ext4 journaling file system
  • Mount point: /srv
  • label: srv

Var partition

  • Size of the LVM logical volume partition: 15 GB
  • use as: Ext4 journaling file system
  • Mount point: /var
  • label: var

Debian 8.2-2018-03-11-00-23-05

Debian 8.2-2018-03-11-00-23-14

Configure the package manager

scan additional CD/DVD

Debian 8.2-2018-03-11-00-30-33

configure network mirror

Debian 8.2-2018-03-11-00-30-55

Participate in the package survey

Debian 8.2-2018-03-11-00-43-20

Select and Install predefined collection of software

In this case default is selected

Debian 8.2-2018-03-11-00-44-29.png

Install the GRUB (grand unified boot loader)

Debian 8.2-2018-03-11-01-29-06

Select the path to install GRUB

Debian 8.2-2018-03-11-01-29-13

Finish installation

Select continue to reboot the system

Debian 8.2-2018-03-11-01-29-36

Debian 8.2-2018-03-11-01-50-32

Debian 8.2-2018-03-11-01-50-41

 

Hopefully, I believe after following this tutorial now you have an idea on how To Install Debian 8 by Manually Creating LVM Linux Partitions.