在虚拟机中运行 APE 服务器
我一直在尝试在虚拟机中设置 Ajax Push Engine (APE) 服务器,但遇到了一些障碍。问题是无法在虚拟机外部访问APE服务器。
设置:
- 来宾操作系统:安装了 ape 软件包的 Ubuntu 10.10(我相信)
- IP 地址:192.168.56.1,使用仅主机网络适配器
- APE 服务器在端口 6969 上运行
如果我在虚拟机中尝试 wget 127.0.0.1:6969
,我会收到响应。
如果我从主机操作系统尝试 wget 192.168.56.1:6969
,我会收到一条 Connection Refused
消息。
如果我 ping 192.168.56.1
,我也会收到响应。
任何帮助将不胜感激!
I have been trying to set-up an Ajax Push Engine (APE) Server in a virtual machine, and have run into a bit of a snag. The problem is that the APE server cannot be accessed outside of the virtual machine.
Setup:
- Guest OS: Ubuntu 10.10 (I believe) with the ape package installed
- IP Address: 192.168.56.1 using a host-only network adapter
- APE Server running on port 6969
If I try wget 127.0.0.1:6969
in the virtual machine, I get a response.
If I try wget 192.168.56.1:6969
from the host OS, I get a Connection Refused
message.
If I ping 192.168.56.1
, I also get a response.
Any help would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最终从头开始重做了所有事情,并且成功了,所以我一定以某种方式做对了。为了他人的利益...
要让 APE Server 在虚拟机中运行(特别是使用 VirtualBox),您需要执行以下操作:
设置环境
File >首选项
,然后网络
vboxnet0
(如果不存在,则创建它)。记下其 IPv4 地址(在我的例子中为192.168.56.1
)获取库
为
libmysqlclient15off
添加 PPA ,APE 服务器的先决条件:安装
libmysqlclient15off
获取并安装最新版本的 APE 服务器
编辑 /etc/network /interfaces,并将以下内容添加到末尾:
<前><代码>自动 eth0
iface eth0 inet 静态
地址 192.168.56.101
网络掩码 255.255.255.0
关闭虚拟机并进入其设置。将第一个接口的网络设置更改为
仅主机适配器
设置 APE
重新启动虚拟机,并确保 APE 守护程序正在运行
如果需要,请更改
/etc/ape/ape.conf
最终步骤
将以下内容或某些变体添加到您的主机文件中:
<前><代码>192.168.56.101 local.site.com
192.168.56.101 0.local.site.com
192.168.56.101 1.local.site.com
192.168.56.101 2.local.site.com
192.168.56.101 3.local.site.com
192.168.56.101 4.local.site.com
192.168.56.101 5.local.site.com
192.168.56.101 6.local.site.com
192.168.56.101 7.local.site.com
192.168.56.101 8.local.site.com
192.168.56.101 9.local.site.com
通过
local.site.com:6969
访问您的新 APE 服务器I ended up redoing everything from scratch, and it worked, so I must have got it right somehow. For the benefit of others...
To get APE Server running in a virtual machine (in particular, using VirtualBox), you need to do the following:
Setting up the environment
File > Preferences
, thenNetwork
vboxnet0
(if not, create it). Take note of its IPv4 address (192.168.56.1
, in my case)Getting the Libraries
Add the PPA for
libmysqlclient15off
, a pre-requisite for APE Server:Install
libmysqlclient15off
Get and install the latest version of APE server
Edit /etc/network/interfaces, and add the following to the end:
Close the virtual machine and go into its settings. Change the network settings for the first interface to
Host-only Adapter
Setting Up APE
Restart the Virtual Machine, and ensure that the APE daemon is running
If you need to, make changes to
/etc/ape/ape.conf
Final Steps
Add the following to your hosts file, or some variation:
Access your new APE server via
local.site.com:6969
检查 APE 配置文件。您是否绑定了正确的IP?默认为 127.0.0.1
Check APE config file. Are you binding to the right IP ? By default it's 127.0.0.1