Adding Additional Sites to homestead without vagrant reload --provision
Having used homestead for some time now, I have found that adding additional sites by following the guide at laravel doc quite cumbersome.
I think that it would be less cumbersome if additional site is added by adding additonal nginx configuration directly. I would recap my steps on adding local domain "melati.dev" below:
- Add melati.dev record to file /etc/hosts in the host machine, host OS. All the below commands were executed at virtual machine, guest OS (steps 2 up to 5)
- Duplicate the default site configuration homestead.app to melati.dev (it's located at /etc/nginx/sites-available)
- Create symbolic link from sites-vailable to sites-enabled:
ln -sf /etc/nginx/sites-available/melati.dev /etc/nginx/sites-enabled/melati.dev - Edit melati.dev file to reflect what the domain is wanted to be (items needed to be changed: server_name, root, error_log, ssl_certificate, ssl_certificate_key)
- Reload nginx using sudo invoke-rc.d nginx reload
That's all what I did to add additional sites in homestead. Hope it would be helpful! Thanks for reading ^_^ !
Comments
Post a Comment