Vagrant Share - Accessing Virtual Hosts and accessing those that are not in the default web root

主宰稳场 提交于 2019-12-03 07:02:48

Struggled with this a bit, your update pointed me in the right direction though.

What I ended up doing is as follows:

  1. vagrant share
  2. ssh to VM
  3. sudo vi /etc/apache2/sites-enabled/your-site-name.conf
  4. change ServerName to your-generated-name.vagrantshare.com
  5. sudo service apache2 reload

EDIT:

If you'd like to have access to the virtualhost on several domains (i.e. vagranshare's domain and your local like example.dev) After step 4 add ServerAlias example.dev to /etc/apache2/sites-enabled/ your-site-name.conf

Thanks, hope this helps anyone with as little server-knowledge as I have.

Change your WhateverItIs.conf file followingly by adding ServerAlias:

ServerName WhateverItIs.com
ServerAlias *.vagrantshare.com 

and now you are good to go.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!