You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by kohanm <ko...@gmail.com> on 2009/01/13 02:06:43 UTC

[users@httpd] Linux SSL Permission for htdocs directory

Hi ,

I installed Apache 2.2 + Tomcat 5 + SSL on Linux  and they run perfect.
The  Java  web application  gives users(after they login) ability to upload
files(pdf,ppt..)  then creates a record for them,  right way users can see
their records and can open the documents that they uploaded.
The problem is when they click on the link to open the files that they
uploaded before they get a "forbidden" screen.

The Java program save upload files on  the APache/htdocs directory.
To solve that I have to run following command for the htdocs directory.
chmod 755 the_name_document.

After that the users can access their  files.

The uploaded files could be accessible right away.
How can I solve this problem?

Thanks,
MK

Re: [users@httpd] Linux SSL Permission for htdocs directory

Posted by Michael Ludwig <ml...@as-guides.com>.
kohanm schrieb:
> The problem is when they click on the link to open the files that they
> uploaded before they get a "forbidden" screen.
>
> The Java program save upload files on  the APache/htdocs directory. To
> solve that I have to run following command for the htdocs directory.
> chmod 755 the_name_document.
>
> After that the users can access their  files.
>
> The uploaded files could be accessible right away. How can I solve
> this problem?

Maybe your Tomcat's umask is too restrictive? At the Bash command
prompt, see:

   help umask
   su -c umask www-data      # or whatever user your Tomcat runs as

If this happens to be the problem, try adding a more permissive umask to
$Tomcat/bin/catalina.sh :

   umask 022;

Michael Ludwig

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Linux SSL Permission for htdocs directory

Posted by kohanm <ko...@gmail.com>.
I solved the problem by running the Tomcat as a non-root user and  it
worked.

Thanks,

Mk

On Tue, Jan 13, 2009 at 5:18 AM, André Warnier <aw...@ice-sa.com> wrote:

> Ian Lea wrote:
>
>> I'd guess the problem is that apache is running under user x and
>> tomcat is running under user y, and user x doesn't by default have
>> permission to read files created by user y.
>>
>> Possible solutions include:
>>
>>  Run apache and tomcat as same user
>>  Play with umask and directory settings
>>  Download the files via the web application
>> ...
>>
>        use ACLs ?
>
> man setfacl
> man getfacl
>
> If you can get through the documentation and understand something of it, it
> is a very fine and precise way to set who can do what where.
>
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Massoud

Re: [users@httpd] Linux SSL Permission for htdocs directory

Posted by André Warnier <aw...@ice-sa.com>.
Ian Lea wrote:
> I'd guess the problem is that apache is running under user x and
> tomcat is running under user y, and user x doesn't by default have
> permission to read files created by user y.
> 
> Possible solutions include:
> 
>   Run apache and tomcat as same user
>   Play with umask and directory settings
>   Download the files via the web application
>...
	use ACLs ?

man setfacl
man getfacl

If you can get through the documentation and understand something of it, 
it is a very fine and precise way to set who can do what where.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Linux SSL Permission for htdocs directory

Posted by Ian Lea <ia...@gmail.com>.
I'd guess the problem is that apache is running under user x and
tomcat is running under user y, and user x doesn't by default have
permission to read files created by user y.

Possible solutions include:

  Run apache and tomcat as same user
  Play with umask and directory settings
  Download the files via the web application

There are of course security issues you should be aware of.  If it was
me, I'd download the files via the web application because that puts
all access control where you already have it, and breaks the directory
level dependency between apache and tomcat.  But I don't know your
requirements.



--
Ian.


On Tue, Jan 13, 2009 at 1:06 AM, kohanm <ko...@gmail.com> wrote:
>
> Hi ,
>
> I installed Apache 2.2 + Tomcat 5 + SSL on Linux  and they run perfect.
> The  Java  web application  gives users(after they login) ability to upload
> files(pdf,ppt..)  then creates a record for them,  right way users can see
> their records and can open the documents that they uploaded.
> The problem is when they click on the link to open the files that they
> uploaded before they get a "forbidden" screen.
>
> The Java program save upload files on  the APache/htdocs directory.
> To solve that I have to run following command for the htdocs directory.
> chmod 755 the_name_document.
>
> After that the users can access their  files.
>
> The uploaded files could be accessible right away.
> How can I solve this problem?
>
> Thanks,
> MK
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org