I started a ubuntu vm via vagrant. Fine the vagrantfile below. And the apache.sh(placed inside of a folder named provision) file to provision apache also follow.
I get the get the following error after I launch my vm.
Not Found
The requested URL was not found on this server.
Apache/2.4.29 (Ubuntu) Server at localhost Port 9080
I have seen quite a few posts for this, but could not find a solution so far. Please help.
As per this
video, I have to modify /etc/apache2/apache2.conf, but I am not sure what I should add to the config for my simple case.
The Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
config.vm.synced_folder '.', '/vagrant'
config.vm.network "forwarded_port", guest: 80, host: 9080 #, host_ip: "127.0.0.1"
config.vm.provision "apache", type: "shell", path: "provision/apache.sh", privileged: true
# vagrant up --provision-with=apache
end
Now the apache.sh provisioning file
#!/usr/bin/env bash
# sodo is not needed because Vagrant will run the script as root, so there is no need to actually use sudo.
# We are announcing to the user
echo "Installing apache ..."
apt-get update
apt-get install -y apache2
rm -rf /var/www
ln -fs /vagrant /var/www
Finally the screen shot of the error that I am getting after launching the vm with vagrant up command
