Summer Sale! All accounts are 50% off this week.

ryand's avatar

Homestead serve Not Restarting nginx

I updated my local development environment to the new version of Homestead with Ubuntu 16.04 per the Laravel 5.2 documentation.

I've always been able to run something like the following from within the homestead machine:

$ serve new-project.app /home/vagrant/Code/new-project/public

This has been my go to video for quick project setup (one of Jeffrey's). It shows the process well. Really nice workflow.

And it would restart nginx, outputting something this:

dos2unix: converting file /vagrant/scripts/serve.sh to Unix format ...
nginx stop/waiting
nginx start/running, process 20087
php5-fpm stop/waiting
php5-pfm start/running, process 20102

And that would allow me to serve new projects without having to update the hosts file.

Now when I run serve in that way, the output is only as follows:

dos2unix: converting file /vagrant/scripts/serve.sh to Unix format ...

And I have to restart nginx before I can serve the new project by running this next:

$ sudo service nginx restart

Haven't addressed the stopping and starting of php5-fpm yet and am not sure of its implications.

I'm just wanting to make sure I'm not missing something. Are others experiencing the serve command running differently than before?

0 likes
4 replies
jekinney's avatar

Homestead provision or vagrant provision should restar an load all the services

ryand's avatar

Thanks, @jekinney. I had done that and had even restarted my computer. I know Taylor and others in recent months had been discussing some breaking changes that the updated Vagrant/Ubuntu box settings had caused relating to vagrant commands.

I'm not certain this is related, but I know that this workflow (first couple mins of video) now requires me to restart nginx instead of doing it automatically. Was just hoping to understand what may have changed or if this is my error and correct it if possible.

michaeldyrynda's avatar
Level 41

It looks like the functionality was removed from the serve command. Note that serve as removed some time ago in favour of separate serve-laravel, serve-symfony2, serve-proxy, and serve-hhvm commands. None of which are documented currently, though I'm not sure if this is via intentional omission or just being missed out.

The serve command ought to be considered legacy now, I think, given it's no longer documented and the Homestead docs suggest editing the Homestead.yaml file and running vagrant provision after adding new files.

1 like
ryand's avatar

Thanks, @deringer! Excellent removed link. Exactly the confirmation I was looking for.

I was hoping that the docs were just missing the serve command reference and that Taylor wasn't moving away from it. I don't mind updating the Homestead.yaml file but thought the serve command approach to be slicker.

Appreciate it very much. Thanks again!

Please or to participate in this conversation.