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

vi /etc/lighttpd/lighttpd.conf

Find

Advertisement

server.modules              = (
#                               "mod_rewrite",
#                               "mod_redirect",
#                               "mod_alias",

and remove the comment # on “mod_alias” line. It should look like

server.modules              = (
#                               "mod_rewrite",
#                               "mod_redirect",
                                "mod_alias",

To add alias, add following in lighttpd.conf

alias.url = ( "/mrtg/" => "/var/www/mrtg/" )

If you need to add more, just use

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/

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement