1

I am fairly new to apache and was a SQL Server database admin in a former life so please forgive my ignorance. I am trying to set up an Apache web server (HP-UX flavor) to conform with the DOD STIGs required for this project. I have the following items configured within my httpd.conf file:

LoadModule dir_module modules/mod_dir.so DirectoryIndex dft_index.html 

Permissions on this dft_index.html file are 666 owned by root:sys and when I browse to http://myservername/dft_index.html the file comes up fine.

However when I try to browse to http://myservername/cgi-bin/ I receive a 403 error. The error log shows that the browser is trying to access the cgi-bin directory itself instead of redirecting to the dft_index.html file.

I have also tried to create a .htaccess file with DirectoryIndex dft_index.html and set AllowOverride = ALL with the same results.

1
  • Sorry for the cross post Tidalwave. New to these boards(as in I haven't needed to use them before) and did not know how they worked regarding the multiple boards. Thank you for correcting me and teaching me the rules. It was very helpful. Commented Feb 18, 2016 at 14:15

1 Answer 1

1

The DirectoryIndex directive does not control access to the directory's contents. Access/permissions are usually specified in the Directory items.

If you look at the error-log, e.g., /var/log/httpd/error.log (different with different systems), you might see an error with this message:

attempt to invoke directory as script 

for which the documentation says

This occurs when Apache is configured with ScriptAlias or SetHandler and a request is made for a directory path. The problem is that under those circumstances, all resources under a certain path are considered to be executable.

To get around this and allow DirectoryIndex to work again, use AddHandler with Options ExecCGI, or SetHandler in a <Files> stanza.

and it gives an example which you may find useful, by turning off the ScriptAlias, and restoring the equivalent using AddHandler cgi-script cgi pl within the Directory options.

1
  • Thank you Thomas. That's exactly what I'm seeing in the error log. I'll give this a try. Commented Feb 18, 2016 at 14:13

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.