我的烧瓶代码位于 app.py
中/some code//
if __name__ == '__main__':
app.run()
并且我已经按照路径/var/www/AutomateTests
#!/usr/bin/python3.6
import sys
import logging
sys.path.insert(0,"/var/www/AutomateTests/")
from app import app as application
application.root_path = '/var/www/AutomateTests/'
我有/etc/apache2/sites-available/automate_tests.conf
VirtualHost *:80>
ServerName htstool.arubanetworks.com
ServerAdmin admin@htstool.arubanetworks.com
ServerAlias htstool.arubanetworks.com
ErrorLog /var/log/apache2/hts-error.log
CustomLog /var/log/apache2/htstool-access.log combined
WSGIDaemonProcess AutomateTests user=www-data group=www-data threads=5
WSGIScriptAlias / /var/www/AutomateTests/automate_tests.wsgi
<Directory /var/www/AutomateTests>
WSGIProcessGroup AutomateTests
WSGIApplicationGroup %{GLOBAL}
Order allow,deny
Allow from all
</Directory>
LogLevel info
</VirtualHost>
我已经正确设置了所有内容,并且已经在这个问题上停留了几周了。可以帮我如何在服务器上启动它。我缺少步骤了吗?
im设置与我的端口相同的错误正在使用中,尽管它不是! 看到我的错误图片
但是您可以看到我的端口是空的,没有被使用。我使用命令netstat -ntlp
see my ports are listening and not established
有人可以请帮助我。我被卡住了,在完全检查之前不要将其标记为已回答。我尝试了所有答案,但它们不起作用!请耐心等待,并让其他人帮助我,因为我自己做不到。
我的服务器运行正常,我看到默认的ubuntu页面,这意味着我的apache2服务器运行正常,因此配置或端口出了问题
答案 0 :(得分:0)
当我看到这件事时,我想到两件事。
但是您可以看到我的端口是空的,没有被使用。我使用命令netstat -ntlp
进行检查
请注意该命令的输出的第一行:(Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.)
Apache以提升的特权运行,因此您需要以root用户身份运行(将sudo
附加到命令的开头)以查看其内容。端口绑定。我敢打赌,这就是问题所在。解决此问题后,您可能会遇到以下问题:
还有另一件事,与脚本无关,但看起来您正在屏幕截图中使用AWS EC2(如果我错了,请纠正我)。如果您希望能够从公共互联网通过端口80访问该实例,则需要确保您allow it in the Security Group。我知道这会对首次使用AWS EC2的人们造成一些混乱,这确实对我造成了困扰。
希望这会有所帮助!