As we know how much web stack is important for hosting web content in linux environment and in this tutorial we will setup our web server for penetration testing on Ubuntu OS.
LAMP stands for Linux, Apache, MySQL, and PHP. Its all are very common example of a web service stack each component. These are the first priority whenever the web application has been hosted into the web server.
Lets do it π !!
Now we will install all these in a single command.
apt install apache2 php ssh vsftpd nmap -y
MySQL is a relational database management system based on SQL β Structured Query Language that is works with SELECT , DELETE , INSERT , REPLACE , and UPDATE statements. MySQL is used to manage database systems, retrieving data from database tables etc.
Lets install the MySQL database server by using the βapt-getβ command.
apt install mysql-server -y
We will login to the database after installation. If we are logging in with root, it is not necessary to enter the password.
mysql -u root -p
After login we have to provide all the privileges to the user of ubuntu, in our case we will select the user βshubhamβ whose password is β123β.
GRANT ALL PRIVILEGES ON . TO 'shubham'@'%' IDENTIFIED BY '123' WITH GRANT OPTION;
We need to execute the flush privileges command to update the database.
flush privileges;
exit
Here you can see that we have configured Web Server Lab in a few minutes.
nmap localhost
Docker is a tool designed to make it easier to create, deploy, and run applications by using containers.
Now we will configure our Web Server Lab in docker. In order to create a Docker-based LAMP stack we need to download docker first in ubuntu using the following command.
apt install docker.io
After the installation we have to download the docker-compose which let us easily organize multi-container applications using yaml configuration files.
apt install docker-compose
After install all these we need to create a β.yamlβ file that will contains the following configuration.
Note : If you are trying this in the new ubuntu, you can enter the given configuration otherwise you will have to change the port and credentials accordingly.
cat > docker-compose.yaml
version: "2"
services:
www:
image: amarsingh3d/apache2.4-php7.2
ports:
- "82:80"
volumes:
- ./DocumentRoot:/var/www/html/
links:
- db
networks:
- default
db:
image: mysql:5.6
ports:
- "3302:3306"
environment:
MYSQL_DATABASE: myDb
MYSQL_USER: user
MYSQL_PASSWORD: test
MYSQL_ROOT_PASSWORD: test
volumes:
- ./MySQL_DATA:/docker-entrypoint-initdb.d
- persistent:/var/lib/mysql
networks:
- default
phpmyadmin:
image: phpmyadmin/phpmyadmin
links:
- db:db
ports:
- 8080:80
environment:
MYSQL_USER: user
MYSQL_PASSWORD: test
MYSQL_ROOT_PASSWORD: test
volumes:
persistent:
After sets the configuration accordingly, now its time to build our project and setup the web server using the following command.
docker-compose up -d
This may take some time, but you can see that all the service has started in the docker.
docker ps
Check the service to see if the service is working properly. You can see that our Apache server is working successfully on port 82.
Now letβs check the phpmyadmin server, whose username is βuserβ and the password is βtestβ
XAMPP is a free and open-source web server stack package, consisting mainly of the Apache HTTP Server, MariaDB database, and interpreters for scripts written in the PHP and Perl programming languages.
Configuring the web server lab on a window machine is quite easy. First we have to install the βXAMPPβ application from the official website. Once installed we have to click on the βStartβ button of the Apache and MySQL service.
Done ! Our web server is successfully deployed in the window machine.
A keen learner and passionate IT student. He has done Web designing, CCNA, RedHat, Ethical hacking, Network & web penetration testing. Currently, he is completing his graduation and learning about Red teaming, CTF challenges & Blue teaming.
The gau (Get All URLs) tool is a versatile open-source utility that collects URLs from…
Jsluice++ is a Burp Suite extension designed for passive and active scanning of JavaScript traffic…
Hey Folks :) !! In this tutorial, we will describe some of the techniques commonly…
Hey Folks :) !! In this article, we present the "Termux Cheat Sheet for Hackers"…
Amid the rapid advancement of technology, the significance of human involvement in cybersecurity frequently goes…
Hey Folks, we are back today after such a long break, but don't worry we…
This website uses cookies.
View Comments