Re: Problem when uploading files with Apache

2009-02-08 Thread Nicolas Letellier
On Sun, 8 Feb 2009 07:50:34 -0500
Glen Barber glen.j.bar...@gmail.com wrote:

 On Sun, Feb 8, 2009 at 7:31 AM, Nicolas Letellier nico...@nicoelro.net 
 wrote:
  Hello.
 
  I use apache13 with FreeBSD 6.3.
  I have some websites, in :
  /var/www/sites/site1
  /var/www/sites/site2
 
  I use PHP 5 (compiled in apache module).
 
  The rights are:
 
  ls -ls /var/www/sites/site1: www:site1
 
  All files are owned by www user. All files are grouped in site{1,2} group.
 
  I have a php script in /var/www/sites/site1. I call it with 
  www.domain.com/test.php. If, in my php page, I create a folder (in 
  /var/www/sites/site1/), it have www:site1 in rights. Ok, it's good. 
  However, if I create a file, it have www:wheel in rights.
 
  What's the problem?
 
  Apache runs in www:www. I does not have folder grouped in wheel group.
 
  Why Apache set 'wheel' as group when I upload a file?
 
  Do you have advices, solutions... ?
 
 
 I haven't used 1.3 in years... I don't think www:www is proper, but I
 may be wrong.  With 2.2.X, the permissions are root:wheel.  What
 happens when you execute the page?  What is printed the error log?

Thanks for your response.
I have another FreeBSD (7.0) and Apache 1.3, and it works. On this machine 
(6.3) it does not work.

When I upload a FILE, the rights are root:wheel ; when I create a folder, the 
rights are www:site1.

www:site1 are rights of all files.

The problem is... I don't understand the wheel. Apache does not run in wheel. 
All my folders/files are not grouped by wheel.

I don't understand WHY apache set 'wheel' in group...

I have nothing in log. Because there are no errors... All is ok... Just the 
rights..

-- 
 -Nicolas.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Problem when uploading files with Apache

2009-02-08 Thread Glen Barber
On Sun, Feb 8, 2009 at 7:56 AM, Nicolas Letellier nico...@nicoelro.net wrote:
 I have another FreeBSD (7.0) and Apache 1.3, and it works. On this machine 
 (6.3) it does not work.

What do you mean it does not work.  You state below there are no
errors.  If it does not work there should be errors.

 The problem is... I don't understand the wheel. Apache does not run in 
 wheel. All my folders/files are not grouped by wheel.

'wheel' is root's default group.


 I have nothing in log. Because there are no errors... All is ok... Just the 
 rights..


But you say above it does not work.


-- 
Glen Barber
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Problem when uploading files with Apache

2009-02-08 Thread Nicolas Letellier
On Sun, 8 Feb 2009 08:01:13 -0500
Glen Barber glen.j.bar...@gmail.com wrote:

 On Sun, Feb 8, 2009 at 7:56 AM, Nicolas Letellier nico...@nicoelro.net 
 wrote:
  I have another FreeBSD (7.0) and Apache 1.3, and it works. On this machine 
  (6.3) it does not work.
 
 What do you mean it does not work.  You state below there are no
 errors.  If it does not work there should be errors.
It does not work because Apache don't set 'good rights'. Without error. So, for 
Apache, there are no errors. For me, yes. It is not normal that the rights are 
www:wheel.
 
  The problem is... I don't understand the wheel. Apache does not run in 
  wheel. All my folders/files are not grouped by wheel.
 
 'wheel' is root's default group.
But it is not the www's default group.
And Apache runs a www user. I *never* launch my scripts as root. So, that's why 
I don't understand.


 
  I have nothing in log. Because there are no errors... All is ok... Just the 
  rights..
 
 
 But you say above it does not work.
It does not work because apache set www:wheel on rights when I UPLOAD a file ; 
on the other hand, when I create file/folder, the rights are www:www.

When I launch this very simple script:

?php

$aa = fopen('./aaa', 'a+');
fclose($aa);

?

./aaa file is created with www:www.

So, anybody could explain me when I upload a file, rights are www:wheel?

And WHY wheel group is used? This group may never be used for Apache.

-- 
 -Nicolas.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Problem when uploading files with Apache

2009-02-08 Thread Lowell Gilbert
Nicolas Letellier nico...@nicoelro.net writes:

 So, anybody could explain me when I upload a file, rights are www:wheel?

I'm going to guess that it's just inheriting the group from the
directory.  The normal default in BSD is for a file to get the gid 
of the directory.  The directory you are uploading into should be owned
by the group you want the files to have.

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
http://be-well.ilk.org/~lowell/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Problem when uploading files with Apache

2009-02-08 Thread Nicolas Letellier
On Sun, 08 Feb 2009 08:53:59 -0500
Lowell Gilbert freebsd-questions-lo...@be-well.ilk.org wrote:

 Nicolas Letellier nico...@nicoelro.net writes:
 
  So, anybody could explain me when I upload a file, rights are www:wheel?
 
 I'm going to guess that it's just inheriting the group from the
 directory.  The normal default in BSD is for a file to get the gid 
 of the directory.  The directory you are uploading into should be owned
 by the group you want the files to have.

That's I always learn. But in this case, it's not true.
I upload into testdir/ which has www:www rights.

And I launch my upload script, and the file is www:wheel



I don't understand.
I'm on this problem for  4 hours, and I don't find the solution
-- 
 -Nicolas.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Problem when uploading files with Apache

2009-02-08 Thread Glen Barber
On Sun, Feb 8, 2009 at 9:02 AM, Nicolas Letellier nico...@nicoelro.net wrote:

 That's I always learn. But in this case, it's not true.
 I upload into testdir/ which has www:www rights.

 And I launch my upload script, and the file is www:wheel


What are the permissions on the file you are uploading?


-- 
Glen Barber
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Problem when uploading files with Apache

2009-02-08 Thread Gabe
--- On Sun, 2/8/09, Nicolas Letellier nico...@nicoelro.net wrote:

 From: Nicolas Letellier nico...@nicoelro.net
 Subject: Re: Problem when uploading files with Apache
 To: FreeBSD Questions freebsd-questions@freebsd.org
 Cc: Glen Barber glen.j.bar...@gmail.com, Lowell Gilbert 
 freebsd-questions-lo...@be-well.ilk.org
 Date: Sunday, February 8, 2009, 6:02 AM
 On Sun, 08 Feb 2009 08:53:59 -0500
 Lowell Gilbert
 freebsd-questions-lo...@be-well.ilk.org wrote:
 
  Nicolas Letellier nico...@nicoelro.net writes:
  
   So, anybody could explain me when I upload a
 file, rights are www:wheel?
  
  I'm going to guess that it's just inheriting
 the group from the
  directory.  The normal default in BSD is for a file to
 get the gid 
  of the directory.  The directory you are uploading
 into should be owned
  by the group you want the files to have.
 
 That's I always learn. But in this case, it's not
 true.
 I upload into testdir/ which has www:www
 rights.
 
 And I launch my upload script, and the file is www:wheel
 
 
 
 I don't understand.
 I'm on this problem for  4 hours, and I don't find
 the solution
 -- 
  -Nicolas.

'www' wouldn't happen to be in the wheel group would it?


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Problem when uploading files with Apache

2009-02-08 Thread Nicolas Letellier
On Sun, 8 Feb 2009 06:11:27 -0800 (PST)
Gabe n...@att.net wrote:

 --- On Sun, 2/8/09, Nicolas Letellier nico...@nicoelro.net wrote:
 
  From: Nicolas Letellier nico...@nicoelro.net
  Subject: Re: Problem when uploading files with Apache
  To: FreeBSD Questions freebsd-questions@freebsd.org
  Cc: Glen Barber glen.j.bar...@gmail.com, Lowell Gilbert 
  freebsd-questions-lo...@be-well.ilk.org
  Date: Sunday, February 8, 2009, 6:02 AM
  On Sun, 08 Feb 2009 08:53:59 -0500
  Lowell Gilbert
  freebsd-questions-lo...@be-well.ilk.org wrote:
  
   Nicolas Letellier nico...@nicoelro.net writes:
   
So, anybody could explain me when I upload a
  file, rights are www:wheel?
   
   I'm going to guess that it's just inheriting
  the group from the
   directory.  The normal default in BSD is for a file to
  get the gid 
   of the directory.  The directory you are uploading
  into should be owned
   by the group you want the files to have.
  
  That's I always learn. But in this case, it's not
  true.
  I upload into testdir/ which has www:www
  rights.
  
  And I launch my upload script, and the file is www:wheel
  
  
  
  I don't understand.
  I'm on this problem for  4 hours, and I don't find
  the solution
  -- 
   -Nicolas.
 
 'www' wouldn't happen to be in the wheel group would it?

No, www is not a member of wheel group.


-- 
 -Nicolas.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Problem when uploading files with Apache

2009-02-08 Thread Nicolas Letellier
On Sun, 8 Feb 2009 09:09:45 -0500
Glen Barber glen.j.bar...@gmail.com wrote:

 On Sun, Feb 8, 2009 at 9:02 AM, Nicolas Letellier nico...@nicoelro.net 
 wrote:
 
  That's I always learn. But in this case, it's not true.
  I upload into testdir/ which has www:www rights.
 
  And I launch my upload script, and the file is www:wheel
 
 
 What are the permissions on the file you are uploading?

I'm uploading the file from a web client. This is a php script.

I have another FreeBSD (7.0), with the SAME apache, and I don't have the 
problem on it. Files uploaded are www:www (normal).
On my machine (6.3), with the SAME apache, files uploaded are www:wheel.

I set the *same* php script, I send the same file. 

I'm looking for differences between them, but none.

-- 
 -Nicolas.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Problem when uploading files with Apache

2009-02-08 Thread Nicolas Letellier
On Sun, 8 Feb 2009 06:11:27 -0800 (PST)
Gabe n...@att.net wrote:

 --- On Sun, 2/8/09, Nicolas Letellier nico...@nicoelro.net wrote:
 
  From: Nicolas Letellier nico...@nicoelro.net
  Subject: Re: Problem when uploading files with Apache
  To: FreeBSD Questions freebsd-questions@freebsd.org
  Cc: Glen Barber glen.j.bar...@gmail.com, Lowell Gilbert 
  freebsd-questions-lo...@be-well.ilk.org
  Date: Sunday, February 8, 2009, 6:02 AM
  On Sun, 08 Feb 2009 08:53:59 -0500
  Lowell Gilbert
  freebsd-questions-lo...@be-well.ilk.org wrote:
  
   Nicolas Letellier nico...@nicoelro.net writes:
   
So, anybody could explain me when I upload a
  file, rights are www:wheel?
   
   I'm going to guess that it's just inheriting
  the group from the
   directory.  The normal default in BSD is for a file to
  get the gid 
   of the directory.  The directory you are uploading
  into should be owned
   by the group you want the files to have.
  
  That's I always learn. But in this case, it's not
  true.
  I upload into testdir/ which has www:www
  rights.
  
  And I launch my upload script, and the file is www:wheel
  
  
  
  I don't understand.
  I'm on this problem for  4 hours, and I don't find
  the solution
  -- 
   -Nicolas.
 
 'www' wouldn't happen to be in the wheel group would it?

Ok, I found! Yeah.

We must set a upload_tmp_dir (instead the default upload_dir). And this folder 
must have your rights.
By default, this folder has root:wheel (in 1777 mod). So, when Apache copies 
uploaded files from this folder, it keep the wheel group.

Hope this tip could help others persons.

Thanks for your time and your advices.

Regards,

-- 
 -Nicolas.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org