From 8fd51f37e3ee552da21f067f204f0661cec150af Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 24 Oct 2013 14:32:49 -0700 Subject: [PATCH 1/4] Add chvhost.php - Changes root of webserver --- chvhost.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 chvhost.php diff --git a/chvhost.php b/chvhost.php new file mode 100644 index 0000000..7b4f7bb --- /dev/null +++ b/chvhost.php @@ -0,0 +1,19 @@ + + 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); +shell_exec("service apache2 reload"); +// var_dump($argv); From 43acf75c4edd49434fc4075f88a3cad324140f1a Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 24 Oct 2013 14:40:38 -0700 Subject: [PATCH 2/4] Clean up chvhost.php --- chvhost.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/chvhost.php b/chvhost.php index 7b4f7bb..fd97bcd 100644 --- a/chvhost.php +++ b/chvhost.php @@ -1,7 +1,6 @@ ServerName app.local DocumentRoot /vagrant/{{DOC}} @@ -14,6 +13,5 @@ '; $file_contents = str_replace("{{DOC}}", $location, $file_contents); -file_put_contents($path."vagrant_webroot", $file_contents); -shell_exec("service apache2 reload"); -// var_dump($argv); +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 From 64c31d9b226e615c67a55b3c694f00fe19180e2a Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 24 Oct 2013 14:49:09 -0700 Subject: [PATCH 3/4] Add instructions for using chvhost.php --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) 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 From 1fd9ae913f10104b3e454561a8b82849ad83cfa2 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 22 Jan 2014 23:21:20 -0800 Subject: [PATCH 4/4] Adds web_root dir --- web_root/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 web_root/.gitkeep diff --git a/web_root/.gitkeep b/web_root/.gitkeep new file mode 100644 index 0000000..e69de29