maxxd Posted October 25, 2018 Share Posted October 25, 2018 Hi all. It's late and I'm hoping I'm just missing something simple because I can't get this working and it's driving me a bit crazy. I'm trying to set up a simple vagrant Ubuntu 18.04 box. The up and provisioning is actually working so far as I can tell - I can connect to phpmyadmin through Firefox and I can ssh into the box after up, but trying to navigate to http://node.server.test in Firefox fails with a 404. And I'm confused about that. So, my Vagrantfile contains this: config.vm.synced_folder "../pkg", "/var/www", create: true, owner: "vagrant", group: "www-data", mount_options: ["dmode=777,fmode=777"] # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. config.vm.provider "virtualbox" do |vb| # # Name the VirtualBox vb.name = "Node Server Testing" # # Customize the amount of memory on the VM: vb.memory = "1024" and my provision script contains this: echo "install apache" sudo apt-get -y install apache2 VHOST=$(cat <<EOF <VirtualHost *:80> ServerName "node.server.test" DocumentRoot "/var/www/public_html" <Directory "/var/www/public_html"> AllowOverride All Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> EOF ) echo "${VHOST}" > /etc/apache2/sites-available/node.server.test.conf sudo a2ensite node.server.test sudo a2enmod rewrite sudo phpenmod mcrypt sudo service apache2 restart sudo rm -r /var/www/html Directory structure on the containing Windows box is as follows: D:\node_server_testing pkg\ os\ public_html\ index.html src\ js\ less\ sysfiles\ .vagrant\ setup.sh Vagrantfile This works in my other Vagrant boxes, but this one is simply not working. And again, what's weird is that I can connect to http://node.server.test/phpmyadmin/ without a problem. So I figure it's got to be an issue in the Vagrantfile sync directive or the setup Apache virtual host setup, but I can't find it. Many thanks in advance for any advice or pointing out the glaringly obvious mistake that I've made somewhere. Quote Link to comment https://forums.phpfreaks.com/topic/307810-vagrant-box-setup-not-working-and-im-missing-why/ Share on other sites More sharing options...
maxxd Posted October 25, 2018 Author Share Posted October 25, 2018 So, weird but ... I changed the ServerName to nodeserver.internal, destroyed the VM, rebooted my host machine, and ran vagrant up. It's all working now. No idea... Quote Link to comment https://forums.phpfreaks.com/topic/307810-vagrant-box-setup-not-working-and-im-missing-why/#findComment-1561717 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.