Forum OpenACS Q&A: aolserver ip and hosts file settings for home dsl server behind a router

I've got openACS all installed on Suse 8.2 and it's working great. Can't wait to get into customizing, etc. I want to serve a site over my dsl line but am not sure about a couple of settings. I set up zoneedit (www.zoneedit.com for up to 5 dyndns ip address forwarding for free) to forward all requests to my address (physworx.com) to my ip (currently 24.87.21.30) on port 80. I've set up my router to forward all outside requests to port 80 to my linux box (192.168.2.7 internal ip) with openACS on port 8000. So far so good.

My confusion comes from:
1. configuring /etc/hosts - I have this line:
192.168.7  physworx.com  www.physworx.com
2. configurning aolserver's config.tcl - I have these lines
set address 192.168.2.7
set server physworx.com

aolserver is set to listen on port 8000.

On the server, I can see openACS with physworx.com:8000 or www.physworx.com:8000 or 192.168.2.7:8000

On other computers on the same network, I can see openACS with 192.168.2.7:8000 but not www.physworx.com or physworx.com. I can however ping physworx.com and www.physworx.com and they show my wan ip (24.87.21.30).

Have I set up my hosts file and config file correctly or did I make an obvious mistake elsewhere? Any help would be appreciated.

Also, would it be helpful for me to do up a how to for setting up openACS as a home dsl server to add to the docs?

That's how I would expect things to be working based on your configuration. The hosts file on your linux box is only going to affect dns lookups made from on the linux box, not from other machines on the network. It's quite common for little routers doing NAT not to be able to forward packets from inside the network to NAT'ed external ip's and back again which would be what is happening if you try and access http://physworx.com/ from another machine on your internal LAN without editing it's host file.

If you want to be able to access your server as http://physworx.com:8000/ from other machines on your home LAN you will need to either edit the hosts file (or equivalent) on those machines ro set up a dns server internally that is authoritative for the physworx.com domain internally and forwards all other queries up to your ISP. It would point to 192.168.2.7 as the address for physworx.com etc. You'd need to set your other home machines to point to it as their DNS server (or tell dhcp to give out its address as the dns server).

I'd suggest if you did this you may want to get aolserver running on port 80 internally also so you access it at http://physworx.com/ inside or outside.

In addition, make sure you have the following in your nssock section:

# If you want your web domain name to be www.example.com
# set up the following in you nsd.tcl file:
# ns_section "ns/server/${servername}/module/nssock"
# ns_param        port     8000 ;# private port
# ns_param        hostname www.example.com ;# external hostname
# ns_param        address  192.168.1.2 ;# Actual private ip
# ns_param        location http://www.example.com 
# The location parameter is essential for automatic redirects and for proper
# use of [ns_conn location], otherwise redirect would go to 
# http://www.example.com:8000
# 

If you need more help, you will probably get more by providing a telnet session to your site. What a browser does, or doesn't do isn't much help. Something like:


$ telnet www.physworx.com 80

(response from telnet client...then enter:)

GET / HTTP/1.0
Host: www.physworx.com

That is two returns after the Host: header.

By default AOLServer will only listen on the interface address specified in the config file (unlike Apache).

Try changing

set address 192.168.2.7
to
set address 0.0.0.0
which will make AOLServer listen on all available addresses.

Ok, so it seems that everything is working fine on my server within the network, thanks Matthew. I also touched up the nssock section of my config and added the location parameter. Thanks Tom. As for telnet - I didn't install it on my system as I understood it to be a security hole. Is that incorrect? Can I do the same via ssh? James, I have it set up so that Firewall2 in suse only lets in port 8000 for aolserver and 25 for smtp (qmail once I get it all configured) would changing hosts to 0.0.0.0 still make any difference? Anyhow, I'm fine with the internal setup now. Perhaps you guys could take a peek at this newer thread and see if you can shed some light: https://openacs.org/forums/message-view?message_id=106341 - actually I see that Tom and Matthew already took a peek and had no problems. Going to be one of those interesting ones...

You don't need to install a telnet server on your machine, I'm refering to using a telnet client from your workstation to send basic HTTP commands to the server without all the overhead and confusion associated with using a browser. ssh will not work, because it assumes an ssh server on the other end. In this case the other end is your AOLserver. A telnet client just opens a connection to the server and port you requested on the telnet command line:

$ telnet localhost 8000

This should work from the machine running the server.

Thanks Tom. Didn't know that. Anyhow, I tried connecting with telnet from work but couldn't establish a connection on port 80 or telnet port. Probably due to the proxy server here. Can you do me a favour and see if you can connect from where you are?