Generally, I update web pages over ssh session. The problem is that vim creates a backup files ended with a diacritical mark (~).
Some other open source software use .inc extensions of php and other include for code. However, lighttpd comes with nifty module called mod_access module which is used to deny access to files with given trailing path names.
Open lighty's config file:
# vi /etc/lighttpd/lighttpd.conf
Append or add mod_access (if it is not added) :
server.modules += ( "mod_access" )
Next append rule that deny access to files with given trailing path names (~ and .inc):
url.access-deny = ( "~", ".inc" )
Save and close the file. Restart lighttpd:
# /etc/init.d/lighttpd restart
Now if end users try to open .inc or other trailing path names he/she will get error 404.
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- 10 Greatest Open Source Software Of 2009
- My 10 UNIX Command Line Mistakes
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
- Email this to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: Oct/9/2006



{ 2 comments… read them below or add one }
Hey thanks dude
this tutorial really helps me a lot.
If you want to block access to an entire directory and its sub directories you can do
$HTTP["url"] =~ “^/directorynamehere/” {
url.access-deny = ( “” )
}