troubleshooting Question

First Python CGI app runs at command line but not on IIS

Avatar of ROBERT MECHLER
ROBERT MECHLERFlag for United States of America asked on
* iis8* CGI* permissionPython
5 Comments1 Solution13 ViewsLast Modified:
"You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server. ".    I've done the *.py in Handler mappings and set the Mime type to text/x-python. The request path for the handler is *.py and I've filled the directory to the python.exe. On Request Restrictions Mapping is set to 'File', verbs are set to all and access is 'Script'.CGI if definitely installed in IIS.I only have Anonymous Authentication enabled.Port is 8000. Physical location is c:\inetpub\wwwroot\cgi-bin. Security for folder includes IUSR and IIS_IUSRS full control. Tried http://localhost:8000/1.py and got the error message above.
Just tried changing access from Script to Executable and got the error message.
'You have attempted to run a CGI, ISAPI, or other executable program from a directory that does not allow executables to run.
'
Python 3.9
[code]
print('Content-Type: text/html')
print('')
print('<h1>Hello,world!</h1>')
[/code]

With those settings and python code it works on the videos I watched but not for me. Using Windows 2012 Standard.  Anything I'm missing. The same web server runs lots of ASP.NET 2.0 and 4.8 Framework websites just fine. This CGI app is my very first and I've run out of YouTube videos to watch which all work.

A simple html file works fine.
I've also tried "Content-Type: text/plain" and still get nothing for '1.py'

ASKER CERTIFIED SOLUTION
David H.H.Lee
Digital Marketing (Hospitality)
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros