Apache Web Server and How Web Server Works

What is Web Server ? and how Apache Web Server works in Linux ?

What is a Web Server?

  • Every Web site sits on a computer known as a Web server. This server is always connected to the internet. Web servers are computers that deliver (serves up) Web pages. Every Web server has an IP address and possibly a domain name.
  • A web server can mean two things ‐ a computer on which a web site is hosted and a program that runs on such a computer. So the term web server refers to both hardware and software.
  • A web server is what makes it possible to be able to access content like web pages or other data from anywhere as long as it is connected to the internet. The hardware houses the content, while the software makes the content accessible through the internet.
  • The most common use of web servers is to host websites but there are other uses like data storage or for running enterprise applications. There are also different ways to request content from a web server. The most common request is the Hypertext Transfer Protocol (HTTP), but there are also other requests like the Internet Message Access Protocol (IMAP) or the File Transfer Protocol (FTP).

How the webserver works:

Apache Web Server and How Web Server Works

  • The client’s browser dissects the URL into a number of separate parts, including address, pathname, and protocol.
  • A Domain Name Server (DNS) translates the domain name the user has entered into its IP address, a numeric combination that represents the site’s true address on the Internet (a domain name is merely a “front” to make site addresses easier to remember).
  • The browser now determines which protocol (the language client machines use to communicate with servers) should be used. Examples of protocols include FTP or File Transfer Protocol, and HTTP, Hypertext Transfer Protocol.
  • The server sends a GET request to the Web server to retrieve the address it has been given. For example, when a user types http://www.example.com/1.jpg, the browser sends a GET 1.jpg command to example.com and waits for a response. The server now responds to the browser’s requests. It verifies that the given address exists, finds the
    necessary files, runs the appropriate scripts, exchanges cookies if necessary, and returns the results back to the browser. If it cannot locate the file, the server sends an error message to the client.
  • The browser translates the data it has been given in to HTML and displays the results to the user.

Profile for Apache Server-

    • Use: Hosting a web site.
    • Package                  : httpd
    • Port                         : 80/httpd,443/https,8080/Admin port
    • Configuration Files :  /etc/httpd/conf/httpd.conf and /etc/httpd/conf.d/ssl.conf (https)
    • Document Root      :  /var/www/html
    • Daemon                  : httpd
    • Script                      : /etc/initd/httpd

Steps to Configure a simple Web Server

Step1: Install the package

The package for the apache web server is httpd.

# yum install httpd* ‐y

Leave a Comment

Your email address will not be published. Required fields are marked *