Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI write to file problem

Status
Not open for further replies.

IamStang

Technical User
Feb 12, 2005
27
0
0
US
I have a problem with a cgi script not being allowed to create/write to a txt file.

The Scenario:
A Linux/Apache server with SeLinux disabled (temporarily)
A cgi script that creates a new txt file containing info submitted by a visitor (ipaddy_data.txt)

When I load the cgi in my browser, I get an "Internal Server Error". Looking at my error log tells me "Permission denied at line 13". This is where the script is supposed to create the file. (my $logpath = "data/$remote-addr_data.txt"; ). If I "rem" out everything to do with creating that file, it works great. No errors.

What have I done to try to fix this?

I have chowned all folders to root:root (cgi wouldn't work at all any other way I tried). I have chmoded all existing files to 777. And I have disabled SeLinux.

Now, what in the world am I not seeing here?

Any help with this is greatly appreciated. Also, if any more info is required, please ask.
 
Nevermind.

Delete this thread if ya want
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top