Tutorials Build Server #2 || How To Configuration Web Server in Debian Linux || Bagaimana Cara Mengkonfigurasikan Web Server di Debian Linux

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@fandimuhammad11·
0.000 HBD
Tutorials Build Server #2 || How To Configuration Web Server in Debian Linux || Bagaimana Cara Mengkonfigurasikan Web Server di Debian Linux
![ka.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515602251/oagxobs92njgea52uu28.jpg)

**What is a Web Server ?**

**Web server** is software that service to receive HTTP or HTTPS request from client which have been familiar with web browser and refill result in web pages which generally **HTML** document.
Before we configure the **web server** make sure we have installed **Ip Address** and **Dns Server**.

as an example :
here we use DNS server **pnl.ac.id**
and Ip address **192.168.100.1**

And now we will discuss how to configure the web server.
The steps:

Install the package used for the web server configuration is apache2 :
> apt-get install apache2

![2.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515553670/cistsxvhjcit1zeykoq7.png)
If there is confirm **Y / N**, then type **Y** then enter

Next go into the folder **/etc/apache2/sites-available/default** that we will change into a web server.
We can use the command :
> nano / etc/apache2/sites-available/default

![3.1.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515555161/asccf7kba1drxzlhbgz5.png)

In this file:
Replace,
> ServerAdmin webmaster @ localhost

![4.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515556745/yk9jwm9ite9fayi1uy1l.png)

with the domain we created,

> ServerAdmin webmaster@pnl.ac.id

![5.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515557418/ol4zz8gfi7w8xyylie1i.png)

When finished editing then save the file with :
>  Ctrl + X> Save> Enter

Then move to  **/ var / www /**  directory folder with the command:
> cd /var/www

![6.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515558424/gdluzffvqenjp2gwyqfs.png)

Then we open the ad file in **/ var / www/**  by using:
> ls

![7.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515559489/ikrf9rjiogyyx7m2lhrg.png)

In this folder there is a file : **index.html**
Then we create a new folder for  **/web**  where we use for the server web page later.
by using the command:
> mkdir web

![8.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515559879/kaxqybvir1lmorkivfsx.png)

Next to copy file: **index.html** in the folder **/ var / www /**  to folder  **/ web /**  that we have created. 
Can use the command:
> cp index.html web/index.html

![9.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515560228/v8cydlisbz0atpdko2so.png)

Then we go back to folder **/etc/apache2/sites-available/default** 
We can use the command :
> nano / etc/apache2/sites-available/default

![3.1.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515561206/cawaexndkd8voenhexin.png)

and then edit Document Root :
> /var/www 

![5.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515560925/avliy8mqjbwwtmi56jtk.png)

then edit to : 
Servername www.pnl.ac.id (dns server)
> /var/www/web

![3.2.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515562135/rgckcxn59pf8levco6c0.png)

When finished editing then save the file with **Ctrl + X> Save> Enter**
Next we go into the folder **/web** that will be used for the web server :
> cd /web

![111.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515562913/l6ajf283dszpf1zaiwfv.png)

Then into file **index.html** that we will make as a web page.
> nano index.html

![11.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515563254/nd34irnckra2ob9pmeci.png)

On the **index.html** page is still the default view, then here we can edit it as we want to be used as web server view.

![12.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515563790/mfkgtdpy1no8sl8gnlbx.png)

Then this is an example of a simple web page that has been edited, maybe here you can develop it again as you wish.

![13.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515564111/samywlxwrc9sokcgz4oa.png)

Then save the file we have edited. 
> Ctrl + X> Save> Enter

Then after we configure and then we restart the web server.
we can use the command :
> /etc/init.d/apache2 restart

![15.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515565166/wybrj4rdv3hpbcf4nhyi.png)

**Testing web server on linux** :

Because on debian linux we use Command Line display,  we have to install the **Lynx** package to test the **web server**. 
We can install **lynx** with command:
> apt-get install lynx

![16.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515565923/m5ba1xl5lje2ii1wsrdl.png)

Then to test it on linux we can use the command :
> lynx www.pnl.ac.id 

![17.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515566333/k1fyxogjf7zuxsmh1ihu.png)

If this display appears in linux debian then the web server that we have successfull.

![18.PNG](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515566607/v8fq94algmrljv5iiufo.png)

**Testing web server on Client (Windows)** :
before testing it on the computer we have to make sure that the client computer is connected to the web server

then open using Google Chrome web browser on windows, then fill in ip address web server on search **192.168.100.1** 

![24.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515568837/uhcxkhvqflh1xgsqxn1k.png)

















<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@fandimuhammad11/tutorials-build-server-2-or-or-how-to-configuration-web-server-in-debian-linux-or-or-bagaimana-cara-mengkonfigurasikan-web">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍 , , , , , , , ,