Forum OpenACS Q&A: Novice question

Collapse
Posted by G. Armour Van Horn on
Following the very clear instructions Vinod put together, I went sailing through installing AOLServer. (Dual Pentium Pro, brand new RedHat 7.2 install, all files per docs except chose to go with PosgreSQL 7.2 instead of 7.1.3 since folks seemed to be having success with it.)

When I got to "Prepare PostgreSQL for OpenACS" on the "Install OpenACS 4.5" page, the "createdb " failed with "command not found." (This had worked fine after installing PG7.2)

I went back to the install logs from AOLServer, there were no errors in any of the logs except pgdriver.log:

[root@vox log]# cat pgdriver.log
gcc -DFOR_ACS_USE -DBIND_EMULATION -I/usr/local/aolserver/include -fpic -shared -I/usr/include/pgsql -I/usr/local/aolserver/include -I-/usr/include   -c -o postgres.o postgres.c
postgres.c:45:22: libpq-fe.h: No such file or directory
make: *** [postgres.o] Error 1
This missing file does actually exist:
[root@vox log]# locate libpq-fe.h
/raid1/usr.local/local/src/postgresql-7.2/src/interfaces/libpq/libpq-fe.h
Two possibilities occur to me, neither of them particularly happy. One is that I need to rip out PG 7.2 and replace it with 7.1.3. Worse is that I need to start over and rebuild by disk partitions. Note that there are two directories that are fairly important that are symlinked out of my RAID5 array:
lrwxrwxrwx    1 root     root           16 Mar  4 03:51 usr -> /raid1/usr.local
lrwxrwxrwx    1 root     root           10 Mar  4 21:25 web -> /raid1/web
If those structures can't be used my only recovery is to repartition the array, something I really don't want to do. On the other hand, if I have to do it, now's the time, but how should I divide the 18GB array between /usr and /web?

I'm hoping I did something really stupid and embarrassing, i.e., something with an easy answer!

Van

Collapse
Posted by Jade Rubick on
Van,

Can you try this

cd ~postgres
cd ..
ls -l
What are the permissions set for the Postgres user?

Try this as root:

chmod g+r postgres
Does that make make the createdb command work? If so, Vinod, this is the error I had too when I ran through the install docs. If not, then nevermind, and sorry to waste you time. Vinod, if this does end up working, let's make sure we update the install docs with this addition.
Collapse
Posted by G. Armour Van Horn on
No change. Here's the result of your suggested commands:
[root@vox local]# cd ~postgres
[root@vox pgsql]# cd ..
[root@vox local]# ls -l
total 48
drwxrwxr-x    8 nsadmin  web          4096 Mar  4 20:54 aolserver
drwxr-xr-x    2 root     root         4096 Feb  6  1996 bin
drwxr-xr-x    2 root     root         4096 Feb  6  1996 doc
drwxr-xr-x    2 root     root         4096 Feb  6  1996 etc
drwxr-xr-x    2 root     root         4096 Feb  6  1996 games
drwxr-xr-x    2 root     root         4096 Jun 22  2001 include
drwxr-xr-x    2 root     root         4096 Feb  6  1996 lib
drwxr-xr-x    2 root     root         4096 Jun 22  2001 libexec
drwxr-----    9 postgres web          4096 Mar  4 13:22 pgsql
drwxr-xr-x    2 root     root         4096 Feb  6  1996 sbin
drwxr-xr-x    4 root     root         4096 Jun 22  2001 share
drwxr-xr-x    4 root     root         4096 Mar  4 20:07 src
Note that this is in the /usr/local directory, also available as /raid1/usr.local/local.

Van

Collapse
Posted by Tapiwa Sibanda on
its a permissions issue.

I had it last night, and made the thing work by

chmod -R 775 /usr/local/pgsql

This command typed as root.

While we are at it, another stump might be the fact that there was no mention (or at least I did not see anything at 23h15 last night) in the docs on installing the pg drivers

Collapse
Posted by G. Armour Van Horn on
Well, it's way too late for me to make any sense of this (0207 Pacific time) but the "chmod -R 775 /usr/local/pgsql" doesn't help. However, as user "postgres" the command "/usr/local/pgsql/bin/createdb -service-name-" works just fine. This looks more like a path problem than a permissions problem.
Collapse
Posted by Tapiwa Sibanda on
Hi Van

Maybe I am misunderstanding your problem, but I still think that it is a permissions issue... I think the problem I had was similar.

The directory /usr/local/pgsql belongs to the user postgres. The user you are trying to run createdb as is nsadmin

The relationship between the two is that they both belong (or should belong) to the group web

My suggestion is to log in as user nsadmin (assuming you have followed the naming conventions in the docs). Check that this user belongs to the groups nsadmin and web. You might want to log in as user postgres and ensure that it belongs to the group web.

If you can see /usr/local/pgsql/bin/*.* as user postgres and you have set the permissions correctly you should be able to run the command createdb as user nsadmin.

if on the other hand you need to run /usr/local/pgsql/bin/creatdb instead of just createdb as user postgres, then you do need to check that the paths you set (as explained in the docs) are correct.

Hope this helps

Collapse
Posted by Gilbert Wong on
Check the makefile for the postgres 2.0 driver.  Look at the PGLIB enviroment variable.  Then set it to your pgsql/lib directory.  /usr/local/pgsql/lib should be the default and it should work.  Then do a make, make install.  If that doesn't work, post the error messages.

You will also need to run "createuser nsadmin" as the postgres user.  Answer yes to both questions.  Then login as the nsadmin user and run "created openacs-4".  Start aolserver and you should be good to go.

Collapse
Posted by Jade Rubick on
My advice was flawed, I think. I should have said
chmod +rx postgres
Vinod, this is exactly the same problem I ran into when I went through the OpenACS 4 documentation. I'm thinking other people might be having the same problem, so perhaps we should add this in?
Collapse
Posted by Jade Rubick on
Grrr..
chmod g+rx postgres
Sorry for the waste of bandwidth.
Collapse
Posted by G. Armour Van Horn on
Tapiwa,

I thought I had done it before without result, just now I ran

chmod -R 775 /usr/local/pgsql 

again and user nsadmin has the same access to createdb as user postgres does.

Van

Collapse
Posted by G. Armour Van Horn on
Warning, this is long and rife with error messages. The first couple may be minor items that need to be edited in the default site-service.tcl file.

<P>After minimal editing of the /usr/local/aolserver/wimls.tcl file (wimls being my first project) I invoked:

<pre>/usr/local/aolserver/bin/nsd-postgres -t /usr/local/aolserver/wimls.tcl</pre>

and got:

<pre>[05/Mar/2002:10:50:58][18381.1024][-main-] Fatal: config: script error: wrong # args: should be "ns_param key value
    while executing
"ns_param  fancy".adp""</pre>

On line 132 I added a space between fancy and ".adp" - then restarted:

<pre>[nsadmin@vox aolserver]$ [05/Mar/2002:11:08:17][18396.1024][-main-] Notice: nsd.tcl: starting to read config file...
[05/Mar/2002:11:08:17][18396.1024][-main-] Fatal: config: script error: wrong # args: should be "ns_param key value
    while executing
"ns_param  classpath          "</pre>

On line 274, I unwrapped the line.

<pre>[nsadmin@vox aolserver]$ [05/Mar/2002:11:13:20][18411.1024][-main-] Notice: nsd.tcl: starting to read config file...
[05/Mar/2002:11:13:20][18411.1024][-main-] Warning: nsd.tcl: nsssl not loaded because key/cert files do not exist.
[05/Mar/2002:11:13:20][18411.1024][-main-] Notice: nsd.tcl: finished reading config file.</pre>

I think that's exactly what I was supposed to see, right? I then went to a browser and got this:

<H2>Request Error</H2>
Server startup failed: Error during bootstrapping<blockquote><pre>command &#34;ns_db&#34; is not enabled
    while executing
&#34;ns_db pools&#34;
    (procedure &#34;db_bootstrap_set_db_type&#34; line 72)
    invoked from within
&#34;db_bootstrap_set_db_type database_problem&#34;</pre></blockquote>
<P ALIGN=RIGHT><SMALL><I>AOLserver/3.3.1+ad13 on http://vox.domainvanhorn.com:8000</I></SMALL></P>

I recompiled aolserver, but I still get the indication in the /usr/local/src/aolserver/log/pgdriver.log mentioned several messages back:

<pre>gcc -DFOR_ACS_USE -DBIND_EMULATION -I/usr/local/aolserver/include -fpic -shared -I/usr/include/pgsql -I/usr/local/aolserver/include -I-/usr/include  -c -o postgres.o postgres.c
postgres.c:45:22: libpq-fe.h: No such file or directory
make: *** [postgres.o] Error 1</pre>

and /usr/local/aolserver/log/wimls-error.log starts out like this:

<pre>[05/Mar/2002:11:21:10][18441.1024][-main-] Notice: nsmain: AOLserver/3.3.1+ad13 starting
[05/Mar/2002:11:21:10][18441.1024][-main-] Notice: nsmain: security info: uid=502, euid=502, gid=502, egid=502
[05/Mar/2002:11:21:10][18441.1024][-main-] Notice: nsmain: max files: FD_SETSIZE = 1024, rl_cur = 1024, rl_max = 1024
[05/Mar/2002:11:21:10][18441.1024][-main-] Notice: return: redirecting '404' to 'global/file-not-found.html'
[05/Mar/2002:11:21:10][18441.1024][-main-] Notice: return: redirecting '403' to 'global/forbidden.html'
[05/Mar/2002:11:21:10][18441.1024][-main-] Notice: modload: loading '/usr/local/aolserver/bin/postgres.so'
[05/Mar/2002:11:21:10][18441.1024][-main-] Warning: modload: failed to load '/usr/local/aolserver/bin/postgres.so': '/usr/local/
aolserver/bin/postgres.so: cannot open shared object file: No such file or directory'
[05/Mar/2002:11:21:10][18441.1024][-main-] Error: dbdrv: failed to load driver 'postgres'
[05/Mar/2002:11:21:10][18441.1024][-main-] Error: dbinit: no such default pool 'pool1'
[05/Mar/2002:11:21:10][18441.1024][-main-] Debug: dbinit: no configured pools</pre>

PostgreSQL is happily running, there is a postmaster, a stats buffer process, and a stats collection process process all running. So it looks like it's come back to the libpq-fe.h file not being seen when I compile AOLServer, which apparently keeps the PostgreSQL driver from compiling into AOLServer.

<P>Van

Collapse
Posted by Tapiwa Sibanda on
Hi Van

I think I had some of the error messages you are getting, so here goes....

First, I am assuming that you followed the installation documents.... My installation was with pg71 and RH7.2, so you might have slightly different paths.

The only lines I needed to change in the service.tcl file were lines 17 and 19.
set server "service"
set servername "My Development Server"

Everything else I left standard.

The second thing that I did was install the pg driver. You can download the drivers off openacs website.

All I did was untar these to the /usr/local/src directory. I then edited the makefile. I changed the following lines

line 35: INSTALL=/usr/local/aolserver

line 38: PGLIB=/usr/local/pgsql/lib

line 41: PGINC=/usr/local/pgsql/include

line 46: NSHOME=/usr/local/aolserver

line 49: I commented out this line #COPTS=-Wall -fpic -shared -I/usr/local/ ..... ....

line 62: I uncommented this line COPTS=-fpic -shared -i$... ....

These were the only changes I made to the makefile. I then ran make and make install, and the pg drive installed .

The third thing that I did was to rename /usr/local/aolserver/servers/server1 to /user/local/aolserver/servers/servicename

After doing this, restart aolserver as normal and continue with the installation.

Collapse
Posted by G. Armour Van Horn on
At last! I found one more edit in the pgdriver makefile:

NSHOME=/usr/local/aolserver

It had been set to /usr/local/aolserver/aolserver. That was line 59 in the version I was working from. The line numbers in my copy (part of the complete tar identified as "Mat's AOLServer distribution" in the docs) were slightly different from yours, but yours got me close enough to finish up.

Oh boy, oh boy! I have an OACS running after a year or more of reading about it.

Van

Collapse
Posted by Vinod Kurup on
Hi Van,

Looks like you've been successful, but I just wanted to make a couple notes in case someone else has the same problem

Issue 1: Running postgres utilities (createdb, etc) as the nsadmin user.

The following must be true:
  1. web group must have read and execute privs on /usr/local/pgsql and /usr/local/pgsql/bin
  2. nsadmin must belong to the web group (check by doing: groups nsadmin)
  3. nsadmin's path must have /usr/local/pgsql/bin in it (check by doing: echo $PATH)
  4. nsadmin must have been given specific user privileges by postgres user (i.e. postgres user must run 'createuser nsadmin').
So, it looks like your issue was with #1 (as Jade and Tapiwa have mentioned).

Your pgsql dir looks like this:

drwxr-----    9 postgres web          4096 Mar  4 13:22 pgsql
whereas mine (Debian) looks like this:
drwxr-sr-x    9 postgres web          4096 Feb  1 12:53 pgsql
So this looks like a difference in the way that RedHat and Debian set perms on a newly created dir under /usr/local (i'm guessing now).

I'll fix this in the docs by making sure that /usr/local/pgsql is set to chmod 750 after it's created.

Issue 2: Installing the PG driver

There's no longer a separate section for installing the PG driver, since the driver is included in Mat Kovach's awesome aolserver-oacs distribution. Unfortunately, the makefile in /usr/local/src/aolserver/pgdriver/makefile won't work on every distro. You should be able to get this to work by setting PGLIB=/usr/local/pgsql/lib and PGINC=/usr/local/pgsql/include, as mentioned above. If you use Mat's conf script, you can leave NSHOME alone and it will build all the modules into /usr/local/src/aolserver/dist and then install them into /usr/local/aolserver. It also tars up the modules and aolserver into your own personal binary distro so that if you ever need to recreate your initial set up, just untar and mv to /usr/local/aolserver. No need to remake everything. (Just noticed that today Mat - very cool!)

Mat's working on editing the makefile to make it work seamlessly on multiple platforms, but it's not quite there yet, so I'll add some instructions to the docs in the meantime

Issue 3: Problems with the openacs4.tcl.txt file

It looks like some tabs are not coming across properly (e.g. the tab between 'fancy' and '".adp"'), so I'll convert these to spaces and upload a new file.

BTW, Thanks for bringing up these problems! They'll hopefully be fixed soon.