Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts

Cache-Control Header: ie7

Not all the combinations of Cache-Control headers are supported by ie7. See

http://faindu.wordpress.com/2008/04/18/ie7-ssl-xml-flex-error-2032-stream-error/

Apache Server Variable Definition

http://www.zytrax.com/tech/web/env_var.htm

Apache2 mod_rewrite module

The environment variables and syntax are documented here. $N are the regexp matches on RewriteRule and %N are the ones from RewriteCond.

Apache2 mod_cache

The setup instructions can be found here. However, I noticed my CacheRoot is always empty. After I turned on Loglevel debug. I notice there was a permission problem "mod_cache.c: (13)Permission denied". Just have to make the permission corrent and it then worked...
# chown apache.apache /tmp/cache/httpd/
# chcon -t httpd_sys_content_t /tmp/cache/httpd/

Apache2 Connection Timeout

Sometimes I can not connect to my server, I found out that it is related to net.ipv4.tcp_tw_recycle=1. I do not understand why as this is recommended setting for server....

Here says it should be disabled http://kbase.redhat.com/faq/FAQ_80_6180.shtm

Enable mod_dumpio on Apache2

Use the following configuration:
LoadModule dumpio_module modules/mod_dumpio.so
LogLevel debug
DumpIOInput On
DumpIOOutput On
#DumpIOLogLevel can be set optionally
#DumpIOLogLevel debug

Check Apache2 Config Syntax

# httpd -t
Syntax OK

tcpdump http traffic

tcpdump  -s 0 -i eth0 dst or src host mydomain.com  and port 80
tcpdump -A -s 0 -i eth0 dst or src host mydomain.com and port 80
other commands
tcpdump src 192.168.11.200
tcpdump src 192.168.11.200 and port tftp
tcpdump -n dst 192.168.11.1 and udp
tcpdump -n dst 192.168.0.1 or  dst 192.168.0.10 and udp # display ip
tcpdump -nn dst 192.168.0.1 or  dst 192.168.0.10 and udp # display both ip and port
tcpdump -nn ip multicast  and not broadcast
see also http://www.rationallyparanoid.com/articles/tcpdump.html

Add SSL Certificate from Startcom to Apache

Get free certificates(3 files) from Startssl.com and modify the following:
SSLCertificateFile /etc/pki/tls/certs/mydomain.com.crt      #generated by startcom
SSLCertificateKeyFile /etc/pki/tls/private/mydomain.com.key #generated by startcom
SSLCACertificateFile /etc/pki/tls/certs/startcom.bundle.crt #downloaded from startcom

Configure Squirrelmail

Change domain in /etc/squirrelmail/config.php:
$domain = 'mydomain.com';
so the email received will have user@mydomain.com

To use https on apache, add the following to /etc/httpd/conf.d/squirrelmail.conf:
<Location /webmail>RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{HTTP_HOST}:443%{REQUEST_URI} [QSA,R=permanent,L]
</Location>


Finally, selinux settings:
setsebool -P httpd_can_network_connect=1

Apache2 and Lighttpd

Which one should I use? Use lighttpd for static content like .html and apache for dynamic content like php.

Static Contents:
In my testing, lighttpd (1.4.19) can support at least 1.5 times as many connectoins as apache2 (2.2.9) could.

Dynamic Contents:
With php, they are about the same.

Configurations:
I found apache2 easier to configure than lighttpd. Compression support is better with apache2 than lighttpd.