SketchySteve
asked on
Allowing a CGI script to create and write to a directory
Hi,
I'm running Apache 2.0 on a Windows XP system. I'm using a Perl script which uses the Inline C module. When I try to run it I get this error message
"Failed to autogenerate C:\Program Files\Apache Group\Apache2\cgi-bin\_Inl ine\config ."
and after creating the directory myself this error message in the error log.
"Can't open C:\Program Files\Apache Group\Apache2\cgi-bin\_Inl ine\config for input."
How can I give the CGI script permission to create and write to arbitery directories?
I'm only doing local testing at home now so sucurity is not an issue.
Thanks for the help
Steve
I'm running Apache 2.0 on a Windows XP system. I'm using a Perl script which uses the Inline C module. When I try to run it I get this error message
"Failed to autogenerate C:\Program Files\Apache Group\Apache2\cgi-bin\_Inl
and after creating the directory myself this error message in the error log.
"Can't open C:\Program Files\Apache Group\Apache2\cgi-bin\_Inl
How can I give the CGI script permission to create and write to arbitery directories?
I'm only doing local testing at home now so sucurity is not an issue.
Thanks for the help
Steve
ASKER
How do I log Apache on as a different user?
If I logged Apache on as Administrator would any CGI script be able to create directories and write to them?
It looks like I may only need to give write access to a dirctory the CGI script will access, does this make it easier.
Thanks for the help
Steve
PS- I've looked at some FAQs about how to log on Apache as a different user and they said it was done by including a line like this
User Administrator
Group Administrator
To the httpd.conf file - this just crashes my apache, is this only for earlier versions? I'm running 2.0
Thanks
If I logged Apache on as Administrator would any CGI script be able to create directories and write to them?
It looks like I may only need to give write access to a dirctory the CGI script will access, does this make it easier.
Thanks for the help
Steve
PS- I've looked at some FAQs about how to log on Apache as a different user and they said it was done by including a line like this
User Administrator
Group Administrator
To the httpd.conf file - this just crashes my apache, is this only for earlier versions? I'm running 2.0
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have tried this and i'm still getting errors
[Tue Apr 06 18:30:41 2004] [error] [client 127.0.0.1] Premature end of script headers: metasearch.pl
[Tue Apr 06 18:30:41 2004] [error] [client 127.0.0.1] Undefined subroutine &main::greet called at C:/Program Files/Apache Group/Apache2/cgi-bin/meta search.pl line 18.\r
From what I understand these are probably permision errors but I created a new Administrator account called Apache. I then went into Services Logon and entered ".\Apache" as the username with the correct password.
After doing this Apache still worked (so I assume I didnt go too wrong), but still my script wont run.
To give a little more background i'm trying to use the Inline C module which gives the following description of CGI implementation.
"The problem with running Inline code from a CGI script is that Inline writes to a build area on your disk whenever it compiles code. Most CGI scripts don't (and shouldn't) be able to create a directory and write into it.
The solution is to explicitly tell Inline which directory to use with the 'use Inline Config => DIRECTORY => ...' line. Then you need to give write access to that directory from the web server (CGI script)."
How do I do this in XP? I've told Inline to use a number of directories and i'm still getting these error messages. If Apache is running on an Admin account why is this happening?
Thanks in advance
Steve
[Tue Apr 06 18:30:41 2004] [error] [client 127.0.0.1] Premature end of script headers: metasearch.pl
[Tue Apr 06 18:30:41 2004] [error] [client 127.0.0.1] Undefined subroutine &main::greet called at C:/Program Files/Apache Group/Apache2/cgi-bin/meta
From what I understand these are probably permision errors but I created a new Administrator account called Apache. I then went into Services Logon and entered ".\Apache" as the username with the correct password.
After doing this Apache still worked (so I assume I didnt go too wrong), but still my script wont run.
To give a little more background i'm trying to use the Inline C module which gives the following description of CGI implementation.
"The problem with running Inline code from a CGI script is that Inline writes to a build area on your disk whenever it compiles code. Most CGI scripts don't (and shouldn't) be able to create a directory and write into it.
The solution is to explicitly tell Inline which directory to use with the 'use Inline Config => DIRECTORY => ...' line. Then you need to give write access to that directory from the web server (CGI script)."
How do I do this in XP? I've told Inline to use a number of directories and i'm still getting these error messages. If Apache is running on an Admin account why is this happening?
Thanks in advance
Steve
ASKER
Thanks for the help healthstatus, you solution did work but it was obscured by another error as soon as I solved that problem.
Cheers
Steve
Cheers
Steve
g