How to Configure Apache Server in Kali Linux [Video Tutorial]

In the article, I am going to cover how to configure apache server in Kali Linux, webserver apache in Kali Linux. Apache web server is similar methods are used in other Linux distribution. Simple commands can make an expert in using the webserver.  

Originally this post is written on Jun 11, 2014, and last updated October 2019. This article is not related to the cheap web server, web hosting, business web hosting, cloud hosting or any type of dedicated hosting service. This article defines only local webserver on Kali Linux for local Penetration testing.

What is an apache Web Server?

Web Server is a type of server, that delivers web pages to the clients as per their request. Every Websever has an IP Address and domain name for identification. Server Administrator can make local web server setup. Kali Linux has preinstalled the Apache webserver. But by default, it is not running.

Clients access the web pages through a Web browser like Google Chrome, Firefox, Safari, etc.

You need to enter URL or IP address into the address bar of the web browser and the page will be delivered by Web server scripting.

If you enter https://www.cyberpratibha.com/blog in the Address bar it will be served by Web Server.

How to Configure Apache Server in Kali Linux?

In Kali Linux, you don’t need to set up a web server because Kali Linux has a pre-installed apache server. Hacker uses this webserver to deliver a web page containing malicious code to the victim by the help of a local webserver or by doing port forwarding.

We can trap them by using social engineering method for example Phishing. There are others who use the HTTP service in penetration testing.

it manages dedicated web server capacity to deliver pages and have web server load balancing.

OLD Method to start Restart Apache2 web service

Use GUIs to Start Restart Apache2 web Server in Linux

It is the easiest way to start, stop and restart the Apache2 service in GUI mode. Select Applications from the top bar of the Kali screen, next sub-menu bar will be displayed, Select Kali Linux menu, another fly-out display bar will appear, then go on the services menu, again next fly-out menu bar will display, In this bar web service can be start, stop and restart.

Web Server In Kali Linux_image01

Once a selection happened, a command shell will open and the status of service will be displayed. When the Apache server has been started, the default page will be display by typing Attacker’s ip address in the web browser. IceWeasle is default web browser in Kali Linux distribution.

Note: GUI to start, stop, restart apache2 is not support in Kali Linux 2016.2 version.

Check the status of Apache server

Your first step to check the apache server is installed on your machine or not. Use the following command to check installed package apache2

apt list –installed apache2

root@kali:~#apt list --installed apache2
Listing... Done
apache2/kali-rolling,now 2.4.41-1 amd64 [installed,automatic]/
root@kali:~#

In the above result, you can see apache2 installed.

Next check the status of apache web server in Kali Linux. Use the following command to do that:

root@kali:~#service apache2 status
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; disabled; vendor preset: 
   Active: inactive (dead)
     Docs: https://httpd.apache.org/docs/2.4/
root@kali:~#

Press the “q” to exit command.

You can see in the result apache service status is inactive. If the service is inactive then you can access its web pages.

For example:

Open a web browser and type localhost/127.0.0.1 then hit enter.

You will get an error “Unable to connect”.

It means the webserver is not running on your Kali Linux machine. Now your next step to start the apache server.

Start, Stop and Restart the Apache webserver in Kali Linux

It is easy to start, stop and restart Web Server using the simple command in the terminal /etc/init.d/apache2 followed by requested action (stop, start or restart). Following commands are used
#/etc/init.d/apache2 start

#/etc/init.d/apache2 stop

#/etc/init.d/apache2 restart

Web Server In Kali Linux_image02

Another way to start, stop of restart Apache2 service by following commands

#service apache2 start

#service apache2 stop

#service apache2 restart

Web Server In Kali Linux_image03

The Default Web Page

Once the Apache service is up and running the default (It works!) page may need to be changed, to do this make the web content that ought to be shown on the page and spare it as index.html in the /var/www/ index. Then again, the current index.html document in this area could be modified what’s more new pages might be included.


Web Server In Kali Linux_image04

start, restart apache2 service in kali linux

start, restart apache2 service in kali linux

Posted by Q Hacker on Friday, April 21, 2017

MODULE 3:- Basics of Kali Linux

  1. Install Kali Linux on Hard drive with Full disk Encryption
  2. How to create Kali Linux bootable USB live in windows 10
  3. 20 basics about how to use Kali Linux
  4. 6 steps to change Kali Linux IP address (Easy)
  5. How to Add Kali Linux repository – With pictures
  6. How to update and upgrade Kali Linux to 2017.1
  7. apt-get package handling utility in Kali Linux
  8. How to use Linux debian package manager “dpkg”
  9. How to use Kali Linux SSH Server and client
  10. Start Restart Apache2 Web Server In Kali Linux

If Appreciate My Work, You should consider:

Vijay Kumar

Ethical Hacking & Penetration Testing Trainer, For more detail view My Profile

3 thoughts on “How to Configure Apache Server in Kali Linux [Video Tutorial]

  • October 24, 2016 at 10:07 am
    Permalink

    I upload wordpress to time linux 2016 (2016 linux time server, client win7), but I can not access clicking on win7: 192.168.100.1/wordpress (wordpress I put / var / www-data / wordpress

    Reply
  • February 10, 2017 at 7:51 pm
    Permalink

    […..] Staring apache2 (via systemctl): apache2.serviceJob for apache2.service failed because the control process exited with error code.
    See “systemctl status apache2.service” and “journalctl -xe” for details.
    failed!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *