[英]Bottle Server not working on Centos
我在Windows上編寫了一個Bottle應用程序,然后將其移動到了同時運行Apache Web服務器的centos服務器上。 我正在運行瓶子:
Bottle v0.12.9 server starting up (using GeventServer())...
Listening on http://127.0.0.1:8080/
Hit Ctrl-C to quit.
每當我嘗試將請求發送給curl http://127.0.0.1:8080/bottle/main.py的服務器時,它都會響應:
HTTP/1.1 404 Not Found
Date: Tue, 12 Jul 2016 18:59:29 GMT
Content-Length: 233
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL http://127.0.0.1:8080/bottle/main.py was not found on this server.</p>
</body></html>
並且服務器上沒有顯示任何活動。 我認為apache正在篡改請求或其他東西,但我不知道。 有任何想法嗎?
這不是瓶子的工作方式,如果您的代碼如下例所示:
import bottle
@bottle.route("/hello")
def func():
return "hello!!!!!!!"
if __name__ == "__main__":
bottle.run(port=8080)
然后瀏覽到http://127.0.0.1:8080/hello
你好!!!!!!!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.