Linux Blog

Apache “Directory index forbidden by Options directive:”

Filed under: Quick Linux Tutorials — TheLinuxBlog.com at 9:29 pm on Friday, June 27, 2008

This is a common problem with the Apache web server. It is considered a security risk to show the directory contents by default. Especially those in the root directory. The way to fix this is pretty simple, you first need to make sure that there are no -Index directives in any of the configuration files. In your httpd configuration directory grep with a line number for Options like so:

grep -n Options *

If you don’t see any -Indexes then its possible there are included files. Check these directories if you know them, if you don’t grep your configuration file for the Includes:

grep -n Include *

If you’re still getting the test page or a permission denied error after removing the directive that disables Indexes then it may be a permissions issue. Apache needs +x access for all users to enable directory listings. Change the permissions and it should work.

On Fedora there is a file called welcome.conf in the conf.d directory. This can be removed and if you have Options All set, then you should be good to go. On other distributions like Slackware it is easier to accomplish. I wouldn’t recommend allowing any sort of directory listing in a production environment but in my development case, where I only allow access to my test server on a per host basis this is not a big problem.

Also, remember to restart the server after making changes.

Hope this helps, if it doesn’t be sure to drop a comment!

Slackware 12 HAL fix

Filed under: General Linux — TheLinuxBlog.com at 9:15 am on Wednesday, September 5, 2007

HAL is short for Hardware Abstraction Layer. Its job is to make hardware work with minimal user interaction.
Unfortunately HAL on Slackware 12 does not work right out of the box.
While playing around trying to get HAL to work I was getting weired error messages such as:

File "/usr/bin/hal-device-manager", line 7, in
import pygtk
ImportError: No module named pygtk

and

A security policy in place prevent this sender from sending this message to this recipient, see message bus configuration file (rejected message had interface "org.freedesktop.Hal.Device.Volume" member "Mount error name "(unset" destination "org.freedesktop.Hal")

After doing some research I found that all that is needed to fix this to add your user name to the plugdev group in /etc/group
plugdev:x:83:youruser
If you have multiple users that need access to HAL then add all of those user names to the /etc/group file while your at it. Seperate them with commas as followed:
plugdev:x:83:userone,usertwo
For more information on the HAL project check out the HAL project page.