支持 PHP v2 的轻量级开发 Web 服务器

发布于 2024-08-09 14:06:54 字数 858 浏览 8 评论 0原文

根据这个问题: 适用于 PHP 的轻量级 Web 应用服务器?

上述问题已被多次提出,并且在我使用谷歌找到的所有案例中,答案都完全相同。我的问题与学位类似,但具有不同的期望目标:按需开发实例。

为了开发测试的目的,我提出了一个有点可疑的解决方案来在我的用户帐户中托管任意目录。我对自定义虚拟主机不感兴趣,但希望模拟我在 Python 和 mongrel 中使用 Paster 或 mongrel 时得到的行为。分别是红宝石。

乌班图9.10 TOXIC@~/ >APACHE_RUN_USER=$USER APACHE_RUN_GROUP=www-data apache2 -d ~/Desktop/ -c "Listen 2990"

有没有更好的解决方案,我可以用 nginx 或 lighttpd 做类似的事情吗?

笔记: 如果没有复制和复制,以上内容将无法在库存环境中正常工作。更改httpd.conf。

更新: 理想的目标是模仿 Paster、Webbrick 和 Mongrel 进行快速本地开发托管。对于那些轻量级服务器,只需不到一分钟即可运行工作实例(不考虑任何数据库支持)。 Apache2 vhost 很棒,但我已经使用 Apache2 十多年了,在 /etc/hosts 中设置一个新条目将是某种令人厌恶的黑客行为,除非你有自己的 DNS,在这种情况下,通配符子域设置可能会工作得很好。除了一个问题之外,我很容易知道正在托管的内容(例如通过 Paster 或 mongeral ),只需执行 sudo netstat -tulpn ,而在弄清楚哪个虚拟主机是什么时很可能会产生混淆。

In line with this question:
Lightweight web app server for PHP?

The above question has been asked numerous times and answered exactly the same in all the cases I've found using google. My question is similar to a degree but with a different desired goal: On demand development instances.

I have come up with a somewhat questionable solution to host arbitrary directories in my user account for the purpose of development testing. I am not interested in custom vhosts but looking to emulate the behaviour I get when using paster or mongrel for Python & Ruby respectively.

Ubuntu 9.10
TOXIC@~/ >APACHE_RUN_USER=$USER APACHE_RUN_GROUP=www-data apache2 -d ~/Desktop/ -c "Listen 2990"

Is there a better solution, could I do something similar with nginix or lighttpd?

Note:
The above won't work correctly for stock environments without a copied & altered httpd.conf.

Update:
The ideal goal is to mimic Paster, Webbrick, and Mongrel for rapid local development hosting. For those light weight servers, it takes less then a minute to get a working instance running ( not factoring any DB support ). Apache2 vhost is great but I've been using Apache2 for over ten years and it would be some sort of abomination hack to setup a new entry in /etc/hosts unless you have your own DNS, in which case a wildcard subdomain setup would probably work great. EXCEPT one more problem, it's pretty easy for me to know what is being hosted ( ex. by paster or mongeral ) just doing a sudo netstat -tulpn while there would be a good possibility of confusion in figure out which vhost is what.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

好菇凉咱不稀罕他 2024-08-16 14:06:54

您看过nanoweb吗?看起来它可能符合您的要求:

  1. 用 php 编写,因此一旦启动并运行,服务页面应该非常快
  2. 可以从用户的主目录安装和运行

注意: 我还没有尝试过我自己,我很高兴使用 apache,但我想我应该传递信息

Have you looked at nanoweb? It looks like it might fit your requirements:

  1. Written in php, so once its up and running, serving pages should be pretty fast
  2. Can be installed and run from a user's home directory

Note: I haven't tried it myself, I'm pretty happy using apache, but I thought I'd pass the info along

歌枕肩 2024-08-16 14:06:54

如果您正在寻找一个轻量级解决方案只是来节省自己的时间,我建议您不应该这样做。

如果您在开发机器时坚持使用 ol' LAMP 软件包,那么您可以节省时间,并且可能会解决很多很多的麻烦。

If you're looking for a lightweight solution only to save yourself time, I suggest you shouldn't.

You save time and probably lots and lots of headaches if you stick to the ol' LAMP software packages when it comes to development machines.

平定天下 2024-08-16 14:06:54

Apache 2.x 文档中的动态配置的海量虚拟主机可能是回答你的问题。

我同意开发配置应该尽可能接近生产环境。

Dynamically Configured Mass Virtual Hosting from Apache 2.x documentation may be an answer to your question.

I agree that development configuration should be as close as possible to production environment.

倒数 2024-08-16 14:06:54

http://code.google.com/p/phpmvchelpers/wiki/script_serve

这就是我想要实现的目标,我编写的黑客并不完美,但它很实用。需要几个小时的工作来拨入重写规则和一些更多的温习工作,但它对于 Kohana 和 Kohana 来说是有用的。 CakePHP...不过仍在研究 Recess 框架。

http://code.google.com/p/phpmvchelpers/wiki/script_serve

This is what I was looking to accomplish, the hack I made up isn't perfect but its functional. Needs a couple more hours work to get the re-write rules dialed in and some more brush up work but its functional for Kohana & CakePHP... still working on Recess framework though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文