Forum OpenACS Development: Re: New Installation Question

Collapse
Posted by Stefan Sobernig on
Raúl,


I assume that the instructions are for Ubuntu 8.04 LTS Server Edition as I could not find the version that was stated in the instructions.

You are perfectly right, I confused the version numbers. I corrected them ... you did fine.


The instruction ended with postgres installation so I continued installment with item 3 on Debian instructions with no .lrn installation.

Again, you assumed correctly. I fixed this in the instructions.


All installed fine, however, when pulling up web page, I got the standard message that indicates the database is not up.

I can confirm the issue. I wrote up an email to the package maintainer and I hope he will be on-top of it soon.


I figured I must have entered something that conflicted during the prompts so I reinstalled Ubuntu and went through the installation script again and kept all default values. Installation was successful.

generally speaking, you do not have to reinstall the entire system. it is perfectly sufficient to remove the packages.

aptitude remove openacs (for instance)

in the meantime, if you are willing to commit a work-around:

1. re-install the package
2. in the data base set-up dialogue, provide the following information
db_host 127.0.0.1
db_port 5432

make sure you create a db user and provide a password.

3. now, you need to edit a file: /etc/openacs/config.tcl

look for the following entries ...

'ns_param password ""'

... and change them to ...

'ns_param password $db_password'

4. kill the aolserver process: killall aolserver4-nsd
5. restart: /etc/init.d/openacs start

you should be fine then ...

//stefan

Collapse
Posted by Raul Rodriguez on
Thank you for your response. I did
aptitude remove openacs
aptitude install postgresql-8.2
aptitude install postgresql-8.2
aptitude install openacs

And I got errors:

Setting up aolserver4-core (4.5.0-14) ...
Setting up aolserver4 (4.5.0-14) ...
 * Starting web server aolserver4 /usr/sbin/aolserver4-nsd: error while loading shared libraries: libnsd.so: cannot open shared object file: No such file or directory
 [fail]
invoke-rc.d: initscript aolserver4, action "start" failed.
dpkg: error processing aolserver4 (--configure):
 subprocess post-installation script returned error exit status 1
Setting up aolserver4-doc (4.5.0-14) ...

...

Setting up xsltproc (1.1.22-1ubuntu1.2) ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
 aolserver4
 aolserver4-nscache
 aolserver4-nspostgres
 aolserver4-nssha1
 aolserver4-xotcl
 openacs
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up aolserver4 (4.5.0-14) ...
 * Starting web server aolserver4 [02/Sep/2008:17:12:12][19180.3083864256][-main-] Notice: prebind: bound: 127.0.0.1:80
                                                                                                                                                       [ OK ]

Setting up aolserver4-xotcl (1.6.0-1) ...
Setting up aolserver4-nssha1 (0.1-1) ...
Setting up aolserver4-nspostgres (4.0+20071212-1) ...
Setting up aolserver4-nscache (1.5-2) ...
Setting up openacs (5.4.2) ...



Any Ideas? I also did not get any "data base set-up dialogue".
Thank you
Collapse
Posted by Héctor Romojaro on
Hi Raul,

First of all, thanks for testing the debian/ubuntu packages.

I've re-tested the install on a ubuntu hardy system, and I'm getting the same error than you:

-----------------
* Starting web server aolserver4 /usr/sbin/aolserver4-nsd: error while loading shared libraries: libnsd.so: cannot open shared object file: No such file or directory
-----------------

...and then all the packages (aolserver4-*, openacs, ...) fail to install.

The problem is from the package aolserver4, which starts the daemon before doing the ldconfig, and gives the error of "cannot open shared ...".

-----------------
/usr/sbin/aolserver4-nsd: error while loading shared libraries: libnsd.so: cannot open shared object file: No such file or directory
[...]
ldconfig deferred processing now taking place
-----------------

As you can see, the shared libraries are finded properly after that:

# ldd /usr/sbin/aolserver4-nsd
linux-gate.so.1 => (0xb7fab000)
libnsd.so => /usr/lib/aolserver4/lib/libnsd.so (0xb7f3a000)
libnsthread.so => /usr/lib/aolserver4/lib/libnsthread.so (0xb7f32000)
libtcl8.4.so.0 => /usr/lib/libtcl8.4.so.0 (0xb7e7d000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7e79000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7e61000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7e3c000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e31000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7ce2000)
/lib/ld-linux.so.2 (0xb7fac000)

So you can go ahead again with the install, doing apt-get install openacs (or dotlrn). From your post, I think aptitude is doing it automagically 😉

After that, you will find another error from the aolserver4 package:

-------------------
Fatal: log: failed to open server log '/var/log/aolserver4/aolserver4.log': 'Permission denied'
-------------------

aolserver4 package is not setting properly the permissions on their own log directory before launching the daemon (similar error than the first one), but the installing of the other packages finish properly.

After all, if you entered the correct values on the openacs|dotlrn install, you'll have a running instance on your server's http://localhost:8000 😊

If you're not getting any dialogue at the install, you didn't "purge" the packages before the install. I mean, you removed the packages (aolserver4, openacs...), but not the config files, including the data acquired from the previous configuration dialogs.

To fix it (and all your installation problems, i think), just do:

# dpkg --purge openacs
# apt-get install openacs --reinstall

After that, answer the questions of the installer (if you haven't changed your postgresql configuration, pressing enter on all the questions will work), and open a browser window on http://localhost:8000 to start the datamodel creation 😊

-- Héctor

Collapse
Posted by Stefan Sobernig on
Thanks Héctor for hunting this down!!!

Is the ldconfig issue something that needs to be reported to the Debian Tcl/Tk guys? If so, go ahead and file a bug ...

thx again
//stefan

Collapse
Posted by russ m on
generally speaking, you do not have to reinstall the entire system. it is perfectly sufficient to remove the packages.
aptitude remove openacs (for instance)

FYI, on Debian (and Ubuntu) if you've messed something up and want to start again, you should purge packages instead of removing... "remove" leaves configuration files behind in case you want to reinstall at some stage, but if your configuration is broken this isn't what you want... "purge" will remove every trace of a package that apt is aware of...

aptitude purge openacs

(not actually required in this case, but a general apt tip)

Collapse
Posted by Raul Rodriguez on
Thank you for your help. I am still having problems.

With default install everything works fine.

I did the following to reinstall:

sudo killall aolserver4-nsd
sudo dpkg --purge openacs
sudo dpkg --purge postgresql-8.2

sudo aptitude install postgresql-8.2
sudo aptitude install openacs

However, when I keep all defaults, except for the default Database owner username, I get the standard DB Confirguration OACS error. The patch mentioned above seems to have been applied already.

[04/Sep/2008:18:37:46][11808.3083016384][-main-] Notice: Database API: The following pools are available for OpenACS: pool2 pool3 pool1
[04/Sep/2008:18:37:46][11808.3083016384][-main-] Notice: dbdrv: opening database 'postgres:localhost:5432:openacs'
[04/Sep/2008:18:37:46][11808.3083016384][-main-] Notice: Opening openacs on localhost
[04/Sep/2008:18:37:46][11808.3083016384][-main-] Error: Ns_PgOpenDb(postgres):  Could not connect to localhost:5432:openacs:  could not connect to server: No\
 such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Any ideas?

Also is there any documentation on how to create a new instance on the same machine?

TIA

Collapse
Posted by Steffen Tiedemann Christensen on
Is PostgreSQL running? What happens when you try to run:
psql openacs
(or psql -p 5432 openacs

If you get the same error, you should try starting up the postgresql backend. It might be done with something like this:
sudo /etc/init.d/postgresql start

Collapse
Posted by Raul Rodriguez on
No luck, I get the same db errror. I did:
psql: FATAL:  role "root" does not exist
remadmin@ticket:~$ sudo psql openacs
psql: FATAL:  role "root" does not exist
remadmin@ticket:~$ sudo psql -p 5432 openacs
psql: FATAL:  role "root" does not exist
remadmin@ticket:~$ sudo /etc/init.d/postgresql start
sudo: /etc/init.d/postgresql: command not found
remadmin@ticket:~$ sudo /etc/init.d/postgresql-8.2 start
 * Starting PostgreSQL 8.2 database server                                                                                                             [ OK ]
remadmin@ticket:~$ sudo killall aolserver4-nsd
remadmin@ticket:~$ sudo /etc/init.d/openacs start
Starting web server: openacs.
remadmin@ticket:~$ sudo /etc/init.d/postgresql-8.3 start
 * Starting PostgreSQL 8.3 database server                                                                                                             [ OK ]
remadmin@ticket:~$ sudo killall aolserver4-nsd
remadmin@ticket:~$ sudo /etc/init.d/openacs start
Starting web server: openacs.

Collapse
Posted by Steffen Tiedemann Christensen on
Alright, so this starts up the database server (which is good to keep in mind since that's a prerequisite for everything else):

sudo /etc/init.d/postgresql-8.3 start

And since you're using version 8.3, I'm fairly certain you'll need to use port 5433 in your config file (and possibly specifiy -p 5433 when calling psql/createuser/createdb later on.)

I'm not a wizard when it comes to configuring PostgreSQL on Debian, so you should have a look in the OpenACS install guide. A few quick pointers though:

createuser creates a role or a user for accessing the database.
createdb reate a new database
psql accesses that database.

As a general rule you should never, ever call these three with sudo; instead create a postgresql user for yourself using createuser. This is usually done like this:

sudo su - postgres
createuser -p 5433 <yourusername>
exit

Now, as yourself create a database:

createdb -p 5433 openacs

Now, finally you'll be able to connect o the newly created database:

psql -p 5433 openacs

After the database is create and running, you'll be able to start up openacs for the first time and do the installation.

Again, all of this is pretty well specified in the OpenACS Installation Guide or in any primer to PotsgreSQL so you would benefit from looking there.

Collapse
Posted by Raul Rodriguez on
I did this:
sudo su - postgres

psql -p 5432 openacs

and I got connected to the interactive terminal
I then stopped and started aolserver and still had the same problem.

When I did my install I only installed postgres8.2 per the installation instructions.

I do know that when I use all default values, everything works; however, I dont want the default database user name.

Collapse
Posted by Raul Rodriguez on
I also missed mentioning the error log shows a different error:


[13/Sep/2008:16:03:40][11244.3083901120][-main-] Notice: Database API: Default database (dbn) is: 'default'
[13/Sep/2008:16:03:40][11244.3083901120][-main-] Notice: Database API: Using ALL database pools for OpenACS.
[13/Sep/2008:16:03:40][11244.3083901120][-main-] Notice: Database API: The following pools are available for OpenACS: pool2 pool3 pool1
[13/Sep/2008:16:03:40][11244.3083901120][-main-] Notice: dbdrv: opening database 'postgres:localhost:5432:openacs'
[13/Sep/2008:16:03:40][11244.3083901120][-main-] Notice: Opening openacs on localhost
[13/Sep/2008:16:03:40][11244.3083901120][-main-] Error: Ns_PgOpenDb(postgres): Could not connect to localhost:5432:openacs: FATAL: Ident authentication fa\
iled for user "foo"

[13/Sep/2008:16:03:40][11244.3083901120][-main-] Error: dbdrv: failed to open database 'postgres:localhost:5432:openacs'
[13/Sep/2008:16:03:40][11244.3083901120][-main-] Warning: Database API: couldn't allocate a handle from database pool "pool2".
[13/Sep/2008:16:03:40][11244.3083901120][-main-] Error: Database API: RDBMS type could not be determined for any pool.

Collapse
Posted by Raul Rodriguez on
I have been trying to figure out what is going on.
I saw this:
/usr/sbin/aolserver4-nsd -u www-data -g www-data -b 127.0.0.1:8000 -t /etc/openacs/config.tcl

So I ended up doing this:

sudo killall aolserver4-nsd
sudo /usr/sbin/aolserver4-nsd -u foo -g www-data -b 127.0.0.1:8000 -t /etc/openacs/config.tcl

The DB error went away but now I get the following message in the browser:

* The /usr/share/openacs directory has incorrect permissions. It must be owned by the user executing the web server, normally nsadmin, and the
owner must have read and write privileges on this directory. You can correct this by running the following script as root. To give another user
access to the files, add them to web group.

groupadd web
chown -R nsadmin:web /usr/share/openacs
chmod -R ug+rw /usr/share/openacs

* The /usr/share/openacs/packages directory has incorrect permissions. It must be owned by the user executing the web server, normally nsadmin and
the owner must have read and write privileges on this directory and all of its subdirectories. You can correct this by running the following
script as root. To give another user access to the files, add them to web group.

groupadd web
chown -R nsadmin:web /usr/share/openacs/packages
chmod -R ug+rw /usr/share/openacs/packages

I dont think that the recommended fix will work since the group seems to be www-data now?

Any Ideas?
TIA

Collapse
Posted by Raul Rodriguez on
I was able to get the server to come up with the standard installation screen by doing the following:

sudo emacs /etc/init.d/openacs (changed user from www-data to foo)
sudo chown -R foo:www-data /usr/share/openacs
sudo chmod -R ug+rw /usr/share/openacs

Does anyone know how to set another instance on the same server?

---rer

Collapse
Posted by Héctor Romojaro on
Hi Raul,

At this point the openacs debian/ubuntu packages doesn't support multiple instances on the same server. You can make a copy of the /usr/share/openacs directory, change the owner, rebuild the symlinks... but it will be a mess, mainly at upgrading to a newer version later 🤔

If you are going to use more instances on the same server I recommend you to use the source instalation.

About the database errors, let's start for the beginning. It seems that aptitude is installing postgresql 8.3 when installing the openacs package, because postgresql-8.3 is the default postgresql version on ubuntu, and the package openacs recommends just "postgresql".

I corrected the wiki pages from debian and ubuntu to use apt-get instead of aptitude. Apt-get doesn't install by default the packages marked as "recommended", only straight dependencies.

I fixed some days ago an issue of the package related to connecting to postgresql with another user than default, so I recommend you to download the package again.

The default install works because the owner of the database is the same as the owner of the openacs files, the user www-data. The postgresql defaults for localhost socket connections are (from pg_hba.conf):

# TYPE DATABASE USER CIDR-ADDRESS METHOD
local all all ident sameuser

Which means that if you want to use a different DB user, you must allow access to that user on postgres, adding a line like this before the previous one on /etc/postgresql/8.2/main/pg_hba.conf:

# TYPE DATABASE USER CIDR-ADDRESS METHOD
local openacs user md5

If you are using a blank password, change "md5" for "trust", for example.

I will add a warning on the installer to beware people of granting access if they change the user. It goes beyond to the purpose of the installer to chan
ge the postgresql access policies, I think.

Well, let's start again and do the things right:

1- Purge some packages and drop database:

- Purge openacs
# sudo apt-get remove openacs --purge

- Purge postgresql 8.3
# sudo apt-get remove postgresql-8.3 postgresql-client-8.3 --purge

- Drop the database on postgresql 8.2 if it exists.
# sudo su - postgres -c 'dropdb openacs'

- Purge postgresql 8.2
# sudo apt-get remove postgresql-8.2 postgresql --purge

2- Start the install again:

# sudo apt-get clean
# sudo apt-get update
# sudo apt-get install postgresql-8.2
# sudo apt-get install openacs

Fill the questions and put whatever DB owner you want, if you granted access on postgresql to him :)

3- Check the install opening a browser on localhost:8000.

# firefox http://localhost:8000 (in example)

Cheers, Héctor

Collapse
Posted by Héctor Romojaro on
Hi all,

I've just fixed some things on dotlrn and openacs debian packages:

- Postgresql and daemontools are now "Suggested" dependencies instead of "Recommends", to avoid problems with aptitude.
- The installer grants access permissions on postgresql's pg_hba.conf automatically if the user wants to (only if postgresql is installed on localhost).
- Fixed some issues with dpkg-reconfigure.

Purging previous packages is recommended before installing the new ones. To purge and install:

# sudo apt-get clean
# sudo apt-get update
# sudo apt-get remove openacs | dotlrn --purge
# sudo apt-get install openacs | dotlrn

The database is not dropped on purge, so don't be afraid of doing it :)

Cheers, Héctor