UbuntuにクライアントからHTTPでアクセスする方法。
1時間くらい調べた結果、あっさり解決。
ブリッジモードで1発でした。
でも、これだけだとアレですので。ブリッジ以外の方法を備忘録。
1時間くらい調べた結果、あっさり解決。
ブリッジモードで1発でした。
でも、これだけだとアレですので。ブリッジ以外の方法を備忘録。
1. VirtualBoxの設定
VirtualBoxの環境設定から、「ホストオンリーネットワーク」を追加。
プラスで自動的に「vboxnet0」が追加される。
IPアドレスをメモ。DHCPの設定をオフに変更。(毎回IPが変わるのを防ぐため
VirtualBoxのUbuntuのネットワーク設定
アダプター2を「ホストオンリーアダプター」で追加する。
2.Ubuntuの設定
Ubuntuで「/etc/network/interfaces」を編集。メモったIPのサブネットでIPアドレスを追加。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto eth1 | |
iface eth1 inet static | |
address 192.168.56.101 | |
netmask 255.255.255.0 | |
network 192.168.56.0 | |
broadcast 192.168.56.255 |
ubuntuを再起動
3.ブラウザアクセス
「http://192.168.56.101/xampp/」にブラウザでアクセス。
成功。
0 件のコメント:
コメントを投稿