我在安裝Windows流浪,現在我有一個虛擬的Ubuntu,我運行一個python腳本:如何從主機瀏覽器訪問流浪python in vagrant?
[email protected]:/vagrant/FlaskMysql/FlaskApp$ ls
app.py static storedPro.txt templates
[email protected]:/vagrant/FlaskMysql/FlaskApp$ python app.py
* Running on http://127.0.0.1:5002/ (Press CTRL+C to quit)
我Vagrantefile:
config.vm.box = "hashicorp/precise32"
config.vm.provision :shell, path: "bootstrap.sh"
config.vm.network :forwarded_port, guest: 80, host: 4567
config.vm.network :forwarded_port, guest: 5002, host: 5002
我試圖從瀏覽器訪問上面的地址在我的窗口,index.html頁面在幾秒鐘後出現,然後消失。
UPDATE:
[email protected]:/vagrant/FlaskMysql/FlaskApp$ curl http://127.0.0.1:5000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or
there is an error in the application.</p>
感謝。
您的主機需要將5002轉發到訪客機器端口5002? – dm03514
我已經添加了:config.vm.network:forwarded_port,guest:5002,host:5002但仍然得到:此網頁不可用 –