- Create a Virtual Machne
- Install Ubuntu Server using Bundled with a Package
- Install Ubuntu Sertver using Package Management System
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.
- 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)
- Manual Installation: is difficult and impractical which requires compiling from source.
- Precompiled into Binaries for some OS: it is limited in availability
- 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)
2. Click Next and set the Memory size
3. Create new virtual hard disk by selecting ‘Create a virtual had disk now’
4. Select Hard disk file type (I choose VDI since use VirtualBox)
5. Choose either Dynamically allocate or Fixed size
6. Set the file location and size of the hard drive
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’
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’.
3. Once the disk is loaded start the virtual machine by clicking the ‘Start’ button.
4. Select language
5. Install Ubuntu Server is selected so press Enter.
6. Select the langue to be used for the installation process using tab and press Enter.
7. Select your location using tab and press Enter.
8. You can check your keyboard layout.
9. Put the hostname for the server ( I have put myubuntuserver) select using tab and press Enter.
10. Put full name for the user, select using tab and press Enter.
11. Put username for your account, select using tab and press Enter.
12. Put password for the use and re-enter the password, select using tab and press Enter.
13. You can encrypt your home directory if you want.
14. Select your time zone.
15. Set your disk partition (I want to use the entire disk) and simply follow the instruction.
16. You can set your HTTP proxy if you want (I didn’t).
17. It is good to select ‘Install security updates automatically’ and press Enter.
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.
19. Set a password for the MySQL administrative i.e. the root user. You will be asked to re-enter the password.
20. You will be asked to install GRUB boot loaded , select and Enter.
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.
22. Once it is reboot you will be prompted to login. Put the user name and then password to login.
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)
24. To make sure that everything is installed correctly get the ip-address of the server using the command
then check it in a browse and you will get the default page of Ubuntu.
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
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!
Leave A Comment