如何与https共享一个流浪汉机器

时间:2017-01-31 14:08:35

标签: vagrant virtual-machine vagrantfile vagrant-share

我有一个工作流浪汉我想要Share。在我的Vagrantfile中,我有:

config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "private_network", ip: "192.168.1.15"
config.vm.network "forwarded_port", guest: 443, host: 443

在我拥有的虚拟主机中

<VirtualHost *:443>
...
ServerAlias *.vagrantshare.com
....
</Virtualhost>

不确定第一行但它已经存在

我与

共享机器
vagrant share --https 443

这是输出:

==> default: Detecting network information for machine...
default: Local machine address: 127.0.0.1
default:  
default: Note: With the local address (127.0.0.1), Vagrant Share can only
default: share any ports you have forwarded. Assign an IP or address to your
default: machine to expose all TCP ports. Consult the documentation
default: for your provider ('virtualbox') for more information.
default:  
default: Local HTTP port: 8080
default: Local HTTPS port: 443
default: Port: 2222
default: Port: 443
default: Port: 8080
==> default: Checking authentication and authorization...
==> default: Creating Vagrant Share session...
default: Share will be at: towering-badger-9312
==> default: Your Vagrant Share is running! Name: towering-badger-9312
==> default: URL: http://towering-badger-9312.vagrantshare.com
==> default:  
==> default: You're sharing your Vagrant machine in "restricted" mode. This
==> default: means that only the ports listed above will be accessible by
==> default: other users (either via the web URL or using `vagrant connect`).

我可以在流浪云中看到它,但我在尝试通过https访问它时遇到错误:

towering-badger-9312.vagrantshare.com is currently unable to handle this request.
HTTP ERROR 500

控制台中没有任何其他有用的消息,任何想法如何调试?

感谢

1 个答案:

答案 0 :(得分:1)

替换此行

config.vm.network "forwarded_port", guest: 443, host: 443

与ie。

config.vm.network "forwarded_port", guest: 443, host: 8443

首先,因为forwarded_port用于从主机访问,其次,您应该无法绑定到主机上的端口443。

另外

vagrant share --https 443

是多余的(docs):

  

HTTPS(SSL)

     

Vagrant Share还可以公开可以访问的SSL端口   SSL。例如,不是访问http://foo.vagrantshare.com,而是访问https://foo.vagrantshare.com   可以在beforeCapture访问。

     默认情况下,

vagrant share会查找您的端口443上的任何SSL流量   发展环境。如果找不到任何内容,则禁用SSL   默认情况下。

所以

vagrant share

应该足够(假设没有其他问题)。