Apache Web Server 2.
0 LDUP : 2
=============================================================================
=============================================================================
01. Introduction
to Apache
=============================================================================
=============================================================================
* Check what your Apache build contains :
# httpd -V
Server version: Apache/2.0.40 <================
Server built: Feb 25 2003 05:01:56
Server's Module Magic Number: 20020628:0
Architecture: 32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork" <================
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
# httpd -v
Server version: Apache/2.0.40
Server built: Feb 25 2003 05:01:56
Is our server a static or dynamically built one?
If static, which modules are compiled in statically ?
# httpd -l
core.c
prefork.c <---------- pre-fork MPM and ours is a hardcore dynamic
http_core.c server with DSO capability
mod_so.c <---------- DSO capability has to be statically built into
the binary
Dont' forget --enable-so as a configure option
* Always install from src code and rpm -e the distribution Apache
or better still
* do a min install then install the src
including the C Compiler -
* Try to build a server as static as possible for speed/security
1. httpd 1.3 from 7.2 onwards
2. httpd 2.0 from 9 onwards
3. Free, modular, open source, fast, easy to configure
4. Web Server : Serves HTML pages/content [dynamic - CGI -Common GW Interface]
a. Accept network connections from browsers
b. Retrieve content from disk
c. Run local CGI programs
d. Transmits data back to Clients
e. Be as fast as possible
APACHE SERVER CONFIGURATION
Apache config file : /etc/httpd/conf/httpd.conf
Apache Document Root : /var/www/html
Apache Documentation : /var/www/html/manual
http://www.ganesh.com/manual
Apache manual pages : /usr/share/man
Apache Startup script : /etc/rc.d/init.d/httpd [use HUP to refresh]
Apache Binary : /usr/sbin/httpd*
Apache Utilities : /usr/bin/htpasswd*, etc
Apache modules : /etc/httpd/modules (where the modules stay,
which enables the server-side programmer to do
programming in the languages supported by web server)
Server Log Files : /var/log/httpd/access.log , error_log
Lock File : /var/run/httpd.pid
Contains the PID of Apache parent process
Browsers :
========
lynx -dump www.ganesh.com - resolves via : /etc/host.conf
links /etc/nsswitch.conf
elinks Either uses /etc/hosts or DNS or NIS or LDAP
konqueror
evolution
galeon
mozilla
opera
Checking : telnet vashilinux.org 80
GET / or HEAD /
To refresh Apache : # killall -HUP httpd
[Change Listen 80 to 8080 and check with netstat]
Webalizer : http://localhost/usage - Analyzes logs in /var/www/html/usage
Manuals : : http://www.ganesh.com/manual - For the Apache manuals
Analyzing the Apache Transfer log file : Analog - www.analog.cx
AWStats - awstats.sourceforge.net
**************************