Apache

http://net.tutsplus.com/tutorials/apache-aliasing-and-redirection/
http://speckyboy.com/2012/06/18/using-the-power-of-the-htaccess-file-to-improve-wordpress-seo/
http://www.sitepoint.com/htaccess-for-all/
http://speckyboy.com/2012/07/26/what-is-htaccess/
http://net.tutsplus.com/tutorials/apache-2-advanced-configuration-on-unix-like-systems
http://www.instantshift.com/2012/08/21/how-to-get-the-most-out-of-your-htaccess-file
http://corz.org/serv/tricks/htaccess.php
http://apache.slashdot.org/story/12/02/21/1632230/apache-24-takes-direct-aim-at-nginx
http://net.tutsplus.com/tutorials/apache-2-basic-configuration-on-unix-like-systems/
http://net.tutsplus.com/tutorials/apache-2-advanced-configuration-on-unix-like-systems/
http://net.tutsplus.com/tutorials/other/password-protect-folders-in-seconds/
http://net.tutsplus.com/tutorials/other/an-introduction-to-apache/
http://net.tutsplus.com/articles/news/htaccess-files-for-the-rest-of-us/
http://net.tutsplus.com/tutorials/other/a-deeper-look-at-mod_rewrite-for-apache/
http://net.tutsplus.com/tutorials/other/using-htaccess-files-for-pretty-urls/
http://net.tutsplus.com/tutorials/other/5-fun-and-practical-htaccess-solutions/
http://net.tutsplus.com/tutorials/other/the-ultimate-guide-to-htaccess-files/

Proxy
Sending Apache Logs to Syslog

How to check if the configuration files are valid?

httpd -S

Virtual Host:

http://www.thegeekstuff.com/2011/07/apache-virtual-host/

How to set HTTP headers in .htaccess:

<FilesMatch "\.(html|htm|js|css)$">
FileETag None
<IfModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</IfModule>
</FilesMatch>

<FilesMatch "\.(html|htm)$">
<IfModule mod_headers.c>
Header set imagetoolbar "no"
</IfModule>
</FilesMatch>

How to start or stop apache using a different configuration file?

/usr/sbin/httpd -k start -f /etc/httpd/conf/httpd.conf
/usr/sbin/httpd -k stop -f /etc/httpd/conf/httpd.conf

How to start apache in single process mode?

/usr/sbin/httpd -k start -X -f /etc/httpd/conf/httpd.conf

Problem with single process mode and share memory
If you frequently restart your sandbox in single process mode, occassionally you may get an error "…". Here is how I clean up share memory segments:

ipcs -s | gawk '{ print $2 }' | grep -P '\d' | xargs -n 1 ipcrm -s

What is an MPM?
MPM stand for Multi-Processing Modules. It is a modular design / API that allow apache to be easily ported to a wide variety of platforms in a range of different environments. Different platforms and different environments often require different features, or may have different ways of implementing the same feature most efficiently. This design allows the webmaster to choose which features to be included in the server by selecting which modules to load either at compile-time or at run-time.

At the user level, MPMs appear much like other modules. The main difference is that one and only one MPM can be loaded into the server at any time. MPMs must be chosen during configuration, and compiled into the server. Compilers are capable of optimizing a lot of functions if threads are used, but only if they know that threads are being used. Different distribution (operating system) may provide different binaries for different mpm. For example, RedHat ES4 or Fedora Core 4 provide /usr/sbin/httpd.worker for the worker (threaded) mpm, and /usr/sbin/httpd for the prefork mpm.

How do I know which mpm is currently used?
From command line, you can specify -l option to either /usr/sbin/httpd or apachectl. From inside your code, you can call ap_mpm_query()

Dynamically configured mass virtual hosting
If you are following instruction from http://httpd.apache.org/docs/2.0/vhosts/mass.html to set up name-based virtual hosts, you must use the LogFormat directives mentioned. Not sure why, but haven't got time to verify.

Building debuginfo rpm
In order to build the debuginfo rpm for a particular rpm package, the src rpm of the respective package needs to be obtained. In this example, we will build the debuginfo rpm for httpd package.

up2date -d httpd --src --get (see the up2date man page) 
cd /var/spool/up2date 
rpm -i  *.src.rpm (and install any dependent packages if necessary) 
rpmbuild -bb /usr/src/redhat/SPECS/httpd.spec (This re-build the packages) 
cd /usr/src/redhatRPMS/i386 (the debuginfo rpm should be here)

How to redirect to https?

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

How to disable log rotation?

Search this wiki for information on how to forward the log file (via rsyslog) to another host, and delete appropriate file in /etc/logrotate.d

Other web servers:
Boa
thttpd
mathopd
tux
lighttpd
Nginx

Software load balancing:
mod_proxy
perlbal

Tools for load testing:
Web Application Stress Tool from Microsoft (free download), Tutorial
Flood
Jmeter
htperf

Other
http://www.spec.org/
Find out whether we can avoid logrotation if we use syslog (using the mailing list)
http://httpd.apache.org/dev/debugging.html
http://www.oreilly.com/pub/a/sysadmin/2006/10/12/httpd-syslog.html
https://lists.balabit.hu/pipermail/syslog-ng/2001-February/001208.html
http://www.precision-guesswork.com/sage-guide/apache.html
http://loganalysis.blogspot.com/
http://hostwisely.com/blog/top-5-alternatives-to-the-apache-web-server/

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License