是否有可能一个普通的Web服务器上使用Apache节俭? [英] Is it possible to use Apache Thrift on a regular web server?

查看:97
本文介绍了是否有可能一个普通的Web服务器上使用Apache节俭?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经有一个我支付一个Web服务器,我想它使用节俭和PHP上暴露一些服务。

我的问题是:我能使用的默认端口上承载的正常PHP(以同样的方式网页都托管)上运行,而不是具有一些时髦的模糊端口上运行一个单独的PHP应用程序旧货服务器。这样,我就不必更改服务器配置(这东西我不能即使我想要做的)。

感谢

编辑:也许我应该澄清多一点。一旦我定义使用.thrift文件我的服务,是有可能:


  1. 运行节俭code发电机

  2. 以生成code并把它放在我的web服务器

  3. 创建它说(在伪code)的index.php文件创建服务的一个新实例,并处理传入的请求?


解决方案

好吧,好吧我想通了我自己的答案!

如果您使用的是 TPhpStream 在服务器端,您可以服务于作为常规的HTTP请求来请求。

非常感谢罗布·威尔克森<一个href=\"https://github.com/robwilkerson/Thrift-Client-Server-Example--PHP-\">https://github.com/robwilkerson/Thrift-Client-Server-Example--PHP-.

我也博客上讲述如何实现与PHP和Python在<一个简单的例子href=\"http://willwarren.com/2012/01/24/creating-a-public-api-with-apache-thrift/\">http://willwarren.com/2012/01/24/creating-a-public-api-with-apache-thrift/

I already have a web server that I pay for, and I want to expose some services on it using Thrift and PHP.

My question is: can I run a Thrift server using normal PHP that's hosted on the default port (the same way web pages are hosted) instead of having a separate PHP application that runs on some funky obscure port. This way I wouldn't have to change the server configuration (which is something I'm not able to do even if I wanted to).

Thanks

EDIT: maybe I should clarify a bit more. Once I've defined my service using a .thrift file, is it possible to:

  1. Run the thrift code generator
  2. Take the generated code and put it on my webserver
  3. Create an index.php which says (in pseudocode) "create a new instance of the service, and handle incoming requests"?

解决方案

Okay, well I have figured out the answer on my own!

If you use a TPhpStream on the server side, you are able to serve requests coming in as regular http requests.

Many thanks to Rob Wilkerson https://github.com/robwilkerson/Thrift-Client-Server-Example--PHP-.

I also blogged about how to implement a simple example with PHP and Python at http://willwarren.com/2012/01/24/creating-a-public-api-with-apache-thrift/

这篇关于是否有可能一个普通的Web服务器上使用Apache节俭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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