PHP HTTP 服务器?端口 80、443-444、1000-3000、8000-9000。 (无阿帕奇)
我很快就会在服务器上升级到 Linux Debian 6.0 "Squeeze"
,我想知道如何使用 Python 作为网络服务器在许多专用于不同事物的端口上。
Ports Directory Description
80, 443 /var/www/sitegen/ Take all domains and generate a site from the SQL DB
444, 1000-3000 /var/www/manager/ Take 444 as a PHP server manager and the rest to be forwarded to serial hardware.
8000-9000 The VMs DIR Forward the port to port 80 (or 443 by settings) on the VMs.
这意味着端口 443 可用于许多站点(由相同的代码提供支持,只是在 SQL DB 中有所不同)
I will upgrading to Linux Debian 6.0 "Squeeze"
on the server soon and I want to know how I can use Python as a web-server on many ports dedicated for different things..
Ports Directory Description
80, 443 /var/www/sitegen/ Take all domains and generate a site from the SQL DB
444, 1000-3000 /var/www/manager/ Take 444 as a PHP server manager and the rest to be forwarded to serial hardware.
8000-9000 The VMs DIR Forward the port to port 80 (or 443 by settings) on the VMs.
This Means that the port 443 could be used for many sites (powered by the same code just diffrent in the SQL DB)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不是 PHP 问题,因为 PHP 解释器不直接侦听端口。在 Linux 上,它将(通常)在 Apache 中运行。 Apache 可以配置为侦听多个端口,甚至可以基于每个虚拟主机。
另外,请注意,HTTPS 的性质使得多个虚拟主机不可能使用自己的 SSL 证书并且仍然侦听同一端口。他们每个人都需要自己的证书,并且需要侦听自己的端口。
此外,向运行在盒子上的虚拟机发送特定端口与Web服务器无关,更与执行环境无关。这是配置虚拟网络内的端口转发以及虚拟机中的本地 Web 服务器配置的组合。
This isn't a PHP question as the PHP interpreter doesn't directly listen on ports. On Linux, it will (usually) run inside Apache. Apache can be configured to listen to multiple ports, and even on a per-virtual host basis.
Also, be aware that the nature of HTTPS makes it impossible for multiple virtual hosts to use their own SSL certificate and still all listen on the same port. They will each need their own certificate and need to listen on their own port.
In addition, sending specific ports to virtual machines running on the box is nothing to do with the web server, let alone the execution environment. This is a mix of configuring the port forwarding inside the virtual network, coupled with local web server configuration in your virtual machines.
在Python中:
In python: