Forum OpenACS Development: BSD installer: FreeBSD port

Collapse
Posted by xx xx on
I just added a new installer to filestorage on openacs.org. This BSD (FreeBSD)installer is an addition to the Windows and a Linux (debian) installers.

Using a port for FreeBSD makes installing openACS / .LRN on FreeBSD as easy as typing "make install". The download is currently only 33kb (tar.gz).

A prerequisite is that you have installed FreeBSD's ports system (which is likely). The ports system is a bunch of Makefiles (with supportfiles) that you will find at /usr/ports. I have been testing on a clean box.

How to install? Become root, cd to a workdirectory of your choice and type:

  • fetch https://openacs.org/storage/view/miscellaneous/openacs-port.tar.gz
  • tar xzf openacs-port.tar.gz
  • cd ./openacs-port/openacs/ (or ./openacs-port/dotlrn/ if you want .LRN )
  • make fetch-recursive
  • make install
That should be it. "Make fetch-recursive" can even be omitted. However, it will prevent problems during port building at times that the network is unstable. Fetch-recursive will download all tarballs needed in /usr/ports/distfiles.

Versions and installdirs are in the port at ./openacs-port/openacs/files/BaseVersions. If you have modules already installed, you may want to point to the correct location there. Also change module versions there, but this may need more work.

This port has been tested with Postgresql on a clean FreeBSD system.
Installing oracle should be possible by setting WITH_ORACLE=[tab]YES in BaseVersions (untested), and following the FreeBSD-Oracle docs. Obviously you may probably need to patch config.tcl, .profile, nsd-postgres, daemontools/run, /usr/local/rc.d/, add Oracle ports, etcetera.

Patches (actually diff -u files) are applied from the files directory to the ./work/portname-portversion directory, which is created after extract. Filenames in the diff should be relative to this directory.

When installation encounters an error it will stop. Correct the error and type "make install" or "make fetch-recursive" again. It will skip everything that already had been done.

When installation has finished (in an hour or so?) it will report succes and register the OpenACS/.LRN package.
For newbies: Now, view the welcome page, see what packages are installed and find out your IP-adress:

  • lynx http://0.0.0.0:8000
  • pkg_info (or ls /var/db/pkg/)
  • ifconfig
  • lynx http://[IP]:8000
There is abundant documentation, like in this thread, but also:

FreeBSD is a great choice for newbies and gurus, IMO.

This port needs work though. For example "make deinstall" will throw errors. However, it just means that some files have not been deleted and you can do that manually afterwards (or fix it) if you want, but still. Hopefully there are some FreeBSD-Makefile/openACS developers out there, willing to enhance the port and possibly aid in adding it (in some form) to FreeBSD's Ports distribution for openACS/.LRN evangelism.

Collapse
Posted by xx xx on
Daemontools will start supervising after a reboot (fingers crossed).
Collapse
Posted by xx xx on
Cross post to FreeBSD thread in openACS docs:
https://openacs.org/forums/message-view?message_id=136910
Collapse
Posted by Torben Brosten on
Aldert, this is great news!

This port could be the start of a multiplatform OpenACS installer. FreeBSD ports is the base for some other port platforms, such as opendarwin[1].

What "workingdirectory" does one use to most closely match a standard install according to OpenACS documentation[2]?

1. http://darwinports.opendarwin.org/

2. https://openacs.org/doc/openacs-5-1/install-steps.html#id2509822

Collapse
Posted by xx xx on
Interesting Torben. I didn't know about DarwinPorts.

DarwinPort's Portfiles resemble FreeBSD's Makefiles and the port structure is alike.
http://darwinports.opendarwin.org/darwinports/dports/
http://www.freebsd.org/cgi/cvsweb.cgi/ports/

This would mean that it would take time, but it may not be too hard to create the "missing" Mac installer. Especially since aolserver and postgresql (and a FreeBSD port) are already there and there are good DarwinPort docs.

So I agree, it definitely looks like a useful project to see if DarwinPorts will really run on Mac, Linux and FreeBSD as they suggest (and how hard it is).

Collapse
Posted by Rocael Hernández Rizzardini on
this are indeed good news, thanks Aldert!
Collapse
Posted by Jade Rubick on
Aldert: to really see your work survive, can you commit the installer code to CVS, and add installation instructions to the documentation?
Collapse
Posted by xx xx on
Jade: sure, that will be useful in time. But, I'ld better post the port to the freebsd list first (once I find time). Adaptions I made to the aolserver- and postgresql port should actually be in the regular port, for example. But I'll keep in mind to add it to CVS.

BTW, a request to anybody trying this port, please let me know about your experience.

Collapse
Posted by Tyge Cawthon on
Got some good news about the port. I have just tried it from a fresh install of FreeBSD 5.3. Everthing worked correctly up to the first initial reboot with OpenACS loaded.

background:
After the installation of OpenACS, the installer is requested to enter in information such as name, password, etc. After I did that, I changed the port information to reflect port 433 and 80 in the files:

var/lib/aolserver/service0/etc/daemontools/run
and
/var/lib/aolserver/service0/etc/config.tcl

When I reboot I see no new log files here:
/var/lib/aolserver/service0/log/
just the org. ones from the install.

There was only one error message in the org log:
[22/Dec/2004:17:52:16][13870.137931776][-shutdown-] Notice: nslog: closing '/var/lib/aolserver/service0/log/service0.log'
[22/Dec/2004:17:52:17][13870.134557696][-main-] Error: pidfile: failed to remove '/usr/local/aolserver/log/nspid.service0': 'No such file or directory'
[22/Dec/2004:17:52:17][13870.134557696][-main-] Notice: nsmain: AOLserver/4.0.9 exiting

I have since changed all files back to the org install. I am still having problems reaching the server using a browser. I can ping it using the IP or server name

Here is what is running.

ps -auxww | grep aol
service0 1666 0.0 0.7 1472 888 p0 S+ 10:48PM 0:00.02 grep aol

ps -auxwww | grep service
root 1634 0.0 1.0 1600 1260 p0 I 10:42PM 0:00.07 su - service0
service0 1635 0.0 1.0 1640 1176 p0 S 10:42PM 0:00.05 -su (sh)
service0 1703 0.0 0.7 1412 904 p0 R+ 10:56PM 0:00.02 ps -auxwww
service0 1704 0.0 0.7 1476 892 p0 S+ 10:56PM 0:00.02 grep service
root 433 0.0 0.5 1236 664 con- S 7:42PM 0:01.59 /usr/local/bin/svscan /service/
root 438 0.0 0.5 1188 600 con- I 7:42PM 0:00.84 supervise service0

Thinking there was a problem with AOLserver I executed this command as service0:
/usr/local/aolserver/bin/nsd-postgres -t /var/lib/aolserver/service0/etc/config.tcl
and got is reported back.
/libexec/ld-elf.so.1: Shared object "libnsd.so" not found, required by "nsd"

Any suggestions?
Thanks

Collapse
Posted by xx xx on
Brian:

Great to hear it worked at first. Too bad it broke.

1. Correct .profile as described in my response to T.K. above (I'll have to update the port)

2. I didn't include openssl yet. To install type:
# to search
cd /usr/ports
make search name=openssl
# or direct
cd /usr/ports/security/openssl
make install
# and good luck :)

3. BTW, don't edit daemontools/run in place always copy to run.new, then edit file run.new and copy it back to run. Try (if you have rebooted at least once):
# bring down
svc -d /service/service0
# start daemontools
svc -u /service/service0

4. find out if there is a permissioning problem.
ls -al /usr/local/aolserver
chown -R root:wheel /usr/local/aolserver

ls -al /var/lib/aolserver/service0/etc/
chmod -R 755 /var/lib/aolserver/service0/etc/daemontools
chmod -R 755 /service/service0

5. I'm not sure about the shared object thing. There are several options.

# A. This will probably help you out one time. I would think it should work after a reboot
# but actually it doesn't keep the information.....
/sbin/ldconfig -m /usr/local/aolserver/lib

# B. Then there is libman.conf which you probably can create. But it isn't on my system.
man libman.conf

# C. What does work is changing rc.conf
# Default values are set in /etc/defaults/rc.conf but you can override them in /etc/rc.conf
ee /etc/rc.conf
   # add
   ldconfig_paths="/usr/lib/compat /usr/X11R6/lib /usr/local/lib /usr/local/aolserver/lib"
# reboot
shutdown -r now

# D. The best option may be to add the lib directory to LD_LIBRARY_PATHS
# in .profile of your users (if it works for you too).
ee ~/.profile
   #add
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib:/usr/local/aolserver/lib
#..re-login..

# E. You can even link them statically with "ln -s", once you have discovered what is wrong:
/usr/bin/ldd /usr/local/aolserver/bin/nsd

What is is right and what is wrong? The easiest seems to be the .profile option. Tell me if that works for you. Good luck.

Collapse
Posted by T.K. kang on
Thanks for the detail instruction. Trying to digest what I have to do as I am not really a very technical person. I am stuck with FreeBSD 4.10 as I could not get 5.3 running on my computer - whatever reason. All things seems to install O.K. but aolserver not loaded automatically on reboot.

Perhaps I should wait for whatever to be updated in your port to give it a new try. Appreciate if you could give it a go with the 4.10

Thanks and I really appreciate the assistance here. Too bad I am less technical compared to Brian who is now a happy person!!

A Merry Christmas to you.

Collapse
Posted by T.K. kang on
I tried installing on to a fresh 4.10 FreeBSD. I like the fact this port could really simply our lives. After installation I could point to the server with my browser - the error page indicate some postgres error. I reboot but the the aolserver did not load this time to receive calls. As I am not a technical person I am lost here.

What vesion of FreeBSD would be advisable for this port ?

Pointers needed for a Happy Merry Christmas. Thanks for the good work I see with this port.

Collapse
Posted by xx xx on
T.K.:

Nice to see that non-technical persons are giving it a try. It may be a problem that this port is a very first version that will have bugs and should be optimized. Still it should be a good experience. The port has been verified on 5.3.

BTW, you should obviously read the FreeBSD handbook and openacs docs at one time (if you want to run a server yourself). It is fun to learn.

If I understand you correctly the port ran to the end without an error (at the end) on 4.10? Do you see an openacs* or dotlrn* (* = -versionnumber) package installed when typing "pkg_info" ?

If so, postgresql probably didn't start.
# restart postgresql
/usr/local/etc/rc.d/010.pgsql.sh restart

If that doesn't work you should start debugging as root, after reading the general openacs docs at https://openacs.org/doc/openacs-5-1/postgres.html.

But, as root, first correct my mistakes in .profile (and spot any new ones :))
# change all shells to bash
chsh -s /usr/local/bin/bash root
chsh -s /usr/local/bin/bash service0
chsh -s /usr/local/bin/bash postgres
# do you have other users you login with?

# add .profile to service0 if non-existent
ls -al ~service0/
# if non-existent
cp ~postgres/.profile ~service0/.profile
chown service0:web ~service0/.profile
ee ~service0/.profile
   # edit HOME
   HOME = /var/lib/aolserver/service0
# ESC to leave and save

# correct missing quotes in .profile (of all users):
   #change export PS1=<\u-\W> to
   export PS1="<\u-\W>"
ee ~/.profile
ee ~postgres/.profile
ee ~service0/.profile
# ESC to leave and save
# always ..re-login.. as this user to see the effect with "env"

Now debug, try (FreeBSD 5):
# Did the postgresql* package install at all?
pkg_info
# Is user postgres and root available and using Bash?
pw usershow root
pw usershow postgres
pw usershow service0
# Has the service0 database been created?
su - postgres
psql -l
exit
# Do you see /usr/local/pgsql/lib ../bin in your path (ld_library_path)?
env | grep PATH
# what do you see in the error log
less /usr/local/pgsql/data/server.log
# do you see the postmaster has started?
ps -auxww | grep postmaster

Collapse
Posted by Tyge Cawthon on
Aldert - Thanks for the help.

Here are the changes I did and the order. Please note: I rebooted between each change. It was not until all the changes where done that OpenACS worked on port 8000.

1. update the permissions
chmod -R 755 /var/lib/aolserver/service0/etc/daemontools
chmod -R 755 /service/service0

2. changed shell to bash for root, postgres, serviceo
chsh -s /usr/local/bin/bash root
chsh -s /usr/local/bin/bash service0
chsh -s /usr/local/bin/bash postgres

3. added the .profile file and corrected command line:export PS1="<\u-\W>" for:
a. root
b. postgres
c. service0

(note: 4-5 done together before last reboot)
4. updated the /etc/rc.conf by adding (all one line):
ldconfig_paths="/usr/lib/compat /usr/X11R6/lib /usr/local/lib /usr/local/aolserver/lib

5. add this to the root .profile (all one line):
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib:/usr/local/aolserver/lib

Openacs worked!!!.... NICE JOB EVERYONE!!!
-----------------
I than updated the daemontools/run and
/var/lib/aolserver/service0/etc/config.tcl to use
post 80 and 443

Everything works again....
Everyone - Have A Safe and Happy Holiday!!

Collapse
Posted by xx xx on
Great Brian. Enjoy.

I made a typo, libman.conf should be libmap.conf (use libmap.conf(5) for libraries mappings).
If you want to use it, create it.

Your typo, ldconfig_paths should end with a " obviously.

Collapse
Posted by Tyge Cawthon on
T.K. kang,
I am not a high tech person and I believe we can do this. I have some manual instructions that I can email you if you would still like to try using BSD and OpenACS. The manual instructions have checks throughtout the process. If you would like the manual instructions, please let me know. I can be reached at mailto:btc@chipchat.com. There is a lot to learn here. I am happy I stuck with it.
Collapse
Posted by xx xx on
I uploaded a new version. It should work on 4.10. Please, verify and report back. I didn't have time to rerun it yet.

On 4.10 there was the same problem with .profile and rc.conf as described above. If you correct those, logout and login, restart postgresql and then:
su -l postgres "dropdb service0"
su -l postgres "createlang plpgsql template1"
su -l postgres "createlang -l template1"
su -l postgres "dropdb service0"
shutdown -r now

If that doesn't work, try again with the new port version (27-12-04)

Collapse
Posted by xx xx on
Sorry, the second su -l postgres "dropdb service0" should be:
su -l postgres "createdb service0"
Collapse
Posted by T.K. kang on
Thanks for updating the port. I gave it a try yesterday on a fresh 4.10. It gave some errors in creating the pgsql directory and the bash. I did that manually and the installation went O.K. I am playing with it now !! I think some minor updates will make it complete. Looking forward to the final refinement of the port.

Cheers

Collapse
Posted by xx xx on
Next version uploaded. I think I verified it now...
Collapse
Posted by xx xx on
I'm verifying again.... You'll have to at least type:

make makesum

(in the dotlrn/openacs dir) before you start.

We will get there! But you are up and running, so no problem, I guess.

With the new port you should be able to install dotlrn and openacs but they cannot listen to the same port in config.tcl so shut one down (svc -d /service/...) and restart (killall -9 nsd). Wait a while before you start experimenting further. I'll upload a new version if necessary.

Collapse
Posted by Paul Bennett on
Aldert,

Thanks so much for your work on this port. I had attempted to install OpenACS on the recommendation of a friend and after several months (as a newbie) using various online docs - well, it never worked for me. He tried to pry me away from FreeBSD, and yes I did stray, but no more! Now I'm up and running in a bit over an hour! Woohoo. Now I can test it out properly!

Collapse
Posted by xx xx on
Port is now in FreeBSD's ports collection:
https://openacs.org/forums/message-view?message_id=312823