nohup python -m SimpleHTTPServer 80 &
执行上述命令后,创建一个http服务器 linux vps中的http服务器经常会自动被杀(大约一到两个小时),这就是为什么?
nohup的
36.19.96.16 - - [05/Sep/2013 03:20:49] "GET /images/1.jpg HTTP/1.1" 200 - Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 640, in __init__
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 693, in finish
self.wfile.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
hsb-110-81.hotspotbroadband.com - - [05/Sep/2013 06:39:54] code 400, message Bad HTTP/0.9 request type ('\x80w\x01\x03\x01\x00N\x00\x00\x00')
答案 0 :(得分:0)
尝试nohup python -m SimpleHTTPServer 80&
并尝试在nohup.out中调试日志可能会被一些内存限制它被杀死。