07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

11.2.3.2. Restricting Access<br />

The Allow from and Deny from directives control access restrictions for a directory (and its<br />

subdirectories, recursively).<br />

The Order directive tells the server of the order in which the Allow from and Deny from directives<br />

are applied; the last one that matches takes precedence. In concrete terms, Order<br />

deny,allow allows access if no Deny from applies, or if an Allow from directive does. Conversely,<br />

Order allow,deny rejects access if no Allow from directive matches (or if a Deny from<br />

directive applies).<br />

The Allow from and Deny from directives can be followed by an IP address, a network (such as<br />

192.168.0.0/255.255.255.0, 192.168.0.0/24 or even 192.168.0), a hostname or a domain name, or<br />

the all keyword, designating everyone.<br />

Order deny,allow<br />

Allow from 192.168.0.0/16<br />

Deny from all<br />

Example 11.20<br />

Reject by default but allow from the local network<br />

11.2.4. Log Analyzers<br />

A log analyzer is frequently installed on a web server; since the former provides the administrators<br />

with a precise idea of the usage patterns of the latter.<br />

The Falcot Corp administrators selected AWStats (Advanced Web Statistics) to analyze their<br />

Apache log files.<br />

The first configuration step is the creation of the /etc/awstats/awstats.conf file. The /usr/<br />

share/doc/awstats/examples/awstats.model.conf.gz template is a recommended starting<br />

point, and the Falcot administrators keep it unchanged apart from the following parameters:<br />

LogFile="/var/log/apache2/access.log"<br />

LogFormat = "%virtualname %host %other %logname %time1 %methodurl %code %<br />

➥ bytesd %refererquot %uaquot"<br />

SiteDomain="www.falcot.com"<br />

HostAliases="falcot.com REGEX[^.*\.falcot\.com$]"<br />

DNSLookup=1<br />

DirData="/var/lib/awstats"<br />

DirIcons="/awstats-icon"<br />

DirLang="/usr/share/awstats/lang"<br />

LoadPlugin="tooltips"<br />

All these parameters are documented by comments in the template file. In particular, the<br />

LogFile and LogFormat parameters describe the location and format of the log file and the<br />

Chapter 11 — Network Services: Postfix, Apache, NFS, Samba, Squid, LDAP<br />

273

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!