Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

httpd.conf - Can't Turn Indexes On in any directory

Status
Not open for further replies.

AarynC

Programmer
Apr 25, 2005
13
GB
Hiya,

OK, found plenty of posts searching this forum relating to the opposite of my problem, but couldn't get a reverse solution to work.

So I'm sure that this is just a simple thing I've missed or misunderstood.

I have a directory in my public_html directory that I plan to upload photos and movies to. At present there are 2 photos and a folder containing another 30 pics.

I want this folder and any folder under it to be viewable in a browser by anyone. The URL is
Now here is what I think is the important part of my httpd.conf file:

Code:
<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>

<Directory /domains/*/*/*/public_html>
    AllowOverride All
    Options IncludesNoExec ExecCGI
</Directory>

<Directory /home/*/*/*/public_html>
    AllowOverride All
    Options IncludesNoExec ExecCGI
</Directory>

<Directory /domains/*/*/*/public_html/_vti_bin>
    AddHandler cgi-script .exe
    RLimitCPU 40 40
</Directory>

<Directory /fs/home/*/*/*/*/public_html>
    AllowOverride All
    Options IncludesNoExec ExecCGI
</Directory>

<IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.shtml index.php index.php3 index.php4 index.php5 index.wml index.pl index.cgi
</IfModule>

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>

I have also placed an .htaccess file in the folder in question with nothing but "Options Indexes" written in it on the top line, with no white space.

Can anyone see what I'm missing from the above info?

Using Apache on a FreeBSD 4.8 server if it helps.

Thanks
Aaryn
 
Forgot to mention - The only thing I havn't tried yet is restarting apache. As I have never done this before.

No one else seemed to mention it in the other threads regarding httpd.conf changes.

Aaryn
 
AarynC,

If you have made any changes to your httpd.conf, you should restart Apache with the 'apachectl restart' command.

You should also test the syntax of your httpd.conf with the 'apachectl configtest' command.

If this still doesn't work out, please reply with the version of Apache that you have installed.

Wishdiak
A+, Network+, Security+, MCSA: Security 2003
 
Hi Wishdiak

Done as suggested - First did 'apachectl configtest' and got the message 'Syntax OK'

Then tried restarting using 'apachectl restart' and got the message '/bin/apachectl restart: httpd restarted'

No difference. You can check the link above if you like. Still I get no indexing.

Have not changed anything else since my last post.

Any ideas where I went wrong?

Aaryn
 
AarynC,

The error message that I get for the link above is:
Forbidden, perhaps you need to change the file permissions for this document or upload an index page.

This suggests that perhaps you need to change the folder or file permissions.

Wishdiak
A+, Network+, Security+, MCSA: Security 2003
 
Hi Wishdiak,

Folder permission whas the first thing I looked at. And I have just checked again.

The photo_upload folder is set to drwxrwxrwx and so is everything in it.

I thought this would allow absolutely anyone and everyone to have permission.

 
AarynC,

Have you restarted your Apache server since the last change?
'apachectl configtest' will check your httpd.conf for errors and 'apachectl restart' will restart Apache.

What does your Apache log file show?

Wishdiak
A+, Network+, Security+, MCSA: Security 2003
 
Try this. Try changing the owner of the files.
See what user apache is running under and do this.

chown apacheuser /ur/directory

chgrp apachegroup /ur/directory

 
I have a directory in my public_html directory that I plan to upload photos and movies to. At present there are 2 photos and a folder containing another 30 pics.

I want this folder and any folder under it to be viewable in a browser by anyone

Code:
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory "/domains/*/*/*/public_html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>
delete the .htaccess from that directory.
These will do what you want, if what you wrote is exactly what you want


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top