
1 Shell Scripting
Viewing all httpd requests in realtime:
tail -f /var/log/*access*
Obtaining unique search engine referrers from an httpd log/combined file:
grep -h "search?" one0-com-access.log | gawk "{ print $ 11 }" | sort | uniq
2 Reverse Polish Lisp for the HP48SX
Mandelbrot function for built-in plot function:
Mandelbrot
@ function; returns color value for a given pixel (x; y)
@ global variable "maxcolor" and "maxiter" must be set
<< -> x y @ get pixel coordinates x, y
<< x y R->C 0 -> c i @ convert to complex c; init iteration counter
<< c @ place c as initial value of z on stack
DO @ start loop
SQ c + @ z := z**2 + c
UNTIL @ terminating condition:
DUP ABS 2 > @ check z for being greater than 2
'i' INCR @ increase and recall iteration counter and ...
maxiter > @ ... check it for being greater than maxiter
OR @ (ABS(z) > 2) OR (i > maxiter)
END @ end loop
DROP @ remove z from stack
i maxcolor MOD @ calculate and return pixel color value
>>
>>
>>
3 Apache Virtual Hosts
3.1 By Port Numbers
httpd.conf:
...
Listen 80
Listen 81
...
<VirtualHost _default_:80>
ServerAdmin webmaster@name1.com
DocumentRoot "C:/dat/www/name1.com/pub"
CustomLog "c:/dat/www/logs/name1.com-access.log" combined
ErrorLog "c:/dat/www/logs/name1.com-error.log
</VirtualHost>
<VirtualHost _default_:81>
ServerAdmin webmaster@name2.com
DocumentRoot "C:/dat/www/name2.com/pub"
CustomLog "c:/dat/www/logs/name2.com-access.log" combined
ErrorLog "c:/dat/www/logs/name2.com-error.log
</VirtualHost>
...
3.2 By DNS Names
httpd.conf:
...
Listen 80
...
NameVirtualHost *
<VirtualHost *>
ServerName dev.name1.com
ServerAdmin webmaster@name1.com
DocumentRoot "C:/dat/www/name1.com/pub"
CustomLog "c:/dat/www/logs/name1.com-access.log" combined
ErrorLog "c:/dat/www/logs/name1.com-error.log
</VirtualHost>
<VirtualHost *>
ServerName dev.name2.com
ServerAdmin webmaster@name2.com
DocumentRoot "C:/dat/www/name2.com/pub"
CustomLog "c:/dat/www/logs/name2.com-access.log" combined
ErrorLog "c:/dat/www/logs/name2.com-error.log
</VirtualHost>
...
hosts:
127.0.0.1 dev.name1.com
127.0.0.1 dev.name2.com
3.3 By DNS Names and Various Languages
httpd.conf:
...
<VirtualHost *>
ServerName dev.edelfoto.com
ServerAlias dev.www.edelfoto.com dev.de.edelfoto.com dev.en.edelfoto.com dev.es.edelfoto.com
ServerAdmin webmaster@edelfoto.com
DocumentRoot "C:/dat/www/edelfoto.com/pub"
ErrorLog logs/edelfoto.com-error.log
CustomLog logs/edelfoto.com-access.log combined
</VirtualHost>
...
|