Apache Web Server

About Apache...


Apache HTTPD is a web server that will run on any os but was designed for unix. It wsa originally based on NCSA HTTPd server but has since been rewritten. Currently a large majority of the web runs on the Apache server.

The name is taken from the native american Apache Indian due to thier supirior warfare skills.

Apache Web Server
  • Is Modular...
  • more secure...
  • serves up static pages faster...
  • works better on port 80 in linux.
Tomcat
  • is a servlet container...
  • ... easier to work backend stuff...

Apache defaults to port 80, Tomcat port 8080.

While Apache is better (faster) at serving up web pages, it is not a servlet engine. Tomcat is.

CREATED 2012-11-26 19:26:10.0

00-18-54

UPDATED 2012-11-26 21:43:10.0

Features...


Apache is a module based server. It has a set of core modules but can be extended with the inclusion of other module through configuration. There are many modules for the Apache server to support languages, authentication, security, compression, to name a few of the catagories of modules.

Apache supports Virtual Hosting. This allows many different web domains to be serviced by the same server. For example: Example.com and MySite.com can be serviced by one server due to virtual hosting.

Apache also features configurable error messages, real authentication databases, content negotiation, password authentication, digital certificate authentication, has a built in search engine, HTML authorizing tool and supports ftp. In addition there are several GUI's that support Apache.

CREATED 2012-11-26 21:44:43.0

00-18-59

UPDATED 2012-11-26 21:44:59.0

Performance...


The Apache Software Foundation didn't set out to make the fastest server. However, it is very comparble to the top servers (i.e. Microsoft IIS and nginx), however, Apache dominates over 50% of the top 1 million web sites for a reason.

Rather than using a single archetecture Apache uses MultiProcessing Modules (MPM) which allows it to mix of process, thread and event based architectures to better meet the demands of different architectures.

CREATED 2012-11-26 22:06:48.0

00-18-5A

UPDATED 2012-11-26 22:06:59.0

Windows File Structure


As always the windows file structure puts all the files in one neat little structure under C:Program FilesApache Software FoundationApache2.2. This is a list of the directories under that root.

  • apps
  • bin
  • cgi-bin
  • conf - configuration files
  • error - error pages that will be served up when there is an error.
  • htdocs
  • icons
  • include
  • lib
  • logs
  • manuals
  • modules

CREATED 2012-11-26 19:34:13.0

00-18-55

UPDATED 2012-11-26 19:34:28.0

Linux File Structure


In linux apache files are scattered all over the place... because that's linux. It's not windows. Therefore not everything is stored in one neat structure like it is in windows. But then again windows is alot slower than linux. Files in linux are stored in the system based on what they do. Unfortunately, one could not use Tomcat as a model as a guide because Tomcat and Apache are very different. So this is a guide to where everything is at. Remember that when configuring servers, files can be stored anywhere if the configuration is correctly implemented...

  • apps
  • bin
  • cgi-bin
  • conf
  • error
  • htdocs
  • icons
  • include
  • lib
  • logs
  • manuals
  • modules

CREATED 2012-11-26 19:34:32.0

00-18-56

UPDATED 2012-11-26 19:34:39.0

What is an upstream source?


An upstream server is a server that serves servers. Try saying that 10 times fast. Therefore when Apache2 is receiving http requests and handing those requests to Tomcat, the Apache Web Server is an upstream server. Just thought you would like to know.

CREATED 2012-11-26 21:14:02.0

00-18-57

UPDATED 2012-11-26 21:14:13.0

The MPM...


MPM Worker defined

. Is a hybrid processor that uses a combonation of processes and threads to service requests. This brings both stability and throughput to the table. In normal process based servers, processed are individual elements that occupy seperate address space while thread based servers use less memory because threads occupy the same address space. Apache uses individual processes each having their own threads to process requests. Capatalizing on the stability of process servers and the performance of thread servers. Multi Process Module (MPM)

  • ThreadsPerChild - the total number of threads created by each process
  • MaxClients - total number of threads that may be launched

CREATED 2012-11-26 21:21:44.0

00-18-58

UPDATED 2012-11-26 21:21:51.0

CustomLog


CustomLog syntax

  • CustomLog - The directive... duh
  • Path - the path and file name
  • Fomat - the nickname of the format.

CustomLog ${APACHE_LOG_DIR}/access.log Combined

CREATED 2017-04-23 19:29:31.0

00-29-B1

UPDATED 2017-04-23 19:29:49.0

Order Deny,Allow


The Order statement controls the order of "access" directive processing i.e. which of the access directives gets processed first, Allow or Deny. Apache access control is a three pass system. Determine the order, process the directives in the first order, then process directives in the second. The latter directive is the default.

This whole paradigm has changed in version 2.4. Instead of using the Allow/Deny directives we now use the Require directive. Example: to restrict access to certain IP addresses use:

Require ip 192.168.1.1

It will also accept partial ip addresses... eg: 192.168

To Allow all...

Require all granted

To Restirct all...

Require all denied

CREATED 2017-04-24 10:25:42.0

00-29-B3

UPDATED 2017-04-24 10:25:58.0

Handy Commands


The apache apachectl or apache2ctl commands are the best for finding information on what the heck apache is doing now.

To list all currently running hosts...

apachectl -S

CREATED 2021-02-14 10:53:36.0

010-00-05-72

UPDATED 2021-02-14 10:54:00.0

Knowledge

Apache2.2 Docs
CoreDirectives
L
I
N
K
S

DBID: db.wam

Page Server: Ithica

©2012 Leistware Data Systems

      Hello anonymous