2016-10-03 9 views
-1

ホームステイで2つのラーベルプロジェクトを実行しています。プロジェクトが配置されている私のPCですべてがうまく動いています。しかし、ネットワーク上の他のコンピュータでは、動作しません。ホームステッドで実行されているLaravelプロジェクトを決定する方法

は、ここに私のHomestead.yamlです:


ip: "192.168.10.10" 
memory: 2048 
cpus: 1 
provider: virtualbox 

authorize: ~/.ssh/id_rsa.pub 

keys: 
    - ~/.ssh/id_rsa 

folders: 
    - map: C:\Users\Lekz\development\projects\laravel 
     to: /home/vagrant/Code 

sites: 
    - map: laravel.dev 
     to: /home/vagrant/Code/acctg_pending2/public 
    - map: homestead.app 
     to: /home/vagrant/Code/test/public 

databases: 
    - addessa_acctg_pending 
    - testdb 

# blackfire: 
#  - id: foo 
#  token: bar 
#  client-id: foo 
#  client-token: bar 

# ports: 
#  - send: 50000 
#  to: 5000 
#  - send: 7777 
#  to: 777 
#  protocol: udp 

そして、私のホストファイル:

# Copyright (c) 1993-2009 Microsoft Corp. 
# 
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows. 
# 
# This file contains the mappings of IP addresses to host names. Each 
# entry should be kept on an individual line. The IP address should 
# be placed in the first column followed by the corresponding host name. 
# The IP address and the host name should be separated by at least one 
# space. 
# 
# Additionally, comments (such as these) may be inserted on individual 
# lines or following the machine name denoted by a '#' symbol. 
# 
# For example: 
# 
#  102.54.94.97  rhino.acme.com   # source server 
#  38.25.63.10  x.acme.com    # x client host 

# localhost name resolution is handled within DNS itself. 
# 127.0.0.1  localhost 
# ::1    localhost 

# redirecting this is just a bad idea 127.0.0.1  localhost 
# redirecting this is just a bad idea 127.0.0.1  localhost 
# redirecting this is just a bad idea 127.0.0.1  localhost 
# redirecting this is just a bad idea 127.0.0.1  localhost 
# redirecting this is just a bad idea 127.0.0.1  localhost 
#127.0.0.1  localhost 
192.168.10.10 laravel.dev 
192.168.10.10 homestead.app 

私は私のPCで問題なく二つのプロジェクトを実行することができます。しかし、私がネットワーク上の他のコンピュータでこれらのプロジェクトを実行する傾向がある場合、それは機能しません。 2番目のプロジェクトは192.168.1._:8000 (my PC's IP)と入力するだけです。

同じIPを持つネットワーク上の他のコンピュータのプロジェクトを特定するにはどうすればよいですか?私のhostsファイルのように:

192.168.10.10 laravel.dev 
192.168.10.10 homestead.app 
+0

仮想サイトを/ var/apache2/sites-available/...またはこのように作成していますか? –

+0

@QuỳnhNguyễn、どういう意味ですか?多分、私はそれをする方法を知らない。 –

答えて

0

あなたは、割り当てられたIPアドレス192.168.10.10

とそのIPアドレスを介してアクセスしますホームステッドVMを実行しているマシンを仮想マシンを使用しています。

ホストファイルは、VMホームステードのそのIPアドレスへのエイリアスです。

..

誰かが、彼らはVMの詳細を自分のホームステッド(別名ベイグラント)のインスタンスをスピンアップすることができ、あなたのインスタンスのvagrantFileを取る場合。

vagrantFileを使用する新しいマシンでは、Homestead/Vagrant.yamlファイルに記載されているものと同じIPアドレスに一致するようにホストファイルを編集する必要があります。

あなたは、プロジェクトのルートディレクトリから

php artisan serve 

コマンドを使用して行うことができますポートを使用して、ローカルマシンのIPアドレスを介してlaravelインスタンスにサービスを提供したい場合。ただし、sqlとcomposerの追加の依存関係が必要な場合があることに注意してください。

+0

私はすでにホストファイルを他のコンピュータに設定していますが、動作しません。 –

+0

他の(コンピュータコードがクローンされている)コンピュータには、迷惑メール/ホームステッドとバーチャルボックスがインストールされていますか? – developernator

+0

いいえ、必要ですか? –

関連する問題