1
buckrey
Installing XOOPS on openBSD3.6 - A howto from my installation.
  • 2005/5/8 9:07

  • buckrey

  • Just popping in

  • Posts: 3

  • Since: 2005/4/29


After posting my site (http://www.buntal.org) to XOOPS link- there are request from member on how to XOOPSS on openBSD3.6 , I post it in the links comment, I thought I'd better post it here as well .

Point to note:

OpenBSD 3.6 apache installation will be chrooted by default. ( you can set the chrooted path in apache configuration file, default would be /var/www). This basically means that webserver wont be able to see/execute anything outside it chroot jail. That will effectively limit all the intrusion ( if any) within /var/www boundary.

Not being able to access services beyong chroot jail also means no access to : MySQL socket ( mysql.sock) , netPBM/imagemagick(xoopsgallery needs them), and most importantly the mail() function ( extensive use of mail nofication will be impaired) .

Step 1

Installing all packages apache,php,mysql in one go can be done by installing phpMyAdmin package, (pkg_add /the_path_to_packages/phpMyadminXXX.tgz ), all the dependencies will be added as well by openBSD package manager.

But here is my installation packages , ( set env to ftp directory and then pkg_add php4-core-4.3.10.tgz php4-curl-4.3.10.tgz php4-extensions-4.3.10.tgz php4-domxml-4.3.10.tgz php4-gd-4.3.10.tgz php4-imap-4.3.10.tgz php4-ldap-4.3.10.tgz php4-mysql-4.3.10.tgz php4-odbc-4.3.10.tgz php4-pdf-4.3.10.tgz php4-pear-4.3.10.tgz php4-pqsql-4.3.10.tgz php4-xmlrpc-4.3.10.tgz phpMyAdmin-2.5.7-pl1.tgz postgresql-server-7.4.3.tgz postgresql-client-7.4.3.tgz netpbm-9.24pl.tgz mysql-server-4.0.20.tgz mysql-client-4.0.20.tgz mailman-2.1.5-postfix.tgz vsftpd-1.2.2.tgz webalizer-2.01.10pl.tgz wget-1.8.2.tgz wordpress-1.2.tgz py-mysql-0.9.2.tgz py-openssl-0.5.1.tgz py-ldap-2.0.0pre19-2.3.tgz py-curl-7.12.tgz)

Test run the installation by running - apachectl start . and mysqld_safe .Then point the browser to phpMyAdmin url, you'll get the message , something like` unable to connect to MySQL .... mysql.sock et al `. This is because php has no access to mysql.sock located outside chroot jail ( /var/run/mysql/mysql.sock ).
To make it happen create a link - #ln -f /var/run/mysql/mysql.sock /var/www/var/run/mysql/mysql.sock . ( of course you have to first create all the necessary directories within chroot jail).

Even better if you want to start MySQL at boot, then do these:

1. in /etc/rc.conf.local
# Start MySQL automatically at start-up:
mysql=YES

2. etc/rc.local
# MySQL Settings
#
rm -R /var/www/var/run/mysql
mkdir -p /var/www/var/run/mysql
#
if [ X "${mysql}" == X"YES" -a -x /usr/local/bin/mysqld_safe ];
then echo -n "mysqld" ;
/usr/local/bin/mysqld_safe --user= _mysql \
--bind-address=127.0.0.1 --log=/var/mysql/
#
for i in 1 2 3 4 5 6;
do if [ -S /var/run/mysql/mysql.sock ];
then break
else sleep 1 echo -n "."
fi done
#
sleep 10
#
ln -f /var/run/mysql/mysql.sock /var/www/var/run/mysql/mysql.sock
fi

That will start MySQL automatically at boot time.Some users have a problems with MySQL overloaded , it can be solved just by adding the following to the mysqld_safe invocation line ( right after user=_mysql ) " --open-files=1000" .

Now your Apache,PHP and MySQL will be running hand-in-hand.


Step 2 - Installing xoops

This should be straight forward as we all know that XOOPS can run on any platform.Everything should run fine except for :

a) .mail() function will silent out. No mail sent for user registration confirmation or in the notification.
b) If you install XOOPS gallery you will face one more problem, because no access to netPBM / image magick .

step 3 - solving mail function.

In my case I use mini_sendmail. Install the package with chroot flavor. The installation automatically creates directory and binary in /var/www/bin/mini_sendmail . So let it be there.

Next is to add this line in /var/www/conf/php.ini
sendmail_path = "/bin/mini_sendmail -t -i"

after that do this

# cp -p /bin/sh /var/www/bin/sh

and finally
cp /etc/resolv.conf /var/www/etc/resolv.conf

note: failing to copy the resolv.conf part get me going in circle for almost 62 hours.

There you go, you can mail() to your heart content. :)


Step 4 . using netPBM for gallery ( this is the mother of all cp's operation :) )

Nothing much else to do except for copying everything to make the chroot access all the needed library. Only netPBM procedures are explained here, because it does the job.

making directories:

mkdir -p /var/www/bin
mkdir -p /var/www/var/run
mkdir -p /var/www/usr/lib
mkdir -p /var/www/usr/libexec
mkdir -p /var/www/usr/local/bin
mkdir -p /var/www/usr/local/lib
mkdir -p /var/www/usr/local/lib/pkgconfig
mkdir -p /var/www/usr/local/include
mkdir -p /var/www/usr/local/include/libexif
mkdir -p /var/www/usr/local/include/libpng
mkdir -p /var/www/usr/local/share/netpbm
mkdir -p /var/www/usr/local/share/doc/png



#Copying library files
cp /usr/lib/libc.so.34.1 /var/www/usr/lib
cp /usr/lib/libm.so.2.0 /var/www/usr/lib
cp /usr/lib/libz.so.4.0 /var/www/usr/lib
cp /usr/libexec/ld.so /var/www/usr/libexec
cp /usr/local/lib/libjpeg.so.62.0 /var/www/usr/local/lib
cp /usr/local/lib/libpbm.so.1.0 /var/www/usr/local/lib
cp /usr/local/lib/libpgm.so.1.0 /var/www/usr/local/lib
cp /usr/local/lib/libpng.so.4.0 /var/www/usr/local/lib
cp /usr/local/lib/libpnm.so.1.0 /var/www/usr/local/lib
cp /usr/local/lib/libppm.so.1.0 /var/www/usr/local/lib
cp /usr/local/lib/libtiff.so.36.1 /var/www/usr/local/lib
cp /usr/local/lib/libbz2.so.10.2 /var/www/usr/local/lib
cp /usr/local/lib/libxml2.so.8.11 /var/www/usr/local/lib
cp /usr/local/lib/libiconv.so.4.0 /var/www/usr/local/lib
cp /usr/local/lib/libjasper.so.1.0 /var/www/usr/local/lib
cp /var/run/ld.so.hints /var/www/var/run

#Copying JPEG files
cd /var/www/usr/local/bin
cp /usr/local/bin/icc2ps .
cp /usr/local/bin/icclink .
cp /usr/local/bin/icctrans .
cp /usr/local/bin/jpegicc .
cp /usr/local/bin/tifficc .
cp /usr/local/bin/wtpt .
cd /var/www/usr/local/include
cp /usr/local/include/icc34.h .
cp /usr/local/include/lcms.h .
cd /var/www/usr/local/lib
cp /usr/local/lib/liblcms.a .
cp /usr/local/lib/liblcms.la .
cp /usr/local/lib/liblcms.so.1.12 .


#Copying libexif files
cd /var/www/usr/local/include/libexif
cp /usr/local/include/libexif/* .
cd /var/www/usr/local/lib
cp /usr/local/lib/libexif.a .
cp /usr/local/lib/libexif.la .
cp /usr/local/lib/libexif.so.8.0 .
cd /var/www/usr/local/lib/pkgconfig
cp /usr/local/lib/pkgconfig/libexif.pc .


#Copying mpeg-lib
cd /var/www/usr/local/include
cp /usr/local/include/mpeg.h .
cd /var/www/usr/local/lib
cp /usr/local/lib/libmpeg.a .
cp /usr/local/lib/libmpeg.so.13.1 .

#Copying netpbm files
cd /var/www/usr/local/bin
cp /usr/local/bin/*ppm* .
cp /usr/local/bin/*pnm* .
cp /usr/local/bin/*pgm* .
cp /usr/local/bin/*pbm* .
cp /usr/local/bin/*pam* .
cp /usr/local/bin/*pcd* .
cd /var/www/usr/local/include
cp /usr/local/include/pam.h .
cp /usr/local/include/pammap.h .
cp /usr/local/include/pbm.h .
cp /usr/local/include/pgm.h .
cp /usr/local/include/pm.h .
cp /usr/local/include/pm_config.h .
cp /usr/local/include/pm_shhopt.h .
cp /usr/local/include/pnm.h .
cp /usr/local/include/ppm.h .
cp /usr/local/include/ppmcmap.h .
cp /usr/local/include/ppmdraw.h .
cp /usr/local/include/ppmfloyd.h .
cd /var/www/usr/local/lib
cp /usr/local/lib/libpbm.a .
cp /usr/local/lib/libpgm.a .
cp /usr/local/lib/libpnm.a .
cp /usr/local/lib/libppm.a .
cp /usr/local/lib/libpbm.so.1.0 .
cp /usr/local/lib/libpgm.so.1.0 .
cp /usr/local/lib/libpnm.so.1.0 .
cp /usr/local/lib/libppm.so.1.0 .
cd /var/www/usr/local/share/netpbm
cp /usr/local/share/netpbm/* .


#Copying png files
cd /var/www/usr/local/bin
cp /usr/local/bin/libpng-config .
cd /var/www/usr/local/include/libpng
cp /usr/local/include/libpng/* .
cd /var/www/usr/local/share/doc/png
cp /usr/local/share/doc/png/* .
cd /var/www/usr/local/lib
cp /usr/local/lib/libpng.a .
cp /usr/local/lib/libpng.so.4.0 .

#Copying tiff files
cd /var/www/usr/local/bin
cp /usr/local/bin/fax2ps .
cp /usr/local/bin/*tiff* .
cp /usr/local/bin/pal2rgb .
cp /usr/local/bin/rgb2ycbcr .
cp /usr/local/bin/thumbnail .
cd /var/www/usr/local/include
cp /usr/local/include/*tiff* .
cd /var/www/usr/local/lib
cp /usr/local/lib/libtiff.a .
cp /usr/local/lib/libtiff.so.36.1 .


#jpegtran
cd /var/www/usr/local/bin
cp /usr/local/bin/jpegtran

At this point after you can test your netPBM existence via xoopsgallery admin interface.

In my case I have one problem when it complaint that "pnmtojpeg not availabe" , in which case i just go to the directory and do " cp ppmtojpeg pnmtojpeg .

Done!

Thats all folks, you should have your full blown XOOPS portal running on openBSD 3.6 by now.

Cheers!

buckrey.

*/

Login

Who's Online

337 user(s) are online (241 user(s) are browsing Support Forums)


Members: 0


Guests: 337


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits