Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- started webserver at with port 8000...
- 127.0.0.1 - - [07/Dec/2018 20:18:09] code 404, message File not found
- 127.0.0.1 - - [07/Dec/2018 20:18:09] "GET /htdocs/cgi-bin/bf2.py HTTP/1.1" 404 -
- 127.0.0.1 - - [07/Dec/2018 20:18:14] "GET /cgi-bin/bf2.py HTTP/1.1" 200 -
- Traceback (most recent call last):
- File "/usr/lib/python2.7/CGIHTTPServer.py", line 248, in run_cgi
- os.execve(scriptfile, args, env)
- OSError: [Errno 2] No such file or directory
- 127.0.0.1 - - [07/Dec/2018 20:18:14] CGI script exit status 0x7f00
- from os import path, chdir
- from BaseHTTPServer import HTTPServer
- from CGIHTTPServer import CGIHTTPRequestHandler
- current_dir = path.dirname(path.abspath(__file__))
- chdir(path.join(current_dir, 'htdocs'))
- try:
- addr = ('', 8000)
- server = HTTPServer(addr, CGIHTTPRequestHandler)
- print 'started webserver at %s with port %s...' %addr
- server.serve_forever()
- except KeyboardInterrupt:
- print '^C received, shutting down server'
- server.socket.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement