2017-03-13 12 views
0

私は2週間かけて腐食剤とプフペットを使用しました。私のローカルネットワーク内でのApacheのWWWフォルダ別のコンピュータから:puphpetはローカルネットワークからpuphpetを使って迷惑メールVMにアクセスできますか?

192.168.56.101 myserver.dev

を示唆するよう私の場合、私はちょうど今、私は私のVMへのアクセスを取得したい、私は私のホストファイルに追加し、そのhttp://myserver.dev使用します。

This postは、浮浪者、ファイルの一部の行のコメントを解除することをお勧めしますが、私は使用してpuphpet私の自動生成された浮浪者のファイルは、次のようになります。

# -*- mode: ruby -*- 

dir = File.dirname(File.expand_path(__FILE__)) 

require 'yaml' 
require "#{dir}/puphpet/ruby/deep_merge.rb" 
require "#{dir}/puphpet/ruby/to_bool.rb" 
require "#{dir}/puphpet/ruby/puppet.rb" 

configValues = YAML.load_file("#{dir}/puphpet/config.yaml") 

provider = ENV['VAGRANT_DEFAULT_PROVIDER'] ? ENV['VAGRANT_DEFAULT_PROVIDER'] : 'local' 
if File.file?("#{dir}/puphpet/config-#{provider}.yaml") 
    custom = YAML.load_file("#{dir}/puphpet/config-#{provider}.yaml") 
    configValues.deep_merge!(custom) 
end 

if File.file?("#{dir}/puphpet/config-custom.yaml") 
    custom = YAML.load_file("#{dir}/puphpet/config-custom.yaml") 
    configValues.deep_merge!(custom) 
end 

data = configValues['vagrantfile'] 

Vagrant.require_version '>= 1.8.1' 

Vagrant.configure('2') do |config| 
    eval File.read("#{dir}/puphpet/vagrant/Vagrantfile-#{data['target']}") 
end 

しかし、誰のコメントを解除行はありません。

私は多分puphpetのconfig.yamlで何かする必要があると思ったのですか?あなたは2つの単純な選択肢があり

machines: 
    vflm_azud9vpjzelv: 
     id: machine1 
     hostname: myserver.puphpet 
     network: 
      private_network: 192.168.56.101 
      forwarded_port: 
       vflmnfp_rkr38vlo4vcb: 
        host: '6597' 
        guest: '22' 
     memory: '512' 
     cpus: '1' 

答えて

1

: は、ここで私はIPアドレスとポートについて見つけたものだ

  • ベイグラントは、あなたのVMに公的にアクセス可能な、ランダムURLを開きvagrant shareコマンドが付属しています
  • ホストからVMへの転送ポートを作成します。たとえば、ホスト上のポート1080をVMのポート80に転送すると、http://localhost:1080に行くと、トラフィックはVMに転送されます。このためには、選択したポート(この場合は80)へのすべてのトラフィックをキャッチするように、Apache仮想ホストのエイリアスとして*を設定する必要があります。
関連する問題