Create server.py

pull/1/head
Aidaho12 2018-01-15 12:10:16 +06:00 committed by GitHub
parent e2ec075c7b
commit 17f98f4501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

11
server.py Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env python3
import os, sys
from http.server import HTTPServer, CGIHTTPRequestHandler
sys.stderr = open('/opt/haproxy/log/haproxy-monitor.log', 'w')
webdir = "/opt/haproxy"
os.chdir(webdir)
server_address = ("", 8000)
httpd = HTTPServer(server_address, CGIHTTPRequestHandler)
httpd.serve_forever()