LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-20-2005, 06:45 PM   #1
KrGAce
Member
 
Registered: Dec 2004
Location: Vermont
Distribution: Ubuntu
Posts: 58

Rep: Reputation: 15
Need to add directory to Apache


Hello,

I am using SUSE 10.0 and running my web page on Apache. I also teach computers at a community college and the class has files that the class can use with their homework. My problem is I want to add a directory such as http://mydomain.com/ccvfiles that would list a directory of the 4 folders, and each folder would contain their files for them to download. My question is how do I add this directory in Apache? If I go to my domain.com/ccv files now (I have added this folder) it tells me access denied. I appreciate all help in advance.

I use Apache through Yast, and then Network services/http server.



Thanks again,



AceMan
 
Old 10-20-2005, 07:56 PM   #2
Moloko
Member
 
Registered: Mar 2004
Location: Netherlands
Distribution: Debian
Posts: 729

Rep: Reputation: 30
Sounds like a simple access rights problem. Check the permissions on the folder.

Btw, is http://mydomain.com/ccvfiles supposed to be a sub domain or a regular folder?
 
Old 10-20-2005, 08:24 PM   #3
KrGAce
Member
 
Registered: Dec 2004
Location: Vermont
Distribution: Ubuntu
Posts: 58

Original Poster
Rep: Reputation: 15
just a regular folder. I checked permissions and it said "Read only" I changed that, but nothing. I almost think I have to add it in Apache, but I don't know where.



AceMan
 
Old 10-20-2005, 08:36 PM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
The Apache config file has nothing to do with it. Every directory below the root of the site should be visable. You can't "hide" a directory without setting that up in the configs. It is most certainly a permissions issue. If you have apache running as the default user, which is www-data, you may have changed the permissions for the owner, and if that isn't www-data, it won't work. Check who owns the directory, and all the permissions surrounding it.

The config file is most likely /etc/apache(2?)/apache2.conf.

Peace,
JimBass
 
Old 10-20-2005, 08:45 PM   #5
KrGAce
Member
 
Registered: Dec 2004
Location: Vermont
Distribution: Ubuntu
Posts: 58

Original Poster
Rep: Reputation: 15
It did say that the owner was root, and not the user. Is that the problem?




AceMan
 
Old 10-20-2005, 09:09 PM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
The owner can be root, but then the 3rd group of permissions (others) should be allowed to read the files. I generally let whatever user apache is running as own the files in the website, but that is subjective and there are as many ways to do this as there are people using apache.

Peace,
JimBass
 
Old 10-20-2005, 09:25 PM   #7
KrGAce
Member
 
Registered: Dec 2004
Location: Vermont
Distribution: Ubuntu
Posts: 58

Original Poster
Rep: Reputation: 15
Still not working. I have set the group to users and the owner is the local user and I get this error....

Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

Error 403
 
Old 10-20-2005, 10:14 PM   #8
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
Well, you would of course have to have the HTML in place to render the pages. There are tons of php scripts that generate pages in situations like this. Or something like
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
 <head>
  <title>Index of /directory</title>
 </head>
 <body>
<h1>Index of /directory</h1>
<pre><img src="/icons/blank.gif" alt="Icon "> <a href="?C=N;O=D">Name</a>                    <a href="?C=M;O=A">Last modified</a>      <a href="?C=S;O=A">Size</a>  <a href="?C=D;O=A">Description</a><hr><img src="/icons/back.gif" alt="[DIR]"> <a href="/">Parent Directory</a>                             -   

<img src="/icons/folder.gif" alt="[DIR]"> <a href="folder1/">folder1/</a>                    22-Sep-2005 15:02    -   
<img src="/icons/folder.gif" alt="[DIR]"> <a href="folder2/">folder2/</a>                17-Jun-2005 13:40    -   
<img src="/icons/folder.gif" alt="[DIR]"> <a href="folder3/">folder3/</a>                   23-Jun-2005 17:35    -   
<img src="/icons/folder.gif" alt="[DIR]"> <a href="folder4/">folder4/</a>               19-Oct-2005 13:26    -   
<img src="/icons/folder.gif" alt="[DIR]"> <a href="folder5/">folder5/</a>                19-Oct-2005 13:43    -   

 
<hr></pre>
<address>Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-16 mod_ssl/2.0.54 OpenSSL/0.9.7e Server at somesite.somplace.gov Port 443</address>
</body></html>
Peace,
JimBass
 
Old 10-20-2005, 11:07 PM   #9
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Make sure the directory where ccv points has a permissin of 755 or 750 for security. Check the logs where apache writes to. Usually it will be in /var/log/apache or /var/log/apache2. The log will give you some information why it is giving you permission denied. Probably apache is trying to open a directory but it is no where to be found. It is better that you edit the apache config by hand instead a useless GUI program doing it for you. Also you need to make you set the permission in apache correctly. Apache will create an html page of the directories and files if it is configured properly, so no need to write a fancy PHP or PERL file to do this.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Directory Listing Of NFS Mount, cannot view directory list via apache luqmana Linux - Networking 2 12-19-2005 07:03 AM
I need to add a directory to the search path johnjafa Linux - Software 1 01-06-2005 02:43 PM
How to add a directory to PATH permantely paulmedic555 SUSE / openSUSE 1 11-12-2004 04:58 PM
how to add a directory from the console FuGeE Linux - General 1 08-06-2003 01:52 PM
Redhat 9 - How do I uninstall apache + how do I add apache to autostart? praefex Linux - Software 2 07-29-2003 01:21 PM


All times are GMT -5. The time now is 10:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration