<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.3354" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Tony,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here are my notes minus a lot of wrong turns.
The part that probably needs Martin's help is PAM SOTP. I made postgresql
trusted because the default ident setting did not work.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>
<H3 style="MARGIN: 12pt 0in 3pt"><FONT face=Arial>Postgre</FONT></H3>
<P class=Bullet style="MARGIN: 0in 0in 0pt 0.5in"><SPAN
style="FONT-FAMILY: Symbol">·<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Find and run PostgreSQL</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>psql (default install) is not postgresql-server; it’s just the
client</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Yum install postgresql-server (8.2.5-1.fc7)</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>service postgresql initdb – OK</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>service postgresql start – OK</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>psql – not work as root</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>su – postgres</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>psql – connects</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>\l shows postgres, template0, template1 databases</P>
<H3 style="MARGIN: 12pt 0in 3pt"><FONT face=Arial>PHP & Libs</FONT></H3>
<P class=Bullet style="MARGIN: 0in 0in 0pt 0.5in"><SPAN
style="FONT-FAMILY: Symbol">·<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>yum install php – installed: php.i386 0:5.2.4-1.fc7 (surprised it
is not in default install)</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Make sure php.conf added to /etc/httpd/conf.d</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>/etc/php.ini now found</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>service httpd restart</P>
<P class=Bullet style="MARGIN: 0in 0in 0pt 0.5in"><SPAN
style="FONT-FAMILY: Symbol">·<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Test PHP</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Create php script as follows and execute; it should dump a lot
about your php environment</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><?php</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>phpinfo();</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>?></P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>In my environment this is in /var/www/html/timtest/ =<SPAN
style="mso-spacerun: yes"> </SPAN><A
href="http://192.168.0.160/timtest/info.php">http://192.168.0.160/timtest/info.php</A></P>
<P class=Bullet style="MARGIN: 0in 0in 0pt 0.5in"><SPAN
style="FONT-FAMILY: Symbol">·<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>yum install postgresql-python</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Installed: postgresql-python.i386 0:8.2.5-1.fc7</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Dependency Installed: mx.i386 0:2.0.6-3 </P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Don’t know what this is for</P>
<P class=Bullet style="MARGIN: 0in 0in 0pt 0.5in"><SPAN
style="FONT-FAMILY: Symbol">·<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>yum install php-pgsql</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Installed: php-pgsql.i386 0:5.2.4-1.fc7</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Service httpd restart</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Phpinfo now shows pgsql</P>
<P class=Bullet style="MARGIN: 0in 0in 0pt 0.5in"><SPAN
style="FONT-FAMILY: Symbol">·<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Test php access to postgre</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>create database timdb;</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>\c timdb</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>create table test (text varchar(10), num decimal);</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>insert into test values ('abc', 123);</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>select * from test;</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>run testpg.php:</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><?php</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>// Connecting, selecting database</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>$dbconn = pg_connect("host=localhost port = 5432 dbname=timdb
user=postgres password=xxx")</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><SPAN style="mso-spacerun: yes"> </SPAN>or
die('Could not connect: ' . pg_last_error());</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN> <?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>// Performing SQL query</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>$query = 'SELECT * FROM test';</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>$result = pg_query($query) or die('Query failed: ' .
pg_last_error());</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN> <o:p></o:p></P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>// Printing results in HTML</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>echo "<table>\n";</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>echo
"\t<tr>\n";</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>foreach ($line as
$col_value) {</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>echo
"\t\t<td>$col_value</td>\n";</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>}</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>echo
"\t</tr>\n";</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>}</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>echo "</table>\n";</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN> <o:p></o:p></P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>// Free resultset</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>pg_free_result($result);</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN> <o:p></o:p></P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>// Closing connection</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>pg_close($dbconn);</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>?></P>
<P class=Bullet style="MARGIN: 0in 0in 0pt 0.5in"><SPAN
style="FONT-FAMILY: Symbol">·<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Figure out why php won’t connect to postgresql</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>can not connect and no error (so php not working)</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>log is in /var/lib/pgsql/data/pg_log</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>LOG:<SPAN style="mso-spacerun: yes"> </SPAN>could not
connect to Ident server at address "127.0.0.1", port 113: Connection refused</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>FATAL:<SPAN style="mso-spacerun: yes"> </SPAN>Ident
authentication failed for user "postgres"</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>pg_hba.conf has sameuser which is supposed to mean that the linux
and db user names are the same</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Steve <ksobrien AT pcisys.net>04 Jan 2006 0:50:43</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Even though you add wide-open access permission in the pg_hba.conf
file like this:<SPAN style="mso-spacerun: yes"> </SPAN>host all all
127.0.0.1/32<SPAN style="mso-spacerun: yes"> </SPAN>trust</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>You will still be unable to connect to the database with a PHP (or
whatever language) program and an Apache httpd server unless you add an "apache"
(or whatever user your httpd daemon is running as) user to PostgreSQL thus:</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>su - postgres</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>createuser apache</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Of course, be sure you GRANT SELECT ON table TO APACHE; to give
the apache user permission to actually read data.</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>I assigned pw postgres to user postgres</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Modified /var/lib/pgsql/data/ pg_hba.conf to change host<SPAN
style="mso-spacerun: yes"> </SPAN>all<SPAN
style="mso-spacerun: yes">
</SPAN>all<SPAN
style="mso-spacerun: yes">
</SPAN>127.0.0.1/32<SPAN
style="mso-spacerun: yes">
</SPAN>ident sameuser to </P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>host<SPAN style="mso-spacerun: yes">
</SPAN>all<SPAN
style="mso-spacerun: yes">
</SPAN>all<SPAN
style="mso-spacerun: yes">
</SPAN>127.0.0.1/32<SPAN
style="mso-spacerun: yes">
</SPAN>trust</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>run testpg.php – works</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>BOTTOM LINE – I could only get this to work if I used trusted
mode.<SPAN style="mso-spacerun: yes"> </SPAN>I know Martin specified PAM
SOTP, but I don’t know how this works</P>
<H3 style="MARGIN: 12pt 0in 3pt"><FONT face=Arial>Moodle</FONT></H3>
<P class=Bullet style="MARGIN: 0in 0in 0pt 0.5in"><SPAN
style="FONT-FAMILY: Symbol">·<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Install Moodle</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><A
href="http://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu#Install_Postgresql_.28skip_MySQL.29">http://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu#Install_Postgresql_.28skip_MySQL.29</A></P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><A
href="http://docs.moodle.org/en/Installing_Moodle#Creating_an_empty_database">http://docs.moodle.org/en/Installing_Moodle#Creating_an_empty_database</A></P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN># su - postgres</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><SPAN style="mso-spacerun: yes"> </SPAN>> psql -c
"create user moodleuser createdb;" template1 – worked</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><SPAN style="mso-spacerun: yes"> </SPAN>> psql -c
"create database moodle with encoding 'unicode';" -U moodleuser template1 –
failed on authentication (Ident authentication failed for user "moodleuser")</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>createdb -E utf8 -O moodleuser moodle – worked</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><SPAN style="mso-spacerun: yes"> </SPAN>> psql -c
"alter user moodleuser nocreatedb;" template1 (alter user moodleuser
nocreatedb;) – worked</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><SPAN style="mso-spacerun: yes"> </SPAN>> psql -c
"alter user moodleuser with encrypted password 'moodle';" template1 (alter user
moodleuser with encrypted password 'moodle';) – worked</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><SPAN style="mso-spacerun: yes"> </SPAN>> su -
root</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><SPAN style="mso-spacerun: yes"> </SPAN>#
/etc/init.d/postgresql reload</P>
<P class=Bullet style="MARGIN: 0in 0in 0pt 0.5in"><SPAN
style="FONT-FAMILY: Symbol">·<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Finish moodle install</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Modified /etc/php.ini according to <A
href="http://docs.moodle.org/en/Installing_Moodle">http://docs.moodle.org/en/Installing_Moodle</A>
(docs seem to have 0 and 1 where file has off and on; I mostly followed the
docs, which worked.)</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Created /var/moodledata (NOT NECESSARY)</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>chown -R nobody:apache moodledata</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>chmod -R 0770 moodledata</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>looks like the package already created /var/www/moodle/data with
appropriate permissions so above was not necessary</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>/var/www/moodle/web/config.php has mysql as db – I changed to
postgres</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><A href="http://192.168.0.160/moodle/web/install.php"><SPAN
style="mso-spacerun: yes"> </SPAN>http://192.168.0.160/moodle/</A> - Error:
Database connection failed</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>modified host, dbname, user, and password in config.php</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>now does redirect to <A
href="http://localhost/moodle/admin/index.php">http://localhost/moodle/admin/index.php</A>
)because wwwroot<SPAN style="mso-spacerun: yes"> </SPAN>=
'http://localhost/moodle'June 20, 2008</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>now <A href="http://192.168.0.160/moodle/web/install.php"><SPAN
style="mso-spacerun: yes"> </SPAN>http://192.168.0.160/moodle/</A>
redirects to <A
href="http://192.168.0.160/moodle/admin/index.php">http://192.168.0.160/moodle/admin/index.php</A>
- gives error DB Type: postgres not supported by XMLDDB</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>click continue – repeats error</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>N.B> changed dbtype to 'postgres7' (!?) – now gets past error
(didn’t read fine print)</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Database was successfully upgraded</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>(should have taken unattended installation)</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>workshop tables have been set up correctly</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>truefalse tables have been set up correctly</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Database was successfully upgraded (x2)</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Various tables</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Create admin (admin/moodle)</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Seems to be installed and running.</P>
<P class=Bullet style="MARGIN: 0in 0in 0pt 0.5in"><SPAN
style="FONT-FAMILY: Symbol">·<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>Set up cron</P>
<P class=Bullet2 style="MARGIN: 0in 0in 0pt 0.75in"><SPAN
style="FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'">o<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN>This still needs to be done</P>
<P class=Bullet2
style="MARGIN: 0in 0in 0pt 0.75in; mso-list: none"> <o:p></o:p></P></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Tim</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=tpearson@us.ibm.com href="mailto:tpearson@us.ibm.com">Tony
Pearson</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=timmoody@sympatico.ca
href="mailto:timmoody@sympatico.ca">Tim Moody</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, June 24, 2008 1:08
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> PostgreSQL + Moodle</DIV>
<DIV><BR></DIV><BR><TT><FONT size=2>Tim,</FONT></TT> <BR><TT><FONT
size=2>Please share me your procedures. If you have written down any
notes, or have any "gotcha's" I should try to avoid, please provide me.
I will be doing this week to send the computer off this
Monday.</FONT></TT> <BR><BR><BR><TT><FONT size=2>From: "Tim Moody" <<A
href="mailto:timmoody@sympatico.ca">timmoody@sympatico.ca</A>><BR>Subject:
Re: [Server-devel] XS SW<BR>To: <<A
href="mailto:server-devel@lists.laptop.org">server-devel@lists.laptop.org</A>><BR>Message-ID:
<000701c8d58e$4f981b60$0b00a8c0@saturn><BR>Content-Type: text/plain;
format=flowed; charset="iso-8859-1";<BR>
reply-type=original<BR><BR>Got throught the moodle +
postgre install. I'll now play with setting up <BR>some courses and
users.<BR><BR>I cheated on the authentication as I don't know how PAM SOTP
works; I just <BR>set the authentication to trusted.<BR></FONT></TT><FONT
face=sans-serif size=2><BR></FONT>
<TABLE>
<TBODY>
<TR>
<TD bgColor=#006699>
<TD bgColor=#006699>
<TR>
<TD><IMG src="cid:000d01c8d63d$b81f3060$0b00a8c0@saturn">
<TD><FONT face="Microsoft Sans Serif" color=#0060a0 size=1><B>Tony
Pearson</B></FONT><FONT face="Microsoft Sans Serif" size=1><BR>Senior
Storage Consultant, IBM System Storage™<BR>Telephone: +1 520-799-4309 |
tie 321-4309 | Cell: +1 520 990-8669<BR>email:
tpearson@us.ibm.com | GSA:
http://tucgsa.ibm.com/~tpearson<BR>Blog: </FONT><A
href="http://www.ibm.com/developerworks/blogs/page/InsideSystemStorage"><FONT
face="Microsoft Sans Serif" color=blue
size=1><U>http://www.ibm.com/developerworks/blogs/page/InsideSystemStorage</U></FONT></A><FONT
face="Microsoft Sans Serif" size=1><BR>AKA: 990tony Paravane, eightbar
specialist </FONT>
<TR>
<TD bgColor=#006699>
<TD bgColor=#006699></TR></TBODY></TABLE><BR></BLOCKQUOTE></BODY></HTML>