Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webserver is not accesible #207

Closed
ilazaridis opened this issue Apr 17, 2016 · 17 comments
Closed

Webserver is not accesible #207

ilazaridis opened this issue Apr 17, 2016 · 17 comments

Comments

@ilazaridis
Copy link

Scotch box is installed successfully. I can ssh to it.
But I can't access http://192.168.33.10.

vagrant 1.8.1
virtualbox 5.0.16

Similar to #169

@ilazaridis ilazaridis changed the title Webserver is not accesible. Webserver is not accesible Apr 17, 2016
@midlifecoder
Copy link

same here

@Ettemlevest
Copy link

I had the same kind of problem. I'm using Vagrant 1.7.4 with Virtualbox 5.0.16 on a Windows 10 machine. Scotch box booted up with only the ssh port forwarded. So I had to add 8080 port to my Vagrantfile:

config.vm.network "forwarded_port", guest: 80, host: 8080

After a vagrant reload I can acces the welcome page at http://192.168.33.10:8080.
Before the manual changing of the config file I tried Vagrant 1.8.1 without success. I think it can help but don't know what causing this problem.

@jajouka79
Copy link

jajouka79 commented Jun 21, 2016

i have tried these changes to the vagrant file but I am still having the same problem, I can't access the ip address in a browser

@Roritharr
Copy link

i've tried fowarding port 80 and 8080, also no success on Windows 10 with Vagrant 1.7.4 and Virtualbox 5.0.10

@Roritharr
Copy link

Even from inside it seems there is something wrong with the scotchbox, i've tried to curl localhost from the machine itself, and it got a 301 to the https location and then a connection refused...

`vagrant@scotchbox:~$ curl 127.0.0.1

<title>301 Moved Permanently</title>

Moved Permanently

The document has moved here.


Apache/2.4.16 (Ubuntu) Server at 127.0.0.1 Port 80 vagrant@scotchbox:~$ curl https://127.0.0.1 curl: (7) Failed to connect to 127.0.0.1 port 443: Connection refused`

@Roritharr
Copy link

Roritharr commented Jun 23, 2016

found the issue atleast for me: my project had an .htaccess file which forced the browser via 301 to https, as seen in my last comment. https is not activated on the default scotchbox. if you follow the other issue to activate it, beware that the advice is missing the path change that needs to happen (as part of the provisioning script you'll need to activate https):

oldpath='/var/www/html'
newpath='/var/www/public'
sudo sed -i -e "s|$oldpath|$newpath|g" /etc/apache2/sites-available/default-ssl.conf

@wlsmsw
Copy link

wlsmsw commented Jul 24, 2016

I had the same kind of problem. I'm using Vagrant 1.7.4 with Virtualbox 5.0.16 on a Windows 10 machine. Scotch box booted up with only the ssh port forwarded. So I had to add 8080 port to my Vagrantfile:

config.vm.network "forwarded_port", guest: 80, host: 8080

After a vagrant reload I can acces the welcome page at http://192.168.33.10:8080.
Before the manual changing of the config file I tried Vagrant 1.8.1 without success. I think it can help but don't know what causing this problem.

This solution from @Ettemlevest worked for me but on http://192.168.33.10

@ilazaridis
Copy link
Author

For anyone having the same problem on Archlinux, I managed to access scotch-box by installing net-tools.

Archlinux Vagrant documentation

@rzzo
Copy link

rzzo commented Aug 31, 2016

I am running into this issue as well, I have tried every thing listed here. Running osx el cap. Everything is updated. Any other ideas?

SSH works, just cannot access the server from the browser.

@cssjunkie
Copy link

I'm like rzzo, on osx, can ssh, can't get browser to connect. Total fail.

@kdallas
Copy link

kdallas commented Dec 22, 2016

For Windows users this might help you if you want to access your site on http://localhost/ without having to use an alternative port (like 8000, 8080, 8081 etc).

ssh into your scotch box and sudo su.
Then nano /etc/apache2/ports.conf and change the Listen line to:
Listen 0.0.0.0:8080
Save and quit nano.

Go into /etc/apache2/sites-enabled
and with nano edit the virtual host ports to use 8080 (do this on all the conf files in there).
Exit ssh.

Back in Windows, edit your Vagrantfile and add the following:
config.vm.network "forwarded_port", guest: 8080, host: 80

You can put it directly under the line: config.vm.network "private_network", ip: "192.168.33.10"

Save that, and then reload your box with:
vagrant reload --provision

@JWasdin
Copy link

JWasdin commented Feb 23, 2017

@wlsmsw Thanks, your addition of config.vm.network "forwarded_port", guest: 80, host: 8080 worked for me.

@rzzo / @cssjunkie I am also on OSX, after adding the code above to the vagrant file and re-loading I still couldn't access the webserver from the expected http://192.168.33.10/. However, I was able to see it at http://127.0.0.1:8080/

@kdallas
Copy link

kdallas commented Feb 25, 2017

@JWasdin it should be possible for you to reverse those ports (see my post above) in your vagrant config, so that you don't have to append :8080 to the URL. You will just need to update the apache2 confs to match.

@wickywills
Copy link

Leaving this here just in case anyone had the same silly problem as me - I forgot to create a /public directory under /var/www!

@angel-luis
Copy link

angel-luis commented Jun 28, 2018

If it returns:

Not Found
The requested URL / was not found on this server.

This is because Apache is looking for a public folder in /var/www, so if you sync that folder to a project folder without public, take care of to use /var/www/public in Vagrantfile option.

@uabassguy
Copy link

uabassguy commented Jul 11, 2018

Changed this line in my Vagrantfile:
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

To this (added /public after /var/www):
config.vm.synced_folder ".", "/var/www/public", :mount_options => ["dmode=777", "fmode=666"]

as per comment by @angel-luis , now I no longer get the 404 page. Everything works as expected.

@rootfort
Copy link

rootfort commented Sep 3, 2018

Had same issue, noticed that VirtualBox had two times scotch_default_(...) deleted one and I could connect again to http://192.168.33.10/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests