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:
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!
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:
File > Preferences
, then Network
vboxnet0
(if not, create it). Take note of its IPv4 address (192.168.56.1
, in my case)Add the PPA for libmysqlclient15off
, a pre-requisite for APE Server:
username# gpg --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
username# gpg -a --export CD2EFD2A | apt-key add -
sudo sh -c 'echo "deb http://repo.percona.com/apt maverick main" >> /etc/apt/sources.list.d/percona.list'
Install libmysqlclient15off
sudo apt-get update; sudo apt-get install libmysqlclient15off
Get and install the latest version of APE server
Edit /etc/network/interfaces, and add the following to the end:
auto eth0
iface eth0 inet static
address 192.168.56.101
netmask 255.255.255.0
Close the virtual machine and go into its settings. Change the network settings for the first interface to Host-only Adapter
Restart the Virtual Machine, and ensure that the APE daemon is running
username# ps -ef | grep "aped"
If you need to, make changes to /etc/ape/ape.conf
Add the following to your hosts file, or some variation:
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
Access your new APE server via local.site.com:6969