I had Apache perfectly configured and functioning. I wanted to try this script in Python:
from http.server import HTTPServer, BaseHTTPRequestHandler
class Serv(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == '/':
self.path = '/index.html'
try:
file_to_open = open(self.path[1:]).read()
self.send_response(200)
except:
file_to_open = "File not found"
self.send_response(404)
self.end_headers()
self.wfile.write(bytes(file_to_open, 'utf-8'))
httpd = HTTPServer(('localhost', 8080), Serv)
httpd.serve_forever()
But since I used it I can not run apache anymore, I think everything comes from "httpd.serve_forever ()" which makes the python server stay active forever and not stop it, because when I try to run apache from Raspberry I get the following error:
sudo service apache2 start
Job for apache2.service failed because of unavailable resources or another system error.
See "systemctl status apache2.service" and "journalctl -xe" for details.