Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/338.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Debian上的端口映射HTTP服务器?_Python_Linux_Http_Ip_Raspberry Pi - Fatal编程技术网

Python Debian上的端口映射HTTP服务器?

Python Debian上的端口映射HTTP服务器?,python,linux,http,ip,raspberry-pi,Python,Linux,Http,Ip,Raspberry Pi,所以我是Mac用户。我几乎没有使用Linux的经验。因此,当我想在运行Debian派生的Raspbian的Raspberry Pi上托管一个临时web服务器时,我被卡住了 我在终端中使用sudopython-msimplehttpserver在localhost上托管本地服务器,但我需要将其映射到端口80上的mu public IP。在我的MacBook上我用的,而且很好用。是否有一些软件或命令,我可以做映射到我的'圆周率 非常感谢 Alex我正在Ubuntu上工作,在Debian上也将如此 $

所以我是Mac用户。我几乎没有使用Linux的经验。因此,当我想在运行Debian派生的Raspbian的Raspberry Pi上托管一个临时web服务器时,我被卡住了

我在终端中使用sudopython-msimplehttpserver在localhost上托管本地服务器,但我需要将其映射到端口80上的mu public IP。在我的MacBook上我用的,而且很好用。是否有一些软件或命令,我可以做映射到我的'圆周率

非常感谢


Alex

我正在Ubuntu上工作,在Debian上也将如此

$ python -m SimpleHTTPServer
即使没有sudo,它也可以工作,因为它服务于非特权端口8000

如果您想在端口80上服务,则必须使用sudo,并在命令行上传递端口号:

$ sudo python -m SimpleHTTPServer 80

无需转发此端口,它已提供服务

警告:SimpleHTTPServer不是最安全的web服务器,请小心以这种方式向公众公开您的计算机

使用rinetd进行端口转发
如果您想进行真正的端口转发,有一个名为rinetd的服务。很容易配置。

不需要转发此端口为什么不转发?在典型的情况下,它仅在本地网络上提供服务configuration@guest-你说得对。添加了对rinetd的引用