面料似乎启动apache2但没有 [英] fabric appears to start apache2 but doesn't

查看:87
本文介绍了面料似乎启动apache2但没有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Fabric远程启动微型AWS服务器,安装git和git存储库,调整apache配置,然后重新启动服务器。

I'm using fabric to remotely start a micro aws server, install git and a git repository, adjust apache config and then restart the server.

如果有的话点,我从fabfile中发出

If at any point, from the fabfile I issue either

sudo('service apache2 restart') run('sudo service apache2 restart')或先停止再启动,该命令显然运行,例如,我得到指示apache已启动的响应

sudo('service apache2 restart') or run('sudo service apache2 restart') or a stop and then a start, the command apparently runs, I get the response indicating apache has started, for example

[ec2-184-73-1-113.compute-1.amazonaws.com] sudo: service apache2 start
[ec2-184-73-1-113.compute-1.amazonaws.com] out:  * Starting web server apache2
[ec2-184-73-1-113.compute-1.amazonaws.com] out:    ...done.
[ec2-184-73-1-113.compute-1.amazonaws.com] out: 

但是,如果我尝试连接,则连接被拒绝,并且如果我SSH进入服务器并运行
sudo service apache2 status ,它说: Apache未运行

However, if I try to connect, the connection is refused and if I ssh into the server and run sudo service apache2 status it says that "Apache is NOT running"

虽然已插入,但如果运行
sudo service apache start ,服务器已启动,我可以连接。其他人有没有经历过?还是有人在日志文件等中有关于我可以看的地方的任何提示以弄清发生了什么。 apache2 / error.log syslog auth.log

Whilst sshed in, if run sudo service apache start, the server is started and I can connect. Has anyone else experienced this? Or does anyone have any tips as to where I could look, in log files etc to work out what has happened. There is nothing in apache2/error.log, syslog or auth.log.

这没什么大不了的,我可以解决。我只是不喜欢这种无声的失败。

It's not that big a deal, I can work round it. I just don't like such silent failures.

推荐答案

您正在运行哪个版本的Fabric?

Which version of fabric are you running?

您是否尝试过更改 pty 参数(也尝试更改 shell ,但是

Have you tried to change the pty argument (try to change shell too, but it should not influence things)?

http://docs.fabfile.org/en/1.0.1/api/core/operations.html#fabric.operations.run

您可以这样设置 pty 参数:

sudo('service apache2 restart', pty=False)

这篇关于面料似乎启动apache2但没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆