Advertisement
Guest User

Untitled

a guest
Dec 7th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. started webserver at with port 8000...
  2. 127.0.0.1 - - [07/Dec/2018 20:18:09] code 404, message File not found
  3. 127.0.0.1 - - [07/Dec/2018 20:18:09] "GET /htdocs/cgi-bin/bf2.py HTTP/1.1" 404 -
  4. 127.0.0.1 - - [07/Dec/2018 20:18:14] "GET /cgi-bin/bf2.py HTTP/1.1" 200 -
  5. Traceback (most recent call last):
  6. File "/usr/lib/python2.7/CGIHTTPServer.py", line 248, in run_cgi
  7. os.execve(scriptfile, args, env)
  8. OSError: [Errno 2] No such file or directory
  9. 127.0.0.1 - - [07/Dec/2018 20:18:14] CGI script exit status 0x7f00
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. from os import path, chdir
  17. from BaseHTTPServer import HTTPServer
  18. from CGIHTTPServer import CGIHTTPRequestHandler
  19.  
  20. current_dir = path.dirname(path.abspath(__file__))
  21. chdir(path.join(current_dir, 'htdocs'))
  22. try:
  23. addr = ('', 8000)
  24. server = HTTPServer(addr, CGIHTTPRequestHandler)
  25. print 'started webserver at %s with port %s...' %addr
  26. server.serve_forever()
  27. except KeyboardInterrupt:
  28. print '^C received, shutting down server'
  29. server.socket.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement