我有一个要求,我需要在Ubuntu上设置PMA,它通过VM安装在Windows服务器中。我安装了它,它在Ubuntu中工作正常。但我想使用phpMyAdmin和来自不同LAN网络系统的其他应用程序。
我已经配置了网站启用的默认文件,但我无法从不同的系统访问它。它在Windows上显示两个IP地址,它显示1.2.3.4
作为虚拟机的IP地址,当我看到Ubuntu的网络设置时,它显示5.6.7.8
作为其IP地址。
现在的问题是,当我使用1.2.3.4
IP地址时,它显示安装在Windows上的IIS服务器,当我在根据5.6.7.8
启用的网站中配置默认文件时,我能够仅在Ubuntu中使用它,而不是从安装了Ubuntu的Windows服务器的其他系统中使用它。
请建议任何解决方案
答案 0 :(得分:0)
首先禁用IIS,因为它使用的是端口80,它与VM内部的apache使用的端口相同。
其次,请查看NAT配置,并确保将端口80从VM导出为主机的端口80.
第三,你可能想要使用Vagrant
,它是一个VirtualBox命令行VM管理器,有很多花里胡哨的东西。如果您想尝试Vagrant
,我会发布Vagrantfile
,以便您可以快速入门。
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# Specify the virtual machine base box file. This box file
# is actually a compressed VMDK file with some aditional
# settings.
# The one specified here is a default Ubuntu Lucid Lynx
# 32bit install but you can find many others online. The url is
# external (HTTP) because Vagrant cand download this box if you
# don't already have it
config.vm.box = "MyVM"
config.vm.box_url = "http://files.vagrantup.com/lucid32.box"
# Tells VirtualBox to not open a GUI, it helps you avoid
# having a window for VirtualBox and another window for the VM.
# For server management windows are not necessary you can
# connect to the VM using SSH (putty for example).
config.vm.boot_mode = :headless
# In this section every pair of parameters is a VBoxManage
# parameter/value configuration.
config.vm.customize [
"modifyvm", :id,
# Specify the virtual machine name you want to see in
# VirtualBox
"--name", "MyVM",
# Memory for the VM
"--memory", "2048",
# This fixes a bug that makes the guest not have DNS
# proper access and implicitly not internet.
"--natdnsproxy1", "on",
"--natdnshostresolver1", "on"
]
# This forwards port 80 to port 4567
config.vm.forward_port 80, 4567
# This mounts a shared folder between your machine and the
# VM. The host directory is the current working directory (the
# one you have put your Vagrantfile in). The directory is
# mounted inside the guest as /vagrant
config.vm.share_folder "v-root", "/vagrant", "."
end