You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mikkel Christensen <mi...@talkactive.net> on 2004/05/07 10:29:25 UTC
[users@httpd] Apache refuses to start when it's user is member of to many groups
Hello everybody
In order to set propper permissions for suexec at my webserver I've tried to make the apache-user member of all the groups which my users own.
Eg. Apache's user (www) is member of the groups webuser1, webuser2, webuser3 and so forth.
Only problem is that apache refuses to start when the apache user is member of too many groups.
The number of allowed groups before I run into trouble is about 30, but it differs each time.
When restarting apache I get this errors in my error log:
[Thu May 6 10:51:50 2004] [notice] Apache/1.3.29 (Unix) PHP/4.3.4 PHP-CGI/0.1b configured -- resuming normal operations
[Thu May 6 10:51:50 2004] [notice] suEXEC mechanism enabled (wrapper: /usr/local/sbin/suexec)
[Thu May 6 10:51:50 2004] [notice] Accept mutex: flock (Default: flock)
[Thu May 6 10:39:38 2004] [alert] (22)Invalid argument: initgroups: unable to set groups for User www and Group 80
[Thu May 6 10:39:38 2004] [alert] (22)Invalid argument: initgroups: unable to set groups for User www and Group 80
[Thu May 6 10:39:38 2004] [alert] (22)Invalid argument: initgroups: unable to set groups for User www and Group 80
[Thu May 6 10:39:39 2004] [alert] Child 21628 returned a Fatal error...
Apache is exiting!
I've tried to search information about this issue on google but everybody else than me seems to get the error because they are running apache from a wrong userid.
(usually nobody). I know this is not my problem since this works perfectly as long as Apache's user is member of only a few groups.
I figured this might be an error caused becase each child taking to long to start (because the groups have to be initiated or something like that) and is therefore being terminated.
If so there must be some sort of timeout directive that I can use to solve the problem.
Of course this is only my guess. It could also be some kind of bug in Apache but I wouldn't know. Or maybe this lays at my operating system.
My setup is Apache 1.3.29 configured with suexec running at a FreeBSD 5.2.1 box.
All help is greatly appreciated.
Also if anyone have my setup working perfectly I would like to know since it them must be an issue with my specific installation.
Best regards
- Mikkel
---------------------------------------------------------------------
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] Apache refuses to start when it's user is member of to many groups
Posted by Mikkel Christensen <mi...@talkactive.net>.
On Friday 07 May 2004 10:16, Mikkel Christensen wrote:
> On Friday 07 May 2004 09:27, Dave Floyd wrote:
> > Hi Mikkel,
> > The solaris parameter is NGROUPS_UMAX. I avoided the problem
> > by running the script as root and su to each individual user, so I
> > don't think this is a relevant work-around to your problem. Why does
> > www need to be a member of all the groups? Couldn't you work the
> > other way and make all your users part of the group www (making sure
> > the permissions are suitably secure)?
> >
>
> Then all users would have access to the apache user (www) and it's files which is not preferable. Also www is a system account.
> Maybe a workaround would be creating another user without rights and then make all users member of that users group.
> Then finally add www to that inprevileged users group.
> The user nobody could be used for that. Any user would then have access to nobodys files but nobody doen't own any files. Nobody would have access to all users files and so would www being a member of the nobody group.
> Then a specific user could lock out any other users by setting permissions xx0 (this should be standart permissions). And Apache could be locked out with x00 (some users have sensitive files that should not be readable from the internet).
> I'll test it and return with the result:)
>
It works:D
All users are members of nobody. nobody is member of www.
www now have access to all users files through nobody if the group flag allows it. And because Apache doesn't have to initialize many users upon start it doesn't shutdown.
Actually this is kind of cheating in my oppinion but it works great:)
Thank you for your input:)
Only issue left is getting PHP to run in a similar way. Right now it still has too much access (which can be blocked using open_basedir) and files created with php are created under a wrong uid so the users can't access their php-created files when using ftp.
But that's another issue:) (where I hope this might help http://www.localhost.nl/patches/)
- Mikkel
---------------------------------------------------------------------
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] Apache refuses to start when it's user is member of to many groups
Posted by Mikkel Christensen <mi...@talkactive.net>.
On Friday 07 May 2004 09:27, Dave Floyd wrote:
> Hi Mikkel,
> The solaris parameter is NGROUPS_UMAX. I avoided the problem
> by running the script as root and su to each individual user, so I
> don't think this is a relevant work-around to your problem. Why does
> www need to be a member of all the groups? Couldn't you work the
> other way and make all your users part of the group www (making sure
> the permissions are suitably secure)?
>
Then all users would have access to the apache user (www) and it's files which is not preferable. Also www is a system account.
Maybe a workaround would be creating another user without rights and then make all users member of that users group.
Then finally add www to that inprevileged users group.
The user nobody could be used for that. Any user would then have access to nobodys files but nobody doen't own any files. Nobody would have access to all users files and so would www being a member of the nobody group.
Then a specific user could lock out any other users by setting permissions xx0 (this should be standart permissions). And Apache could be locked out with x00 (some users have sensitive files that should not be readable from the internet).
I'll test it and return with the result:)
- Mikkel
---------------------------------------------------------------------
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] Apache refuses to start when it's user is
member of to many groups
Posted by Dave Floyd <da...@pa.press.net>.
Hi Mikkel,
The solaris parameter is NGROUPS_UMAX. I avoided the problem
by running the script as root and su to each individual user, so I
don't think this is a relevant work-around to your problem. Why does
www need to be a member of all the groups? Couldn't you work the
other way and make all your users part of the group www (making sure
the permissions are suitably secure)?
rgds
>On Friday 07 May 2004 08:38, Dave Floyd wrote:
> > Mikkel,
> > I think this is an operating system problem, rather than
> > apache. I ran into similar problems with ftp on solaris when a user
> > was a member of a lot of groups. I had to think of a way of avoiding
> > the problem, rather than fixing it as the controlling system
> > parameter was already at its max value. I don't know whether you
> > might be able to increase the limit on FreeBSD.
> >
>
>How was the limit set on Solaris? It might give me an idea where to
>look on FreeBSD.
>Also I would like to know how you managed to avoid the problem. As
>far as I can se it is the only way to set propper restrictive
>permissions with many users on the same system.
>Thanks for your reply:)
>
>- Mikkel
>
>---------------------------------------------------------------------
>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
---------------------------------------------------------------------
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] Apache refuses to start when it's user is member of to many groups
Posted by Mikkel Christensen <mi...@talkactive.net>.
On Friday 07 May 2004 08:38, Dave Floyd wrote:
> Mikkel,
> I think this is an operating system problem, rather than
> apache. I ran into similar problems with ftp on solaris when a user
> was a member of a lot of groups. I had to think of a way of avoiding
> the problem, rather than fixing it as the controlling system
> parameter was already at its max value. I don't know whether you
> might be able to increase the limit on FreeBSD.
>
How was the limit set on Solaris? It might give me an idea where to look on FreeBSD.
Also I would like to know how you managed to avoid the problem. As far as I can se it is the only way to set propper restrictive permissions with many users on the same system.
Thanks for your reply:)
- Mikkel
---------------------------------------------------------------------
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] Apache refuses to start when it's user is
member of to many groups
Posted by Dave Floyd <da...@pa.press.net>.
Mikkel,
I think this is an operating system problem, rather than
apache. I ran into similar problems with ftp on solaris when a user
was a member of a lot of groups. I had to think of a way of avoiding
the problem, rather than fixing it as the controlling system
parameter was already at its max value. I don't know whether you
might be able to increase the limit on FreeBSD.
rgds
>Hello everybody
>
>In order to set propper permissions for suexec at my webserver I've
>tried to make the apache-user member of all the groups which my
>users own.
>Eg. Apache's user (www) is member of the groups webuser1, webuser2,
>webuser3 and so forth.
>Only problem is that apache refuses to start when the apache user is
>member of too many groups.
>The number of allowed groups before I run into trouble is about 30,
>but it differs each time.
>
>When restarting apache I get this errors in my error log:
>
>[Thu May 6 10:51:50 2004] [notice] Apache/1.3.29 (Unix) PHP/4.3.4
>PHP-CGI/0.1b configured -- resuming normal operations
>[Thu May 6 10:51:50 2004] [notice] suEXEC mechanism enabled
>(wrapper: /usr/local/sbin/suexec)
>[Thu May 6 10:51:50 2004] [notice] Accept mutex: flock (Default: flock)
>[Thu May 6 10:39:38 2004] [alert] (22)Invalid argument: initgroups:
>unable to set groups for User www and Group 80
>[Thu May 6 10:39:38 2004] [alert] (22)Invalid argument: initgroups:
>unable to set groups for User www and Group 80
>[Thu May 6 10:39:38 2004] [alert] (22)Invalid argument: initgroups:
>unable to set groups for User www and Group 80
>[Thu May 6 10:39:39 2004] [alert] Child 21628 returned a Fatal error...
>Apache is exiting!
>
>I've tried to search information about this issue on google but
>everybody else than me seems to get the error because they are
>running apache from a wrong userid.
>(usually nobody). I know this is not my problem since this works
>perfectly as long as Apache's user is member of only a few groups.
>
>I figured this might be an error caused becase each child taking to
>long to start (because the groups have to be initiated or something
>like that) and is therefore being terminated.
>If so there must be some sort of timeout directive that I can use to
>solve the problem.
>
>Of course this is only my guess. It could also be some kind of bug
>in Apache but I wouldn't know. Or maybe this lays at my operating
>system.
>
>My setup is Apache 1.3.29 configured with suexec running at a
>FreeBSD 5.2.1 box.
>
>All help is greatly appreciated.
>Also if anyone have my setup working perfectly I would like to know
>since it them must be an issue with my specific installation.
>
>Best regards
>- Mikkel
>
>---------------------------------------------------------------------
>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
---------------------------------------------------------------------
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