Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error with DocumentRoot in new Vagrant

I'm attempting to use Jeffrey Way's Vagrant setup (https://github.com/JeffreyWay/Vagrant-Setup) and it almost works for me on a Mac running Yosemite. When Apache restarts at the very end, I get an error stating:

==> default: AH00112: Warning: DocumentRoot [/var/www/html] does not exist
==> default: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

Prior to that in his install.sh, he's deleting the html directory and doing a symlink it looks like (I'm new to this, sorry).

To fix it, I ssh into Vagrant, edit /etc/apache2/sites-available/000-default.conf and change the DocumentRoot from /var/www/html to just /var/www and then I'm able to view my site on localhost:8080.

How should I be doing this though so it just works out of the box?

like image 823
Chris Farrugia Avatar asked Feb 01 '26 22:02

Chris Farrugia


1 Answers

Add the below line after the line sudo ln -fs /vagrant/public /var/www (#38) in install.sh

sed -i "s#DocumentRoot /var/www/html#DocumentRoot /var/www#g" /etc/apache2/sites-available/000-default.conf

Running the updated install script should automatically replace the DocumentRoot from /var/www/html to just /var/www

like image 126
kums Avatar answered Feb 04 '26 14:02

kums



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!