There is a common group of parameters which modify the server behavior. These clauses can be used inside either Directory configuration or Extension configuration directives.
Table of contents |
This configuration entry specifies how the server should generate the information it will send to the client. There are a long list of possible handlers: file, dirlist, common, redir, etc.
Directory /images { Handler file }
It is possible to specify a new DocumentRoot for a directory content.
For the first example, lets imagine we have already set the server DocumentRoot and there are some files inside /usr/share/icons we would like to export to the web environment to, for example, the /images directory. A configuration entry like this works in that way:
Directory /images { DocumentRoot /usr/share/icons }
This parameter lets you set up rules form allow access to the directory contents to some IP or IP ranges. The remote client IP will be checked with all the provided list and only if the IP matches with some of the rules the access will be allowed.
There are two possible entry types:
In the two cases, both IPv4 and IPv6 addresses are valid.
Allow access only from the IPv6 localhost address:
Directory /secret1 { Allow from ::1 }
Allow access from the 127.0.0.0/8 network:
Directory /onlylocal { Allow from 127.0.0.0/8 }
or it could also we written like:
Directory /onlylocal { Allow from 127.0.0.0/255.0.0.0 }
It is also possible to use lists instead of a single IP or network range. And ir is also possible to mix IPv4 and IPv6 addresses and networks if you want.
Directory /secreto { Allow from 192.168.0.0/16, ::1, 10.0.0.1, 3ffe:3200::/24 }