[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apache question



Brune, Charlie said:
> Is there a way to tell Apache not to provide these directory listings?

There are two easy ways.  First, you can turn the feature off
globally by changing the line

    Options Indexes Includes FollowSymLinks

(line 439) in the default RH7 httpd.conf to

    Options Includes FollowSymLinks

or even

    Options None

if you are really paranoid.

The other option is to just make sure you have an index.html file
(even if it is zero-length) in every directory under DocumentRoot.
One easy way to do this would be with the following little script:

    for dir in `find /var/www/html -type d -print` ; do
      if [ ! -f "$dir/index.html" ] ; then
        echo -e '<html>\n</html>' > "$dir/index.html"
      fi
    done

(You can enter that directly on the command line, broken up just like
it is above.  If you aren't using Red Hat 7, then you probably want to
change /var/www/html above to whatever DocumentRoot is set to on your
distribution, i.e. /home/httpd/html on older Red Hat systems.)

Steve
-- 
steve@silug.org           | Southern Illinois Linux Users Group
(618)398-7320             | See web site for meeting details.
Steven Pritchard          | http://www.silug.org/
-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.