[Tutor] Making a simple web server in Python

Alexandre Conrad alexandre.conrad at gmail.com
Tue May 31 03:03:34 CEST 2011


2011/5/30 Michael bridges <micha_el2003 at yahoo.com>:
>  File "C:\Users\MySelf\Program\game_stuff\Python_Server_code_and_test\pythonweb\webserver.py", line 56, in main
>    server = HTTPServer(('', 80), MyHandler)
>  File "C:\Python31\lib\socketserver.py", line 400, in __init__
>    self.server_bind()
>  File "C:\Python31\lib\http\server.py", line 127, in server_bind
>    socketserver.TCPServer.server_bind(self)
>  File "C:\Python31\lib\socketserver.py", line 411, in server_bind
>    self.socket.bind(self.server_address)
> socket.error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions

Isn't port 80 reserved for super users? I think you might need
root/admin privileges (or whatever it's called under Windows). Try
port numbers above 1024.

> [with port 80 changed to port 81, can not use port 80 for some reason]

Not quite sure here.

> changing to port 29876 gives same error & did not want to stop, kept restarting.
>
> [putting http://localhost/index.html in broswer]
> gives 404 error

you must specify the port to whatever you set your server to:

http://localhost:29876/index.html

HTH,
-- 
Alex | twitter.com/alexconrad


More information about the Tutor mailing list