apache2.service未处于活动状态,无法重新加载

2024-10-01 13:33:39 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在VPS(Ubuntu 16.04.2,Apache2)上部署我的服务器python应用程序,当我写sudo service apache2 reload时,我收到这样的错误:apache2.service is not active, cannot reload.

当我想看我的系统时,我得到这个。在

systemctl status apache2.service

● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: inactive (dead) since Sat 2017-03-11 19:34:43 UTC; 5min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 10065 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 9832 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
  Process: 10045 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

Mar 11 19:34:42 kristicbot systemd[1]: Starting LSB: Apache2 web server...
Mar 11 19:34:42 kristicbot apache2[10045]:  * Starting Apache httpd web server apache2
Mar 11 19:34:43 kristicbot apache2[10045]: Action 'start' failed.
Mar 11 19:34:43 kristicbot apache2[10045]: The Apache error log may have more information.
Mar 11 19:34:43 kristicbot apache2[10045]:  *
Mar 11 19:34:43 kristicbot apache2[10065]:  * Stopping Apache httpd web server apache2
Mar 11 19:34:43 kristicbot apache2[10065]:  *
Mar 11 19:34:43 kristicbot systemd[1]: Started LSB: Apache2 web server.
Mar 11 19:35:00 kristicbot systemd[1]: apache2.service: Unit cannot be reloaded because it is inactive.

在那之前,我做了一些更正-默认.conf文件。我改了一下:

^{pr2}$

我的botserver.py很简单:

from flask import Flask

app = Flask(__name__)

@app.route("/")
def hello():
        return "Hello {}".format(2+2)
if __name__ == '__main__':
        app.run(host='0.0.0.0')

~            

我的机器人服务器.wsgi公司名称:

import sys
sys.path.insert(0, 'var/www/html/bot')
from botserver import app as application

是什么导致了这个问题,我如何克服它?在


Tags: webappserverinitstatusserviceetcprocess