Avatar of ROBERT MECHLER
ROBERT MECHLER
Flag for United States of America

asked on 

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

"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'

* iis8* CGI* permissionPython

Avatar of undefined
Last Comment
ROBERT MECHLER

8/22/2022 - Mon