holandes777 has asked for the wisdom of the Perl Monks concerning the following question:
Hello All:
This is probably more an apache issue than a perl issue. Still, I have been asking for help from apache folks and gotten none. So in the words of Mathezar of Galaxy Quest, "You are our last hope!"
There is a similar thread under "System and CGI - File Created but not the Content". I thought this was different enough to post separately becasue SELinux is off in my case and perl is the file writter.
I am running FC4, Apache 2.0.54, perl 5.8.6, the server is not attached to the internet.
I have done what should never be done: 777 permissions on /var, /var/www, /var/www/html.
Below html I have a directory called DATA, also 777
user apache owns everything below var
setenforce 0 to remove SElinux
(basically, a desperate and ridiculous attempt to allow files to be written)
The odd thing is that the original program (from which this was extracted) up to 10am 9/17/2006. After that, the machine, untouched, exhibited the new behaviour.
All written files prior to 10 am 9/17 are apache 644 and have content. All written files after to 10am 9/17 are apache 644 and are empty.
1) I am probably not doing this the right way ... where should I be writting the files and how should I set upms and httpd.conf. I have been trolling google with "apache permissions" apachec cgi write files" and the like. If you have links to howtos, please send them!
2) In the above case, can I determine the reason and fix it? It would be nice to be able to dial back the permissions to something reasonable
Thanks in advance.
This is probably more an apache issue than a perl issue. Still, I have been asking for help from apache folks and gotten none. So in the words of Mathezar of Galaxy Quest, "You are our last hope!"
There is a similar thread under "System and CGI - File Created but not the Content". I thought this was different enough to post separately becasue SELinux is off in my case and perl is the file writter.
When executed the browser shows "we are trying to write", the /var/www/html/DATA/kk.txt file exists, it is 666, owned by apache and has zero content.#!/usr/bin/perl use strict; print "Content-Type: text/html\r\n\r\n"; print "<HTML>\n"; print "<HEAD>\n"; print "</HEAD>\n"; print "<BODY>\n"; my $filename ="/var/www/html/DATA/kk.txt"; open(KK,">$filename"); close(KK); # this line and the nex +t 2 were not part of system("chmod 666 $filename"); # of the original code. + They were added to open(KK,">>$filename"); # see if changing the p +ermissions would help print "we are trying to write\n"; print KK "we are trying to write\n"; close(KK); print "</BODY>\n"; print "</HTML>\n";
I am running FC4, Apache 2.0.54, perl 5.8.6, the server is not attached to the internet.
I have done what should never be done: 777 permissions on /var, /var/www, /var/www/html.
Below html I have a directory called DATA, also 777
user apache owns everything below var
setenforce 0 to remove SElinux
(basically, a desperate and ridiculous attempt to allow files to be written)
The odd thing is that the original program (from which this was extracted) up to 10am 9/17/2006. After that, the machine, untouched, exhibited the new behaviour.
All written files prior to 10 am 9/17 are apache 644 and have content. All written files after to 10am 9/17 are apache 644 and are empty.
1) I am probably not doing this the right way ... where should I be writting the files and how should I set upms and httpd.conf. I have been trolling google with "apache permissions" apachec cgi write files" and the like. If you have links to howtos, please send them!
2) In the above case, can I determine the reason and fix it? It would be nice to be able to dial back the permissions to something reasonable
Thanks in advance.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: System and CGI - File Created but not the Content (Similar Situation)
by Joost (Canon) on Sep 18, 2007 at 15:41 UTC | |
Re: System and CGI - File Created but not the Content (Similar Situation)
by snopal (Pilgrim) on Sep 18, 2007 at 18:53 UTC | |
by holandes777 (Scribe) on Sep 23, 2007 at 14:31 UTC |
Back to
Seekers of Perl Wisdom