Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I haven't done anything on a windows machine since I started doing serious sys-admin and development work (all *nix). So I may be asking something easy - but I haven't found the answer by searching.

I've got Windows Server 2008 running Apache 2.2. I can run the "" perl script that came in the cgi-bin dir along with the Apache install just fine...

However, with a script that does the following:

print "Content-Type: text/plain; charset=iso-8859-1\n\n";
print `type C:\\Some\\Dir\\file.txt`;

My apache log just says:

[Tue Jun 22 13:13:55 2010] [error] [client] Access is denied.\r

I can run the same perl script from the dos prompt - so I know it works for my user. I can see in Task Manager that httpd.exe is running with user SYSTEM, so I made sure file.txt was readable to SYSTEM. I even made it readable to Everyone at one point - but I still get the "access is denied" error.


share|improve this question

Are you certain that the user 'SYSTEM' can execute perl.exe?

share|improve this answer
Yes, based on the fact that I can run that '' script through Apache... I checked the properties on the exe as well to be sure... – EMiller Jun 22 '10 at 21:09
Are you certain that Apache isn't jailed to the directory? Where exactly is the file.txt? Try moving a copy into the Apache directory it is serving from to make sure. – Tyler K Jun 22 '10 at 21:20
That's a good call - I will try asap. What would "jailed" mean on a windows machine? (what controls that, and where is it configured) – EMiller Jun 22 '10 at 22:25
I'm afraid you've hit my Windows knowledge wall. I can't answer that and google isn't turning anything up. – Tyler K Jun 23 '10 at 5:48
Thanks - well you've pointed me in the right direction ... I've confirmed I can 'type' out a file within cgi-bin ... and even when I add the other path as an apache 'Alias' and add a corresponding '<directory>' section to allow browsing - I get a permission denied... – EMiller Jun 23 '10 at 16:10
up vote 0 down vote accepted

Well - it turned out that the C:\some\dir\file.txt file was encrypted. It took me a while, but I finally started to wonder: "why is that folder in green text" in windows explorer. I have no idea why, but I copied a zip file over, and when they extracted they were encrypted. As soon as I turned that off, the perl script could read.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.