简体   繁体   English

Bottle Server无法在Centos上运行

[英]Bottle Server not working on Centos

I wrote a bottle application on windows and moved it to a centos server that is also running an apache web server. 我在Windows上编写了一个Bottle应用程序,然后将其移动到了同时运行Apache Web服务器的centos服务器上。 I have bottle running: 我正在运行瓶子:

Bottle v0.12.9 server starting up (using GeventServer())...
Listening on http://127.0.0.1:8080/
Hit Ctrl-C to quit.

Whenever I try to send a request to the server with curl http://127.0.0.1:8080/bottle/main.py it responds with this: 每当我尝试将请求发送给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>

And there is no activity shown on the server. 并且服务器上没有显示任何活动。 I think that somehow apache is usurping the request or something, but I have no idea. 我认为apache正在篡改请求或其他东西,但我不知道。 Any ideas? 有任何想法吗?

This is not how bottle works, If your code looks like this example: 这不是瓶子的工作方式,如果您的代码如下例所示:

import bottle

@bottle.route("/hello")
def func():
    return "hello!!!!!!!"

if __name__ == "__main__":
    bottle.run(port=8080)

Then browse to http://127.0.0.1:8080/hello 然后浏览到http://127.0.0.1:8080/hello

hello!!!!!!! 你好!!!!!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM