Forum OpenACS Q&A: Two questions: Virtual hosting and port 8000

I have a couple of questions:

1. Can we do name-based virtual hosting with OACS?

2. Can OACS work fine in port 80 instead of 8000?

thanks!

Collapse
Posted by Luis Garcia on
I just found the answer to my virtual hosting question in the docs. But I still would like to know if it would work just fine in port 80.
Thanks!
Collapse
Posted by Don Baccus on
Sure it will work on port 80! Otherwise we wouldn't be able to build http://www.openacs.org, which runs on port 80! :)

You have to be the superuser under Unix/Linux to bind to port 80. That's why we default to port 8000, we assume that first you develop a site and later make it a production site. When developing ... you don't really want to force the sysadmin to give every developer superuser privileges on the system just so they can start/restart AOLserver.

To run on port 80 you start AOLserver as the superuser. You pass AOLserver a non-superuser user (for instance "aolserver") with the "-u" switch.

AOLserver then starts as root, binds to port 80, and after binding set itself as the non-superuser user you've passed in with "-u". For security reasons, AOLserver won't run as superuser, you must provide a non-superuser user for it to switch to after binding to port 80 running as superuser.

Make sense?

Collapse
Posted by Luis Garcia on
OK, this is what I am starting the server with as root: /usr/local/aolserver/bin/nsd-postgres -t /var/lib/aolserver/luisegarcia/etc/config.tcl -u my_user I changed the config file to port 80.

The server seems to start, but it does not accept connections. This is what I get in the error log:

[17/Feb/2005:23:47:52][8347.32771][-sched-] Notice: sched: starting

[17/Feb/2005:23:47:52][8347.131081][-sched:idle0-] Notice: starting

[17/Feb/2005:23:47:52][8347.16384][-main-] Error: nssock: failed to listen on 192.168.1.2:80: Permission denied

[17/Feb/2005:23:47:52][8347.147466][-driver-] Notice: starting

[17/Feb/2005:23:47:52][8347.147466][-driver-] Notice: driver: accepting connections

It says "driver accepting connections". But when I do 192.168.1.2 or 192.168.1.2:80 I get the same error:

"The connection was refused"

Any ideas???

Collapse
Posted by Torben Brosten on

AOLserver needs to be prebound to port 80. Try this from root:

/usr/local/aolserver/bin/nsd-postgres -t /var/lib/aolserver/luisegarcia/etc/config.tcl -u my_user -g my_group -b w.x.y.z:80

where w.x.y.z is the ip address.

cheers,
Torben

Collapse
Posted by Luis Garcia on
Torben,
Thanks! That was it!
Luis