Forum OpenACS Development: Re: New Installation Question

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