Let's start with an example from an imaginary configuration file... <VirtualHost *:80> CustomLog /var/logs/httpd/vaccess.log vcommon UseCanonicalName Off VirtualDocumentRoot /var/www/html/%-2/ </VirtualHost> You'll first notice the "UseCanonicalName Off" core directive. This is mandatory for our purposes as it tells Apache to use the host name as requested by the client rather than a value set in a ServerName directive or devising one if it's absent. You'll also notice that all our sites' web documents must be in a sub-directory of /var/www/html . More important are the strange %-2 in the paths. This is a vhost instruction that allows us to extract a part of the host name and use it in the rewriting of the document path. The parts of the host name are determined by the '.' it contains. Thus, www.fekore.com has 3 parts. '%-2' means "extract the second to last part of the host name". Again using our example, suppos...
BLOG for DevOps, SYSTEM ADMNISTRATORS, Linux, Windows, Solaris, AIX, MAC and many more....