■ CONTENTS
xv
Scenario 3: Bad Permissions ..............................................................................................................220
Scenario 4: Bad Confi guration ............................................................................................................221
Scenario 5: Rewrite Rules ..................................................................................................................221
Scenario 6: Log Only Your Requests ...................................................................................................221
Important Tools for Web Administrators ....................................................................... 222
ping .....................................................................................................................................................222
traceroute ...........................................................................................................................................222
top ......................................................................................................................................................222
htop ....................................................................................................................................................222
atop.....................................................................................................................................................223
uptime ................................................................................................................................................223
free .....................................................................................................................................................223
ifconfi g or ip addr ...............................................................................................................................223
ulimit...................................................................................................................................................223
nslookup .............................................................................................................................................224
powertop ............................................................................................................................................224
iotop ....................................................................................................................................................225
iptraf ...................................................................................................................................................226
tcpdump .............................................................................................................................................226
WireShark ...........................................................................................................................................226
Nagios .................................................................................................................................................226
zabbix .................................................................................................................................................227
w .........................................................................................................................................................227
lsof ......................................................................................................................................................227
Common Pitfalls to Avoid.............................................................................................. 227
Chmod 777 .........................................................................................................................................227
Having Root Inside Location Block .....................................................................................................227
Using if Blocks ....................................................................................................................................228
Passing Uncontrolled Requests to PHP ..............................................................................................230
Rewrite Issues ....................................................................................................................................230
Using Hostname in Confi guration .......................................................................................................231