Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Aug 03, 2013 5:05 pm 
Offline
Junior Member

Joined: Sat Nov 03, 2007 11:33 am
Posts: 32
I'm trying to set up a site to serve up files and which should allow browsing and directory listings. I have several virtual hosts already successfully running, but none of them serve up files. With this new site, I can't seem to get past the 403 problem. Here's an example log:

[Sat Aug 03 15:38:51 2013] [error] [client 1.2.3.4] Directory index forbidden by Options directive: /var/www/html/example.com/www/

Apache version:
[root@talyn html]# /usr/sbin/httpd -v
Server version: Apache/2.2.3
Server built: Jun 26 2013 10:33:42

Permissions appear to be correct:
[root@talyn html]# ll /var/www/html/example.com/
drwxr-x--- 2 me apache 4096 Aug 3 14:02 www

Modules are loaded:
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so

Here is the relevant portion of my httpd.conf:
<VirtualHost *:80>
DocumentRoot /var/www/html/example.com/www/
ServerName rpm.example.com
Options +Includes +Indexes
IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
Alias /icons/ "/var/www/icons/"
</VirtualHost>

-Indexes should not be overriding this anywhere. I know it is in welcome.conf, but I have commented out the entire contents.

If I place an index.html file in the web root it displays it, but not the directory. My understanding is that I should not need to have one in there, as mod_autoindex should generate the listing.

There are no .htaccess files in play. I don't use them at all.

What am I missing?


Top
   
PostPosted: Sat Aug 03, 2013 5:37 pm 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
Just a guess, but shouldn't those permissions be drwxr-xr-w ?

Since the last trio of permissions is "everybody", and your web visitors fall into the "everybody" group, you'll want them to be able to access the files in that directory.


Top
   
PostPosted: Sat Aug 03, 2013 6:32 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
I'm not spotting a misconfiguration, but a few suggestions.

You did reload Apache after making changes to the configuration, right? Maybe look at the error log to see if it complains about your configuration at startup.

The error specifically complains about the Options directive, so check through all the included config files to see if -Indexes appears anywhere.

The below are longer shots given the error message, but other possible things to look at.

The permissions look fine (accesses to the filesystem will be as the user/group Apache is running as). Double-check that the user/group "apache" is the correct one - for example, in Debian and Ubuntu, the user and group are named "www-data" instead. If necessary, change group ownership of the /var/www/html/example.com/www/ directory.

Perhaps one of the settings is causing trouble? Try commenting out the IndexOptions and IndexIgnore directives, reload Apache, and see if you at least get a basic index display.


Top
   
PostPosted: Sun Aug 04, 2013 12:14 pm 
Offline
Junior Member

Joined: Sat Nov 03, 2007 11:33 am
Posts: 32
Thanks for the replies, everyone. It turns out that the reason this wasn't working was because my "Options Indexes" was in the <VirtualHost> section when it needed to be in the <Directory> section.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group