无业游民-无法通过公共IP获得乘客

时间:2019-02-13 21:25:58

标签: vagrant passenger

无业游民-Ubuntu 16.04-乘客(具有嵌入式nginx的独立服务器)-Ruby

我打算通过上述配置在本地计算机上部署公共服务器。 看来一切正常,我从本地计算机的浏览器以及通过本地wifi的移动设备对其进行了测试。 然后我尝试使用其他IP并通过4G在同一移动设备上尝试,但没有成功。

无业游民的配置:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  # Every Vagrant virtual environment requires a box to build off of.
  config.vm.box = "bento/ubuntu-16.04"

  # The url from where the 'config.vm.box' box will be fetched if it
  # doesn't already exist on the user's system.
  config.vm.box_url = "https://app.vagrantup.com/bento/boxes/ubuntu-16.04"

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  config.vm.network :forwarded_port, guest: 3000, host: 3000
  # Using a private network seems to be slightly faster, but it's simpler to point a browser to a forwarded port, so I'll leave that as the default.

  config.vm.network :"public_network"

#  config.vm.provision :shell, path: 'puppet/ubuntu.sh'

#  config.vm.provision :puppet do |puppet|
#    puppet.manifests_path = "puppet/manifests"
#    puppet.manifest_file  = "init.pp"
#  end

  config.vm.provider "virtualbox" do |v|
    v.customize ["modifyvm", :id, "--natdnsproxy1", "off"]
    v.customize ["modifyvm", :id, "--natdnshostresolver1", "off"]
    v.customize ["modifyvm", :id, "--memory", "12288", "--ioapic", "on", "--cpus", 4]
  end

有人可以帮助我如何从外部访问服务器,在这种环境下合适的设置是什么? 谢谢!

0 个答案:

没有答案