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
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
In this file:
Replace,
ServerAdmin webmaster @ localhost
with the domain we created,
ServerAdmin [email protected]
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
Then we open the ad file in / var / www/ by using:
ls
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
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
Then we go back to folder /etc/apache2/sites-available/default
We can use the command :
nano / etc/apache2/sites-available/default
and then edit Document Root :
/var/www
then edit to :
Servername www.pnl.ac.id (dns server)
/var/www/web
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
Then into file index.html that we will make as a web page.
nano index.html
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.
Then this is an example of a simple web page that has been edited, maybe here you can develop it again as you wish.
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
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
Then to test it on linux we can use the command :
lynx www.pnl.ac.id
If this display appears in linux debian then the web server that we have successfull.
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
Posted on Utopian.io - Rewarding Open Source Contributors
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]