ubuntu 12.04 - Vagrant Apache2 http/https port forwarding -
i using vagrant manage ubuntu instance testing web application. having trouble setting login page on https. application using apache2+php5+mysql. have setup port forwarding sth access application host machine .
config.vm.network :forwarded_port, guest: 80, host: 8080
when try access guest using http://localhost:8080
, redirect https://localhost:8080
seams reasonable ,but 8080 port forwarded http:80 guest port not https:43.
url https://localhost:8080
half true half lie . don't know how forward https port guest https port wonder happen of https://localhost:8080
redirect since not valid url should ( think ) sth https://localhost:4343
, if https:4343 forwarded guest:43. application not aware of ports , changes http
https
(forgive me gibberish )
how setup vagrant network setting access guest apache http:80 , https:43 ports. can assigned static ip guest instance , use pleasantly .
regards
using:
vagrant version 1.1.5
ubuntu precise64.box
for use case, default networking mode - nat not choice because have multiple ports (at least 80 , 443) forwarded.
i recommend using bridged mode guest appears physical host in lan , able access http/https using lan ip. don't need port forwarding (actually cannot port forwarding in virtualbox bridged mode).
to use bridge mode (public network), in vagrantfile
add config.vm.network :public_network
vagrant.configure
block , vagrant reload
, should work flawlessly. use ifconfig -a
check, 2nd interface added bridged.
reference: http://docs.vagrantup.com/v2/networking/public_network.html
Comments
Post a Comment