LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need to add directory to Apache (https://www.linuxquestions.org/questions/linux-newbie-8/need-to-add-directory-to-apache-375222/)

KrGAce 10-20-2005 05:45 PM

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

Moloko 10-20-2005 06:56 PM

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?

KrGAce 10-20-2005 07:24 PM

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

JimBass 10-20-2005 07:36 PM

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

KrGAce 10-20-2005 07:45 PM

It did say that the owner was root, and not the user. Is that the problem?




AceMan

JimBass 10-20-2005 08:09 PM

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

KrGAce 10-20-2005 08:25 PM

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

JimBass 10-20-2005 09:14 PM

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

Electro 10-20-2005 10:07 PM

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.


All times are GMT -5. The time now is 03:07 PM.