irc.freenode.net
www.apache.org/~rbowen
www.apache.org/history
1.3 maintainance will be ended in time
modules.apache.org - modules to do stuff...
users.httpd.apache.org
commercial support
www.covalent.net
1.3 - prefork model
1 parent, many children
prefork process to make sure enough children
2.0
prefork - as above
worker - children with threads
perchild - doesn't work yet - configure each child separately - good for different vhosts with different modules run, users
os-specifc - ?
http built on mime
request
map to file / handler
authentication
return to user
with mime header
major & minor type
text / html
image/gif
application/unknown - catchall
video/ mpeg
content-type: text/html
content-length
content-encoding: gzipped
content-language: cy
SSL
connection
exchange keys
request url
returns comntent
modules
core - standard modules
optional extras
write own modules
minimum - mod_mime, mod_dir mod_log_config (200k)
core does essentials and exposes API for modules to hook into
in phases
auth
content
logging
etc
any phase can be taken over by a module
mod_perl can do pretty much anything
apache under mod bsd license
apache runs on most anything - binaries avail for most
Installing
verify gpg --verify apache_1.3.28.tar.gz.asc
Unpack
tar -zxf a....gz
Compile
./configure --prefix=/usr/local/apache
checks sysytem, 1.3 short, 2.0 is verbose cos users autoconf
if not root binds to :8080, not 80
2.0 need to pick MPM (prefork, worker, etc) at build time, cant change later
make
make install (as root, if not root)
Start
apachectl start
Configure
configure all sorts
where modules go,
where files get put
includes other parts of dist not in apache dist - mod_perl, mod_ssl, PHP
or use package manager (keep sanity if using many)
***enable modules at configure***
multi modules on same line
1.3
./configure --enable-module=rewrite
2.0
./configure --enable-rewrite
*** help ***
./configure --help
./configure --show-layout
./configure --prefix=path/to/apache --show-layout
./configure --prefix=/usr/local/apache --enable-module=most --enable-shared=max
where nice ones load as dynamic shared modules
DSO - allows to add and remove when you want them
have to enable at compile time
mod_so - takes longer to start process up but really not much
use LoadModule, AddModule directives to enable particular modules at runtime
apache2.0 just addmodule
Building with mod_perl
tar-vzxf mod...gz
apache...gz
cd mod_perl
perl makefile
etc...
*** easier to use Apache toolbox ***
builds from source, uses light wrapper, downloads modules, checkbox, builds from source, shellscript
enable & disable just by typing number...
not avail for apache 2, yet...
1.5.67 is stable, 69 seems difficult with mod_perl
type 'go' to run all, downloads, checks, etc
**recommended**
Configuring
by text configuration files
main is httpd.conf
contains directives and containers
srm.conf , access.conf
- relics (ditched in 1.3.3, 1.3.7 onwards has blank file... not in 2.0)
srm - resource management
access - access control
.htaccess
per directory config files
**** controlled by allowoverride directive ****
options alls changing major server behaviour
allowoverride authconfig indexes
degrade performance, potential security risk
not cached - every served re reads
news docs
httpd.apache.org/docs-2.0/howto/htaccess.html
alternative is directory block
****MUCH better to have directives in conf.. !!!!****
include files
include / etc/httpd/other.config
make sure they are trusted locations
include directories
only in recent versions
include /etc/httpd/conf/vhosts
loaded alphabetically (dir listing order)
now recommended as - to stop mistakes with temp files
include /etc/httpd/conf/vhosts/*.conf
Directives
e.g.
directoryIndex index.html index.shtml
allowed only in correct context (in server config / htaccess file / virtual host block)
found in docs on apache.org - 2.0 docs always have an example
directives relative to serverroot
use quotes for non-alpha e.g. " " in WinNT
Containers
example
Allowoverride None
Options +Indexs
Addhandler handlername
example in file
SetHandler server-status
Comments
# something
Preconfigured systems
files go in some place, different for each distribution
Comanche
gui.apache.org
GUI config utility
back up files before doing this
IP based VHOSTS
unique IP address for each host
SSL works only under this setup
Name-based
SSL doesn't work for this
mod_vhost_alias
* Large number of vhosts, exactly the same configuration
VirtualDocumentRoot /usr/local/apache/vhosts/%0/htdocs
VirtualScriptAlias /usr/local/apache/vhosts/%0/cgi-bin
makes for www.bob.com
/usr/local/apache/vhosts/www.bob.com/htdocs
* New virtual hosts without changing configuration or restarting server.
* Can make directory structure arbitrarily complex
VirtualDocumentRoot /usr/local/apache/vhosts/%2.1/%2.2/%2.3+/htdocs
broken up to parts
for www.bob.com becomes
/usr/local/apache/vhosts/%2.1/%2.2/%2.3+/htdocs
b o b
http://apache13/mod/mod_vhost_alias.html
Starting apache
httpd -X
in single child mode