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

in #utopian-io7 years ago (edited)

ka.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
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

In this file:
Replace,

ServerAdmin webmaster @ localhost

4.PNG

with the domain we created,

ServerAdmin [email protected]

5.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

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

ls

7.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

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

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

and then edit Document Root :

/var/www

5.PNG

then edit to :
Servername www.pnl.ac.id (dns server)

/var/www/web

3.2.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

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

nano index.html

11.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

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

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

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

Then to test it on linux we can use the command :

lynx www.pnl.ac.id

17.PNG

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

18.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



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Your contribution cannot be approved because it is not as informative as other contributions. See the Utopian Rules. Contributions need to be informative and descriptive in order to help readers and developers understand them.

You can contact us on Discord.
[utopian-moderator]