Apache Web Server, how it works?

Click For Summary

Discussion Overview

The discussion revolves around understanding the low-level workings of the Apache Web Server, including its architecture, functionality, and the complexities involved in grasping its operation. Participants explore various resources and approaches to learn about Apache, touching on both theoretical and practical aspects.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • Some participants express a desire to understand Apache at a low level, questioning if pseudocode or minimal code examples exist.
  • One participant argues that Apache is too complex to be summarized in pseudocode and suggests looking at the source code and documentation for deeper insights.
  • Another participant describes the basic operation of Apache, noting that it listens on port 80 and handles connections through forking and configuration files.
  • It is mentioned that understanding the HTTP/1.0 and HTTP/1.1 standards is crucial for comprehending Apache's functionality.
  • Some participants suggest starting with simpler HTTP server implementations to grasp the fundamental concepts before tackling Apache's complexity.
  • One participant humorously notes the difficulty of mastering Apache, indicating it may take months to fully understand.

Areas of Agreement / Disagreement

Participants generally agree on the complexity of Apache and the importance of foundational knowledge in HTTP standards. However, there are differing opinions on the feasibility of summarizing its workings in pseudocode and the best approach to learning about it.

Contextual Notes

Participants highlight the need for advanced programming skills to delve into Apache's code, and some emphasize the importance of starting with high-level concepts before attempting to understand its internal workings.

Who May Find This Useful

This discussion may be useful for individuals interested in web server architecture, those learning about HTTP protocols, and programmers looking to deepen their understanding of Apache and similar projects.

mishima
Messages
576
Reaction score
43
Hi, I have recently been using Apache for a web server. I would like to know more about how it works on a low level, what exactly it does. Perhaps a pseudocode, or minimal code version exists somewhere?
 
  • Like
Likes   Reactions: harborsparrow
Computer science news on Phys.org
mishima said:
Hi, I have recently been using Apache for a web server. I would like to know more about how it works on a low level, what exactly it does. Perhaps a pseudocode, or minimal code version exists somewhere?

I didn't think that you can found such a thing anywhere, to be honest.
Apache is a large software complex and its functions just can't be described shortly with some pseudocode.

You can take a look at the apache docs where minimal apache internal structure is described.
Take a look here about some info about apache config and overall configuration too, may be it will help.
 
  • Like
Likes   Reactions: harborsparrow
Basically it opens up port 80 (usually) and listens for connections. When it receives a connection, it forks the port and keeps the connection while it calls whatever program it's supposed to use to handle the request. It uses the conf.d files to determine what to do with what request.
 
  • Like
Likes   Reactions: harborsparrow
Apache implments the HTTP/1.0 and HTTP/1.1 standards, so in order to understand what it's doing, you first need to understand those standards. Google them. They aren't easy to read at first, but if you continue plugging through them, you'll understand what web servers and web browsers are really doing. Very worthwhile and illuminating. I wouldn't recommend looking at Apache code unless you first understand the standards which it is implementing.
 
mishima said:
I would like to know more about how it works on a low level, what exactly it does

In order to get down there, begin at a high level meaning protocols, ports, requests, responses and the like, as has already being mentioned. If you like web development then you are on the right track. In order to get at its inner workings, you must first be an advanced programmer. And then, you'll focus on certain parts of code or modules, because the whole project is more than huge. It is very fascinating to get involved in this project some day and the same goes for the other Apache projects besides Apache Web Server, too.
 
  • Like
Likes   Reactions: harborsparrow
Note the OP was way back last October. :oldwink:

Nevertheless... if your goal is more in the direction of learning about HTTP servers in general (Apache being merely the 600-pound gorilla in that field), it might be useful to start by studying a very stripped-down HTTP server instead of Apache with all its bells and whistles. Typing "tiny http server" into Google leads G's autocomplete function to suggest "tiny http server c", "tiny http server java", "tiny http server python", etc. Substitute whatever language you're familiar with and you might get something useful as a starting point.

I thought of trying this search because I remembered seeing in a Perl book years ago when I was learning Perl, a code example that was a "tiny HTTP server".
 
  • Like
Likes   Reactions: harborsparrow and QuantumQuest
Apache is a jungle. You will need a few months to understand it. Good luck
 
  • Like
Likes   Reactions: harborsparrow

Similar threads

Replies
7
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
11
Views
2K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 17 ·
Replies
17
Views
3K
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K