Click to See Complete Forum and Search --> : Quick Apache Question
MJCfromCT
01-26-2005, 11:26 PM
Hi all,
I have a FC3 server up and running with apache, configured for individual users webspace.
My problem is that when i go to http://location.of.server/~username/folder, i get a 403 forbidden error.
However, if i go to http://location.of.server/~username/folder/file_in_folder.txt, I am able to open it just fine. As far as I know, all the permissions for the files and folders are correct, but i'll be double-checking those. Any thoughts?
CompGeek01
01-27-2005, 08:40 AM
What type of page is the index? HTML? If it's anything other than that you need to add an extra index page declaration to your httpd.conf file.
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>
MJCfromCT
01-27-2005, 09:23 AM
Thanks for the reply. As of right now, everything is in HTML, but I should probably add index.php for in the future i'll probably be using it. To be more specific about the problem, I have a folder in my public_html directory called "work", in which I have numerous PDFs and text files. Right now there is no index.html or index.php file in the folder, just the PDF and text data. However, if I do add an index.html file, it will display just fine (but this defeats the purpose of viewing the folder contents) What i'd like to be able to do is browse that folder online and see a list of everything in it, much like what I can do here:
http://users.wpi.edu/~mattc/cgi-bin/images/hl2
CompGeek01
01-27-2005, 10:09 AM
Ahh, thats AutoIndexing
Do you have the mod_autoindex.c module loaded in the config file? It might be an issue with multiple users but that should work globally.
MJCfromCT
01-27-2005, 02:02 PM
I checked the httpd.conf and was able to find this line:
LoadModule autoindex_module modules/mod_autoindex.so
So it appears that I do have the autoindex module loaded. :confused:
CompGeek01
01-27-2005, 02:06 PM
You might try playing with the implementation a little. Weird that it doesn't work though. Does it work for directories that aren't under a user name? Like http://servername/?
http://httpd.apache.org/docs-2.0/mod/mod_autoindex.html
Is this apache2 or 1.3.x?
MJCfromCT
01-27-2005, 02:12 PM
Well i'll be, it does work for the default webspace, just not for individual users' webspace:
http://julius.res.wpi.net/stats/images/
And yes, this is apache 2.
It appears this is more than just a "quick question" after all :)
CompGeek01
01-27-2005, 02:23 PM
Haha, nothing is ever easy with Apache...I swear. One day I'll write a nice config program......they have some out there I'm sure of it.
Anyway, how did you make the users directories? Are they just created manually? I'd love to help more, but I never really got in to user management. They tend to annoy me heh.
MJCfromCT
01-27-2005, 02:33 PM
To create the user directories, I changed UserDir disable to UserDir public_html
Now for every user on the FC3 machine, there is a public_html folder for them, like /home/username/public_html
At first, I was having problems even getting this to work to begin with, but I eventually found this command:
chcon -R -t httpd_sys_content_t public_html
I ran this when I was at the end of my ropes, and fortunately, it worked (quite frankly i'm still not sure what it exactly does :) ). Now every user with an index.html file in their public_html folder can access it online. I was thinking that i would have to run that aforementioned command on the "work" folder inside my public_html folder, but when I try that, i get this error:
chcon: can't apply partial context to unlabeled file work
MJCfromCT
01-31-2005, 11:55 AM
And so my Apache problems continue :)
I'm not too familiar with .htaccess files, could using these in any way help out?
CompGeek01
01-31-2005, 12:19 PM
I've always used .htaccess to password certain directories that I don't want general access to. Do you want each user to have a proceted directory?
MJCfromCT
02-01-2005, 12:38 PM
Perhaps in the future, yes, but as of right now all i'd like is for Apache to autoindex the user directories so they can view the files :)
if you want to give anyone access to the files chmod the files to 777
chmod 777 * would give all files in a folder wrx to all users.
SysOpt.com
Copyright Internet.com Inc. All Rights Reserved.