Configure Web Server for Penetration Testing (Beginner Guide)

Hello friends! Today you will learn how to configure your own web server using ubuntu inside virtual machine and install LAMP services for web server configurartion.

Let’s Begin!!

We are using VM  worksatation 12 pro for ubuntu installation, now for the guidance step by step.

Choose typical (1st options)for configuration and click on next.

Since I have already downloaded ubuntu 14.04 of 64 bit in my windows operating system, so let browse it as shown in given image.

Click on next.

Now enter information for personalize Linux inside text filed

Full name: pentestlab

Username: raj

Passwords: 123

Confirm: 123

Then click on next.

Specify disk capacity according to your desire as 20 GB I had specified.

Choose split virtual disk into multiple file and then click on next.

Now make some changes in setting through customize hardware before you click on finish.

Change network adapter setting into Bridge and select the check box for replicate physical network connection state.

Then click on close then Finish.

This will create a new virtual machine inside your VM workstation.

Now wait for small period of time till it boot up automatically after then it will start installation which will take some time.

Now enter your password for login.

Now we need to install LAMP service, which is collection of open source software used to make web servers up and running. The LAMP stands for Linux, Apache, MySQL, and PHP. 

For installation user must have root privileges now type following command inside terminal to begin.

sudo bash

apt-get update

Apache HTTP Server is cross-platform, meaning that it is built for Unix-like system. Apache played a key function for the World Wide Web.

apt-get install apache2

MySQL is the world’s most popular open-source database. MySQL is simple to set up and easy to use.

apt-get install mysql-server

You will get a prompt, Press enter to set password “blank” for root user in mysql configuration

Again press enter

phpMyAdmin is a free software tool written in PHP, proposed to handle the administration of MySQL over the Web. phpMyAdmin supports a wide range of operations on MySQL.

apt-get install phpmyadmin

Choose apache2 web server that will be automatically configure to run phpmyadmin.

Again a prompt will open for submit the password for phpmyadmin, to register with database server.

Press enter to left password “blank” for phpadmin.

Now in order configure phpmyadmin under Apache, you need to edit “/etc/apache2/apache2.conf” at the end of apache2.conf file. Therefore type following command to open the apache2.conf 

cd /etc/apache2

gedit apache2.conf

Once the file get opened type following text at the end of file as shown in given image

# phpMyAdmin Configuration

Include /etc/phpmyadmin/apache.conf

After editing save the file.

Since we had given blank space as password for phpmyadmin therefore we need to make some changes inside its file “” so that it could Allow No Password while login into database.

Type following command to open

gedit /etc/phpmyadmin/

Focus on highlighted comment remove double pipe (||) to activate this comment.

Now you can observe the given image is highlighting following comment:


Now open myphpadmin in browser as localhost/phpmyadmin as shown in image.

Install the PHP 5 module for Apache 2 and all of its dependencies.

apt-get install php5 libapache2-mod-php5 

Hence we had install LAMP services inside ubuntu therefore it will operate like as web server.

Now install some other useful services for sharing data between server and client.

Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. It is a TCP protocol holds port 22 to establish communication between server and client.

apt-get install openssh-server

Install vsftpd service, it is the default FTP server in the Ubuntu, it is also a tcp protocol hold port 21 for data transfer.

apt-get install vsftpd

In order to ensure that above service has been installed properly in your system use nmap which will scan your system and then tell open ports and running services on your system.

To run nmap,  first install it through following command

apt-get install nmap

Now scan your system using nmap to make sure for running services.


From given below image you can check it has dump the result which has disclosed the running service of my system.

Author: AArti Singh is a Researcher and Technical Writer at Hacking Articles an Information Security Consultant Social Media Lover and Gadgets. Contact here

Related Posts Plugin for WordPress, Blogger...

Leave a Reply