Forum OpenACS Q&A: Novice question
When I got to "Prepare PostgreSQL for OpenACS" on the "Install OpenACS 4.5" page, the "createdb <service-name>" 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 1This 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.hTwo 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/webIf 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!
Can you try this
cd ~postgres cd .. ls -lWhat are the permissions set for the Postgres user?
Try this as root:
chmod g+r postgresDoes 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.
[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 srcNote that this is in the /usr/local directory, also available as /raid1/usr.local/local.
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
Maybe I am misunderstanding your problem, but I still think that it is a permissions issue... I think the problem I had was similar.
/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
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.
chmod +rx postgresVinod, 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?
chmod g+rx postgresSorry for the waste of bandwidth.
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.
<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>
<pre>[05/Mar/2002:10:50:58][18381.1024][-main-] Fatal: config: script error: wrong # args: should be "ns_param key value
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
"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:
Server startup failed: Error during bootstrapping<blockquote><pre>command "ns_db" is not enabled
(procedure "db_bootstrap_set_db_type" line 72)
invoked from within
<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.
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 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
After doing this, restart aolserver as normal and continue with the installation.
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.
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:
webgroup must have read and execute privs on
nsadminmust belong to the web group (check by doing:
nsadmin's path must have
/usr/local/pgsql/binin it (check by doing:
nsadminmust have been given specific user privileges by
postgresuser must run '
Your pgsql dir looks like this:
drwxr----- 9 postgres web 4096 Mar 4 13:22 pgsqlwhereas mine (Debian) looks like this:
drwxr-sr-x 9 postgres web 4096 Feb 1 12:53 pgsqlSo 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 driverThere'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/makefilewon't work on every distro. You should be able to get this to work by setting
PGINC=/usr/local/pgsql/include, as mentioned above. If you use Mat's conf script, you can leave
NSHOMEalone and it will build all the modules into
/usr/local/src/aolserver/distand 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
/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 fileIt 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.