0

I attempted the top answer on this thread:

Vagrant port forwarding 80 to 8000 with Laravel Homestead

which was to make this change in the homestead.rb file:

config.vm.network "forwarded_port", guest: 80, host: 8000 to config.vm.network "forwarded_port", guest: 80, host: 80

I am running a newer version of homestead (not sure where to find the exact version), on a mac.

It did not work, when attempting to start up my homestead virtualbox it now says:

Vagrant cannot forward the specified ports on this VM, since they would collide with some other application that is already listening on these ports. The forwarded port to 80 is already in use on the host machine.

I had edited the homestead.rb file via ssh and vim while the homestead virtualbox was running, but now I can't get it to run and I can't figure out how to undo my changes.

Help with both of these would be greatly appreciated!

  1. How to edit the homestead.rb file when the virtualbox is not running? I believe it is inside either VirtualBox VMs/homestead/homestead.vbox or box-disk1.vmdk, but I do not know how to access inside them.

  2. Help with getting the port to forward correctly to 80 since the solution from the other question did not work.

8
  • @noeldiaz since it was your answer from the other question, if you could help that would be awesome. Commented Jan 30, 2015 at 1:41
  • Sure man. Ok, first thing, if you want to know where the homestead 2.+ files are, they are inside the .composer directory in your profile. So for me they are in: /Users/noel/.composer/vendor/laravel/homestead/scripts Now, you are sure you want to run on 80? Running on another not an option? Then it probably is your built in apache server on your mac or something else is grabbing that port 80. Do you maybe have another VM, or MAMP, or anything like that? If it is the built in apache server, try: apachectl stop To see if it stops running and releases 80. Commented Jan 30, 2015 at 1:53
  • Here is a link to some instructions to find out what might be using port 80 is you can't figure it out: mkyong.com/mac/mac-osx-what-program-is-using-port-80 Basically run: sudo lsof -i :80 And check the resulting list for clues on what it could be. Commented Jan 30, 2015 at 1:58
  • Thank you for responding so quickly! I was able to revert things back, thank you for pointing me to those files. Commented Jan 30, 2015 at 2:58
  • I killed my local apache server to free up Port 80 and the virtualbox did actually boot up, but my site would not work with just the ip as you had mentioned in your answer on the previous question. I went to the ip address that was specified in my homestead.yaml file, but it would not work. Feel free to add your answers from your comments as an actual answer so I can give you credit for the help. I will start up another question for what I am actually trying to accomplish -> test a facebook app on my application (but having to include the port: 8000 does not work with the fb app api. Commented Jan 30, 2015 at 3:02

1 Answer 1

2

Homestead 2.+ stores it's files inside your .composer directory inside your User directory. For example, for me it is in:

/Users/noel/.composer/vendor/laravel/homestead 

You will find all the configuration and script files that used to reside in the older Homestead 1.0 directories.

Now, since something is holding on to your port 80, it probably means that your local apache installation is running. You can test to see what is holding on to the port by running:

sudo lsof -i :80 

To list all processes listening on port 80 (incoming and outgoing).

To stop the local apache you can run:

sudo apachectl stop 

That should release the port for you to use with your virtual machine.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.