Vagrant 端口转发不起作用.主机无法使用杯子 [英] Vagrant port forwarding not working. Cups not accesible from host
问题描述
所以我正在使用 vagrant 并且我正在尝试将其用作打印服务器.我安装了杯子.
So I'm working with vagrant and I'm trying to use it as a printing server. I installed cups.
在内部一切正常.我什至可以快速 curl
到我的 localhost:631(我的 vagrant 中的杯子端口),然后就可以了.
Internally everything works just fine. I can even make a quick curl
to my localhost:631 (cups port inside my vagrant) and there's everything.
问题是我无法通过主机尝试以任何方式访问它.
The thing is I cant access it in any way I try from the host machine.
显然我转发了端口,并且尝试了几个端口.我也尝试过 Debian 挤压和 Ubuntu 12.04.这是我当前的 Vagrantfile
Obviously I forwarded the port and I've tried with several ports. I've also tried with Debian squeeze and Ubuntu 12.04. Here is my current Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "guruDebian"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :forwarded_port, guest: 631, host: 6363 ## HERE IS CUPS
end
有什么想法吗?
推荐答案
我想你会发现,出于安全原因,默认的 cups 配置文件被锁定为只能在本地主机上工作.
I think what you will find is that the default cups config file is locked down to only work from localhost for security reasons.
在您的 Vagrant VM 中打开 /etc/cups/cupsd.conf
文件并更改以下行:
Inside your Vagrant VM open the /etc/cups/cupsd.conf
file and change the following line:
Listen localhost:631
到
Listen 0.0.0.0:631
这应该允许您从任何主机连接.
That should allow you to connect from any host.
这篇关于Vagrant 端口转发不起作用.主机无法使用杯子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!