How to set up an Apache server in 2 minutes

Here I have got, How to set up an Apache server in two minutes on most Linux distros

Welcome here But Let’s get straight into the point

Install Apache2

On Arch Linux

sudo pacman -S apache

On Ubuntu and Debian based distros

sudo apt install apache2

On fedora(Didn’t test it)

dnf install httpd

Configuration Of The Server

It has been one minute now, Let’s edit the configuration file
We need to edit /etc/httpd/conf/httpd.conf , I will use nano

sudo nano /etc/httpd/conf/httpd.conf

Two lines we need to look for:
The first one is Listen and replace it with Listen 127.0.0.1:80
The second one is DocumentRoot "default/path/to/html" and edit it to the path we need (eg. DocumentRoot "/var/www/html")
Now we’re almost done

Create Index.html file

Now in the path we choose create an index.html file and put this lines in it

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>HI</title>
    </head>
    <body>
        HI THERE
    </body>
</html>

and go to 127.0.0.1:80 on your browser, and done

it ‘Should’ be working, leave me a comment if it is
and as someone on the TV once said

Do it

Someone on TV

~ViloDium

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s