PermissionError: [Errno 13] Permission denied Python

Hi, I am trying to create a web server with python, but I get a PermissionError error message: [Errno 13] Permission denied

This is my code:

import os, sys from http.server import HTTPServer, CGIHTTPRequestHandler webdir = '.' port = 80 os.chdir(webdir) srvaddr = ('', port) srvobj = HTTPServer(srvaddr, CGIHTTPRequestHandler) srvobj.serve_forever() 
+4
source share
1 answer

Try changing the port to 8080. You did not specify which OS, but most UNIX derivatives will allow root listen on ports below 1024 or 4,096, depending on the OS and its configuration.

+6
source

Source: https://habr.com/ru/post/1484514/


All Articles