OpenVZ Forum


Home » General » Support » SSH/Apache on Virtual machines
SSH/Apache on Virtual machines [message #25416] Mon, 24 December 2007 08:26 Go to next message
Thomasd is currently offline  Thomasd
Messages: 39
Registered: December 2007
Member
I am trying to get a set of VMs to run SSH / Apache

I have VM 2010 at ip 10.0.20.10, it runs SSH & Apache on ports 22 and 80 respectively.

with the following:
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 2010 -j DNAT --to 10.0.20.10:22
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 2011 -j DNAT --to 10.0.20.10:80


I get this:
Chain PREROUTING (policy ACCEPT 72 packets, 9800 bytes)
 pkts bytes target     prot opt in     out     source               destination
    1    52 DNAT       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:2010 to:10.0.20.10:22
   24  1216 DNAT       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:2011 to:10.0.20.10:80



Now, for some reason the connection doesn't go through with Apache, but works perfect with SSH.
Apache is running, but I can't even connect from the main node:

#telnet 10.0.20.10 80
Trying 10.0.20.10...
telnet: connect to address 10.0.20.10: Connection refused
telnet: Unable to connect to remote host: Connection refused


What should I look at?


[Updated on: Mon, 24 December 2007 08:26]

Report message to a moderator

Re: SSH/Apache on Virtual machines [message #25419 is a reply to message #25416] Mon, 24 December 2007 09:46 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

Hi,

plz check if the mysqld listen only on 127.0.0.1 (=localhost!)

Re: SSH/Apache on Virtual machines [message #25447 is a reply to message #25419] Wed, 26 December 2007 07:31 Go to previous messageGo to next message
Thomasd is currently offline  Thomasd
Messages: 39
Registered: December 2007
Member
I am assuming you mean httpd (not mysqld)

I set httpd.conf to listen to the virtual server's IP.

From the main node, I can do
telnet 10.0.20.10 80
and it works. But, from the outside, it doesn't.

However, when I check with
iptables --list -n -v -t nat
I can see the packets coming from the outside, but it still does not work.
Re: SSH/Apache on Virtual machines [message #25448 is a reply to message #25447] Wed, 26 December 2007 08:05 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

Hi

can you plz check if a apache is running in VE and has no problem to start, any ubc failcounters reached (->cat /proc/user_beancounters ) ?

Re: SSH/Apache on Virtual machines [message #25456 is a reply to message #25448] Wed, 26 December 2007 10:34 Go to previous message
Thomasd is currently offline  Thomasd
Messages: 39
Registered: December 2007
Member
weird! now it is running, same setup... after a reboot...

Apache was listening, I could telnet to it from the main node, but not from 'the outside world', until the reset
Previous Topic: Can not suspend VE with nfs mounts - even with bind mounts to HN
Next Topic: *SOLVED* Xvfb could not open default font 'fixed'
Goto Forum:
  


Current Time: Sun Jun 16 09:14:27 GMT 2024

Total time taken to generate the page: 0.03814 seconds