Data Networking/Spring 2015/GROUP4/WEB-SERVER

From Wikiversity
Jump to navigation Jump to search

o configure and implement an Apache web server, the software of Apache server has to be installed.

But before installing the software, all the package updates available and supported by host Linux machine have to be installed.

To update all the available packages.

 sudo apt-get update

To install the apache web server on host machine

 sudo apt-get install apache2

When the web server is installed, a default html page is created in the local host which can be accessed by other hosts in the network.

To configure the web pages of the organization, html pages are created and placed in the default fetch directory /var/www. The pages in this path are fetched by the server when a http request is generated to the server.

 sudo nano /var/www/html/index.html

To implement the web server browse the localhost/IP address of the host from web browser of the server machine. Browser should be able to load the content of the configured web page of the server.

If the html pages which are to be accessed are located in /Directory path/, change the path from which the server fetches the contents.

 sudo nano /etc/apache2/sites-enabled/000-default.conf 

In this file, replace the default path from /var/www to /Directory path/, save the file.

Once the configuration is done, the webserver has to be started.

 sudo service start apache2

In case, if the server needs to be stopped

 sudo service stop apache2

The web server has to be restarted whenever configurations changes are made.

 sudo service restart apache2