diff --git a/README.md b/README.md index 6190c1a..1dd2381 100644 --- a/README.md +++ b/README.md @@ -35,3 +35,9 @@ You're all set up. The webserver will now be accessible from http://localhost:88 * vim * emacs +## Changing Server Document root + + $ cd /vagrant + $ sudo php chvhost.php "myproject/public" + +This sets the server document root to `/vagrant/myproject/public`. \ No newline at end of file diff --git a/chvhost.php b/chvhost.php new file mode 100644 index 0000000..fd97bcd --- /dev/null +++ b/chvhost.php @@ -0,0 +1,17 @@ + + ServerName app.local + DocumentRoot /vagrant/{{DOC}} + + DirectoryIndex index.php index.html + AllowOverride All + Order allow,deny + Allow from all + + +'; +$file_contents = str_replace("{{DOC}}", $location, $file_contents); +file_put_contents($path."vagrant_webroot", $file_contents);//Overwrite the new virtualhost +shell_exec("service apache2 reload");//Restart the apache \ No newline at end of file diff --git a/web_root/.gitkeep b/web_root/.gitkeep new file mode 100644 index 0000000..e69de29