Hi, Precisely today i have send a patch to Massimo for the book
https://github.com/mdipierro/web2py-book/blob/master/sources/29-web2py-english/13.markmin You can review what you need to do.... Saludos, -------------------------------- Alfonso de la Guarda Twitter: @alfonsodg Redes sociales: alfonsodg Telef. 991935157 1024D/B23B24A4 5469 ED92 75A3 BBDB FD6B 58A5 54A1 851D B23B 24A4 On Fri, Mar 8, 2013 at 6:19 PM, BlueShadow <kevin.bet...@gmail.com> wrote: > I like to change my db to postgresql. > So I installed it by the following guide: > # setting up secure ssh > adduser dbuser > export EDITOR=nano > visudo > # add this to the end of the file > # dbuser ALL=(ALL) ALL > > ssh-keygen -t rsa > # fill everything out correctly > scp ~/.ssh/id_rsa.pub dbu...@xxx.yyy.zzz.xyz:/home/dbuser/ > > mkdir /home/dbuser/.ssh > mv /home/dbuser/id_rsa.pub /home/dbuser/.ssh/authorized_keys > chown -R dbuser:dbuser /home/dbuser/.ssh > chmod 700 /home/dbuser/.ssh/ > chmod 600 /home/dbuser/.ssh/authorized_keys > vi /etc/ssh/sshd_config > > #Be sure to check the following options. > > #Port 1234 <--- change to a port of your choosing > #Protocol 2 > #PermitRootLogin yes > #PasswordAuthentication no > #X11Forwarding no > #UsePAM no > #UseDNS no > #AllowUsers demo > > iptables -L > # Yuck, we're allowing everything > wget wget http://articles.slicehost.com/assets/2007/9/4/iptables.txt > vi iptables.txt > # **IMPORTANT!!** > # Make sure to change the port for ssh!!!! 1234 > # **IMPORTANT!!** > mv iptables.txt /etc/iptables.up.rules > iptables-restore < /etc/iptables.up.rules > iptables -L > # much better, now make it permanent > vi /etc/network/interfaces > > #... > #auto lo > #iface lo inet loopback > #pre-up iptables-restore < /etc/iptables.up.rules > > ## The primary network interface > #... > > service ssh reload > > > sudo apt-get update > sudo apt-get upgrade > sudo locale-gen en_US.UTF-8 > sudo /usr/sbin/update-locale LANG=en_US.UTF-8 > > sudo apt-get install postgresql > sudo apt-get install python-psycopg2 > sudo vi /etc/postgresql/9.1/main/postgresql.conf > #Find and uncomment/change these lines > #... > #listenaddress='localhost' #uncomment > #... > #track_counts = on #73% > #... > #autovacuum = on # Enable autovacuum subprocess? 'on' > #... > > sudo /etc/init.d/postgresql restart > > sudo su - postgres > #postgres@$ createuser -PE dbuser > #answer no to superuser, create db, and create role. > #postgres@$ createdb -O dbuser -E UTF8 testdb > #postgres@$ exit > sudo vi /etc/postgresql/9.1/main/pg_hba.conf > #Find this part > > # TYPE DATABASE USER CIDR-ADDRESS METHOD > > # "local" is for Unix domain socket connections only > #local all all ident sameuser > > #Change the line to read > > #local all all md5 > sudo /etc/init.d/postgresql restart > #test it > psql -U dbuser -d testdb > #ctrl+d to exit > the psql -U dbuser -d testdb didn't work: > psql: FATAL: Peer authentication failed for user "dbuser" > > I had to try but obviously when I made a new welcome app(TestPostgres) where > I changed the DAL line to: > db = DAL('postgres://dbuser:testpw@localhost/testdb') > I get this error page: > > invalid function (default/TestPostgres) > > no ticket or anything > > I also tried changing the md5 in pg_hba.conf > > # "local" is for Unix domain socket connections only > #local all all md5 > > to password > > doesn't change a thing > > thanks > > > -- > > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.