LoginSignup
1

More than 5 years have passed since last update.

vmで起動したサーバへ接続できない

Posted at

問題

vm上にcentos7をいれてapacheを起動させ、ホストOSから80番ポートへアクセス出来ない

curl 192.168.33.10
curl: (7) Failed to connect to 192.168.33.10 port 80: Connection refused

curlでゲストOSにつなげると80番ポートが開いてないとでてくるので、firewallまわりのポートの設定が怪しいと想い調べる
http://superuser.com/questions/914652/connection-refused-for-port-80-in-virtualbox-but-only-for-centos-vm

こちらによるとcentos7の設定でfirewallがデフォルトでonになっていたのでoffにすればよいとのことだが、全部offにするのは良くないので
80portだけあける設定を行う

sudo lokkit -s http

これで80番ポートが開いて接続可能になる

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1