Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Apache Web Server, how it works?

  1. Oct 4, 2015 #1
    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?
  2. jcsd
  3. Oct 4, 2015 #2
  4. Jun 18, 2016 #3
    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.
  5. Jun 23, 2016 #4
    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.
  6. Jul 2, 2016 #5


    User Avatar
    Gold Member

    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.
  7. Jul 3, 2016 #6


    User Avatar
    Science Advisor
    Gold Member

    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.
  8. Jul 3, 2016 #7


    User Avatar
    Science Advisor

  9. Jul 3, 2016 #8


    User Avatar

    Staff: Mentor

    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".
  10. Sep 5, 2016 #9
    Apache is a jungle. You will need a few months to understand it. Good luck
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted