Outline

  1. Introduction
  2. Create a Virtual Machne
  3. Install Ubuntu Server using Bundled with a Package
  4. Install Ubuntu Sertver using Package Management System
  5. Conclusion

1. Introduction

Apache Web Server is a public-domain open source web server developed by Apache group. The name is a tribute to the Native American Apache Indian tribe, a tribe well known for its superior skills in warfare and strategy. There are different methods to install Apache web Server.

  1. Package Management System: is the easiest method which includes 
    dpkg – for Debian (Ubuntu) packaging system which is wrapped with Advanced Packaging Tool (APT) 
    rpm – for RedHat and other Linux packaging system which is wrapped with Yellowdog Updater, Modified (YUM)
  2. Manual Installation: is difficult and impractical which requires compiling from source.
  3. Precompiled into Binaries for some OS: it is limited in availability
  4. Bundled with a Package: pre-configured version of common web server softwares, includes:
    XAMPP – for Windows, Mac or Linux (from apachefriends.org)
    WampServer – for Windows (from wampserver.com)
    MAMP – for Mac (from mamp.info)
    LAMP – for Linux

To demonstrate the installation we will use VirtualBox and create virtual machine.

2. Create a Virtual Machine

1. Open the VirtualBox and click ‘New’ and select the operating system. In our example we call our machine Ubuntu-LAMP (since we are installing LAMP on Ubuntu)

install-apache-web-server-01

2. Click Next and set the Memory size

install-apache-web-server-02

3. Create new virtual hard disk by selecting ‘Create a virtual had disk now’

install-apache-web-server-03

4. Select Hard disk file type (I choose VDI since use VirtualBox)

install-apache-web-server-04

5. Choose either Dynamically allocate or Fixed size

install-apache-web-server-05

6. Set the file location and size of the hard drive

install-apache-web-server-06

7. Click ‘Create’. Now we have created the Virtual Machine, but it doesn’t have operating system. The next steep is installing the Ubuntu Server we have downloaded.

3. Install Ubuntu Server using Bundled with a Package

Here are the steps on how to install Ubuntu web server in a Virtual Machine (VirtualBox) using Bundle Package (LAMP) . LAMP server installs Apache as the Web server, MySQL as the relational database management system and PHP as the object-oriented scripting language

To do that first download the latest Ubuntu Server from www.ubuntu.com/download

1. Click ‘Settings’

install-apache-web-server-08

2. Click ‘Storage’ and from the Storage Tree click the Empty disk icon then load the virtual optical disk (which is the one we downloaded)  then click ‘OK’.

install-apache-web-server-10

3. Once the disk is loaded start the virtual machine by clicking the ‘Start’ button.

install-apache-web-server-12

4. Select language

install-apache-web-server-13

5. Install Ubuntu Server is selected so press Enter.

install-apache-web-server-14

6. Select the langue to be used for the installation process using tab and press Enter.

install-apache-web-server-15

7. Select your location using tab and press Enter.

install-apache-web-server-16

8. You can check your keyboard layout.

install-apache-web-server-17

9. Put the hostname for the server ( I have put myubuntuserver) select  using tab and press Enter.

install-apache-web-server-19

10. Put full name for the user, select  using tab and press Enter.

install-apache-web-server-20

11. Put username for your account, select  using tab and press Enter.

install-apache-web-server-21

12. Put password for the use and re-enter the password, select  using tab and press Enter.

install-apache-web-server-23

13. You can encrypt your home directory if you want.

install-apache-web-server-24

14. Select your time zone.

install-apache-web-server-26

15. Set your disk partition (I want to use the entire disk) and simply follow the instruction.

install-apache-web-server-27

16. You can set your HTTP proxy if you want (I didn’t).

install-apache-web-server-31

17. It is good to select ‘Install security updates automatically’ and press Enter.

install-apache-web-server-34

18. Now we are going to select the software we want to install.
Note: to highlight a software use the ‘Tab’ key and to select use the ‘Space’ key. The selected software will have [*].
In this installation we are going to install LAMP and OpenSSH server (to remotely access using ssh).
Standard system utilities is selected by default.
install-apache-web-server-35

19. Set a password for the MySQL administrative i.e. the root user. You will be asked to re-enter the password.

install-apache-web-server-37

20. You will be asked to install GRUB boot loaded , select and Enter.

install-apache-web-server-40

21. If things go well this far you will see a message that the installation is completed and asked to reboot the machine, select and Enter.

install-apache-web-server-42

22. Once it is reboot you will be prompted to login. Put the user name and then password to login.

install-apache-web-server-43

23. Successfully logged in to the server. (Alternatively we can access our Server using SSH such as PuTTY)
It is good to update the repositories by running:
sudo apt-get update
(Do this every time before installing any program)
install-apache-web-server-44

24. To make sure that everything is installed correctly get the ip-address of the server using the command
ipconfig
then check it in a browse and you will get the default page of Ubuntu.

install-apache-web-server-46

Note: To get a unique ip-address the we need to set the Network Adapter of the virtual machine should be attached to Bridge Adapter. This can be done by going to the VirtualBox select the virtual machine and go to its Setting. In the Setting select Network and from the Attached to dropdown menu select Bridged Adapter.

4. Install Ubuntu Server using Package Management System

Instead of installing LAMP and OpenSSH during the installation of Ubuntu Server as a bundled package, we can also install each of them one by one using Package Management System. Since our OS is Ubuntu we use dpkg (APT)

i. Install apache2

sudo apt-get install apache2

ii. Install php

sudo apt-get install php5 libapache2-mod-php5

iii. Install mysql

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

iv. Install openssh-server

sudo apt-get install openssh-server

5. Conclusion

Now you have a server with Apache as the Web server and MySQL as the relational database management system. To get browser based interface that manages our MySQL you need to install phpMyAdmin. Read the article Install phpMyAdmin on Ubuntu Server (LAMP) to see how to install phpMyAdmin. It is important to secure your server. To do so read the article Basic Server Security Setup.

If you want to read on how to interact with Apache Server read my other article Interacting with Apache Web Server.

Have fun with your server!

[accordian divider_line=”” class=”” id=””][toggle title=”References” open=”no”]http://httpd.apache.org/docs/current/configuring.html
https://serversforhackers.com/configuring-apache-virtual-hosts
http://www.lynda.com/[/toggle][/accordian]