lighttpd mod alias
mod_alias lighttpd module allow you to map urls to file system. For example, you need /mrtg show /var/www/mrtg
You need to first enable mod_alias in lighttpd.conf
1 |
vi /etc/lighttpd/lighttpd.conf |
Find
1 2 3 4 |
server.modules = ( # "mod_rewrite", # "mod_redirect", # "mod_alias", |
and remove the comment # on “mod_alias” line. It should look like
1 2 3 4 |
server.modules = ( # "mod_rewrite", # "mod_redirect", "mod_alias", |
To add alias, add following in lighttpd.conf
1 |
alias.url = ( "/mrtg/" => "/var/www/mrtg/" ) |
If you need to add more, just use
1 |
alias.url += ( "/cgi-bin/" => "/var/www/cgi-bin/" ) |
Alias will allow you to access files/programs in the folder with url http://yourdomain-or-ip/mrtg/
See Lighttpd