Forum OpenACS Q&A: How to install postgresql on another machine?
machines are using ssh. How should I change the nsd.tcl?
ns_param Driver postgres
ns_param Connections 15
ns_param DataSource localhost::security
ns_param User nsadmin
ns_param Password ""
Should just replace localhost to the other machine name or ip? Will
it automatically ssh to the database's machine?
thanks a lot!
Add this line to your /etc/inittab
tw01:345:respawn:/usr/bin/ssh -2 -e none -p 22 -c blowfish -L 5432:127.0.0.1:5432 nonrootaccount@db_machine
If you haven't already, generate your ssh2 key using ssh-keygen -d
Put the ssh2 (/root/.ssh/id_dsa.pub) public key for your root account of the web server in /home/nonrootaccount/.ssh/authorized_keys2 on the database server
"init q" will cause your machine to reread /etc/inittab and, if everything works, will start forwarding port 5432 of 127.0.0.1 to your database server over the encrypted ssh link
Change the DataSource line to use an IP instead of "localhost". The driver connects on Unix sockets for the name "localhost" and uses tcpip for anything else.
ns_param DataSource 127.0.0.1::security
On the OpenACS side, you will need to modify the bootstrap installer to allow for remote connections. By default, it does not pass the host parameter for the db and will not be able to connect to remote machines. I don't know if that functionality has been added to the CVS tree. I can look up the edit I made to if you need.