You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by mk27 <ha...@intergate.com> on 2008/09/20 11:29:55 UTC

[users@httpd] print() on closed filehandle error

...because I can't append a text file in the html directory.

Hi -- I just installed apache (from .rpm) on fedora 7 to learn perl CGI
with.  I notice that I can't overwrite or append anything existing in
/var/www/html from a cgi script in /var/www/cgi-bin, regardless of
permissions and ownership.  I presume this is blocked by apache.  What can I
do to reconfigure this?
-- 
View this message in context: http://www.nabble.com/print%28%29-on-closed-filehandle-error-tp19583936p19583936.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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] print() on closed filehandle error

Posted by Dan Poirier <po...@pobox.com>.
On Sat, September 20, 2008 5:29 am, mk27 wrote:
> I notice that I can't overwrite or append anything existing in
> /var/www/html from a cgi script in /var/www/cgi-bin, regardless of
> permissions and ownership.  I presume this is blocked by apache.  What
> can I do to reconfigure this?

As far as I know, permissions and ownerships are all that can be involved
here.  By default, apache is usually configured to handle requests as a
user with minimal privileges, e.g. "nobody" or "www".  By design this user
typically does not have any privileges to change files in /var/www/html
(or much of anywhere else) to minimize the damage that could be done if
a security bug in apache allowed the child process to be compromised.

Anyway, there are several ways you can handle this.

1) (most common) store your data in a database instead of in
the file system.

2) use suexec to run your CGI as another user

3) change the permissions on some files so the apache user can
modify them

4) change the user that apache runs as.

-- 
Dan Poirier <po...@pobox.com>


---------------------------------------------------------------------
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