The workshop is designed to help you anticipate possible questions, review what you've learned, and begin learning how to put your knowledge into practice.



How would you avoid logging hits from a client accessing your Web site from a particular network?


In some situations, you may want to ignore requests coming from a particular network, such as your own, so that they do not skew the results. You can do this either by post-processing the logs and removing them or by using the SetEnvIf directive:

 SetEnvIf Remote_Addr 10\.0\.0\. intranet CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b" !intranet 

How can you log images to a different file?


Earlier in the hour, you learned how to avoid logging images. Instead of ignoring images altogether, you can easily log them to a separate file, using the same environment variable mechanism:

 SetEnvIf Request_URI "(\.gif|\.jpeg)$" image CustomLog logs/access_log common env=!image CustomLog logs/images_log common env=image 

Sams Teach Yourself PHP, MySQL and Apache in 24 Hours
Sams Teach Yourself PHP, MySQL and Apache in 24 Hours
ISBN: 067232489X
EAN: 2147483647
Year: 2005
Pages: 263

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: