iFolder on Debian Lenny (as xen DomU)

NOTE 1: An alternative to compiling it yourself (which is not as straightforward as you might think) is to download a pre-built image for xen/vmware or others from here

SHOUTOUT: Where is apt-get install ifolder (a working one!) for lenny?

    HowTo Not Yet Complete!

HowTo Adapted from here
These are notes I took while installing iFolder on a Lenny (64 bit) xen image.
I take no rsponsibility if they damage your system.
modify 64 bit specific packages for 32 bit system if needed
Most packages are 32 bit I think

Set a root password first
passwd root

The next lines are relating a pty/pts problem I receive on my Lenny Domu for some reason.
This fixes it for me.

Make a file called S99pty in /etc/rc2.d/
vi /etc/rc2.d/S99pty

Add the following lines (excluding the = signs!)

=======
#!/bin/sh
mkdir /dev/pts
mount -t devpts /dev/ptmx /dev/pts

=======

Make file executable, restart and login through ssh to the box
chmod a+x /etc/rc2.d/S99pty; reboot

Install screen, so you can multitask on one window (not necessary for iFolder!)
apt-get install screen; screen -S install

make sure openssh-server is there and denyhosts might save your ass for ssh bruteforcing
apt-get install openssh-server denyhosts

Configure denyhosts as appropriate
vi /etc/denyhosts.conf

Maybe put the root login attempts from 1 to 5 (to make it more user-friendly)
And enable sync servers down at the bottom
There are more resources about Denyhosts on the web, Google is your friend.

Install som base packages (not all needed for iFolder, but they won’t harm you)
apt-get update; apt-get upgrade; apt-get update; apt-get install unzip gcc g++ libc6 libc6-dev make mailx

Install iFolder Specific stuff here
apt-get install mono-mcs automake autogen pkg-config libglib2.0-0 automake1.9 libstdc++6 libncurses5-dev uuid-dev apache2 apache2-dev libxml2 libxml2-dev libncurses5-dev

if on 64 bit
apt-get install libc6-dev-amd64
otherwise (not tested)
apt-get install libc6-dev

Install Mono

Add/Enable Backports in /etc/apt/sources.list
deb http://www.backports.org/debian lenny-backports main

aptitude update
aptitude -t lenny-backports install mono-devel

You might get a warning, You should be ok skipping it

Verify Mono is installed

which mono
/usr/bin/mono

ifolder:/etc# mono --version
Mono JIT compiler version 2.4.2.3 (Debian 2.4.2.3+dfsg-2~bpo50+1)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
ifolder:/etc#

^^^ The is what I got on mine after running
which mono
mono --version

Install libflaim and Log4Net

Go home, make src folder and go in it

ifolder:/# cd ~
ifolder:~# mkdir src
ifolder:~# cd src
ifolder:~/src#

Get libflaim from here (http://forgeftp.novell.com/ifolder/required/libflaim/SUSE10-i386/src/)

ifolder:~/src# wget

Unpack
ifolder:~/src# tar -xzvf libflaim-4.8.0.tar.gz
ifolder:~/src# cd libflaim-4.8.0

Now edit the Makefile and comment out the line -funit-at-a-time (I could not get this work with g++). Then build and install libflaim:

Look for this in the Makefile
# Compiler definitions and flags^M
^M
ccflags =-Wno-write-strings^M
ccdefs =^M

and modify ~ line 376
ccflags =^M
to this
ccflags =-Wno-write-strings^M

the ^M are just carriage returns(or some windows stuff?), leave them there…

~ line 476 (not sure about this)
from
ccflags += -Wall -Werror -fPIC^M
to
ccflags += -Wall -fPIC

RUN THIS
You might get a lot of errors on both…
just ignore (no idea how to fix this)

make OSTYPE=Linux HOSTTYPE=i386 all
make OSTYPE=Linux HOSTTYPE=i386 install

Installing libflaim and Log4Net from RPMs
Since there are no debian package of libflaim and log4net on the net (or at least I couldn’t find some), I used the rpm packages which came with some of the iFolder source tarballs.
To use them, you need to convert them to debian packages. To do so you need the debian tool alien. You can install it like this:

apt-get install alien
cd ~/src

LIBFAIM FOLLOWS:

wget http://forgeftp.novell.com/ifolder/server/3.5/20060621-0346/linux/SUSE10.0-i586/RPMS/i586/libflaim-4.8.61-1.i586.rpm
wget http://forgeftp.novell.com/ifolder/server/3.5/20060621-0346/linux/SUSE10.0-i586/RPMS/i586/libflaim-devel-4.8.61-1.i586.rpm

alien libflaim-4.8.61-1.i586.rpm
alien libflaim-devel-4.8.61-1.i586.rpm
dpkg -i libflaim*.deb

Log4NET FOLLOWS

wget http://forgeftp.novell.com/ifolder/server/3.5/20060621-0346/linux/SUSE10.0-i586/RPMS/i586/log4net-1.2.9-4.i586.rpm
alien log4net-1.2.9-4.i586.rpm
dpkg -i log4net*.deb

If you followed my instructions and installed mono in the defuault path then you do NOT need the following 2 commands

ln -s /usr/lib/mono/log4net /opt/mono/bin/lib/mono/log4net
ln -s /usr/lib/mono/gac/log4net /opt/mono/bin/lib/mono/gac/log4net

iFolder, Finally!

Get the latest like this
wget https://forgesvn1.novell.com/viewsvn/simias/trunk.tar.gz?view=tar&pathrev=6562

or like this
wget --no-check-certificate https://forgesvn1.novell.com/viewsvn/simias/trunk.tar.gz?view=tar&pathrev=6562
if you get a certificate problem (you might!)

Size aprox for me: ~18.6 MBytes

NOTE: if you get a file like follows:
trunk.tar.gz?view=tar
and is larger (considerably than 19 MB, then something is wrong.
Try manually downloading it (Firefox for example),
and upload it to server in ~/src/ directory
WinSCP to upload files from windows box to Linux box is good enough

Extract files
ifolder:~/src# tar -xzvf trunk.tar.gz
ifolder:~/src# cd trunk/simias/

Edit the file configure.in and change the line 105 from
CSCFLAGS='/d:MONO /warn:4 /d:TRACE'
to
CSCFLAGS='/d:MONO /d:MONONATIVE /warn:4 /d:TRACE'

apt-get install autoconf autotools-dev libtool checkinstall liblog4net1.2-cil libmono-accessibility1.0-cil libmono-ldap1.0-cil libmono-sharpzip0.84-cil libmono-winforms1.0-cil libmono1.0-cil libossp-uuid15 libxcursor1 libxfixes3 mono-xsp mono-xsp-base uuid

Run
export PKG_CONFIG_PATH="/usr/share/pkgconfig"
chmod a+x autogen.sh
./autogen.sh --prefix=/opt/ifolder --with-simiasdatadir=/srv/ifolder/simias

============= OK To HERE
============= Make breaks for me… In the process of fixing it…

make

Before we can install the iFolder server, we need to fix a bug (which btw. seems to be fixed in revision 6638):

> cd src/server/
> rm simias-server
> make simias-server
> cd -

(It’s safe to ignore the warnings that pop up.) Now we can install the iFolder server:

> make install
[
ADD FLAIM WRAPPER TO LD LIST
cat > /etc/ld.so.conf.d/flaimwrapper.conf
/opt/ifolder/lib/
]
[
LINK ASSEMBLIES AS NEEDED
cd /opt/ifolder/lib/simias/admin/bin
ln -s ../../web/bin/SimiasLib.dll
cd ../../webaccess/bin/
ln -s ../../web/bin/SimiasLib.dll
]
> ldconfig (needed to make libflaim work)

Note:

* You must not relocate the the sysconfdir (using –sysconfdir=). It must stay in [PREFIX]/etc. Otherwise the simias-server-setup script won’t work.
* The simiasdatadir (using –with-simiasdatadir=) must end with /simias. Otherwise the simias-server-setup script won’t work.

[edit]
Configuration Instructions

Now that iFolder is installed we can configure it.
[edit]
Create basic configuration

iFolder comes with a handy tool called simias-server-setup that creates all necessary configuration files for you. You can start it with following command:

> /opt/ifolder/bin/simias-server-setup

Now you have to input some information:

Server’s Data Path: /srv/ifolder
Server Name: ifolder
Public URL: http:///simias10
Private URL: http:///simias10
Slave Server: N
System Name:
System Description:

Use LDAP: N
System Admin: admin
Admin Password:
Configure Apache: N

Now the setup should have created the directory /srv/ifolder/simias along with some files. Make sure that they are accessible by the user used by the apache httpd server (usally this is www-data):

> chown -R www-data /srv/ifolder

The last step is to create a directory that is (somehow) used by mono. Without this directory the server won’t run correctly (you need also make sure that this directory is accessible by the apache user):

[GET THE APACHE FOLDER FROM /etc/passwd]

> mkdir /.config
> chown -R www-data /.config

Note:

* The value for Server’s Data Path must be the same that was given to the iFolder configure script but without the trailing /simias. Otherwise the simias-server-setup script won’t work.
* Don’t follow the instruction to start the server with /opt/ifolder/bin/ifolder which pops up. We won’t need this command. No, don’t start! ;) You have been warned.

[edit]
Configure Apache

I’m using a virtual host for my iFolder server. So the next code snippet will setup the iFolder server inside a virtual host.

Insert somehow the following code snippet in your apache configuration file (usally in /etc/apache2/httpd.conf). This will start the simias server when apache starts:

# This file is installed by mod_mono.
Include conf/mod_mono.conf


ServerName :80

Redirect / http://ifolder.mayastudios.de/ifolder

#
# Allow access to the ifolder directory.
#

Order allow,deny
Allow from all

#
# Configure admin web panel
#
Alias /admin “/opt/ifolder/lib/simias/admin”
AddMonoApplications admin “/admin:/opt/ifolder/lib/simias/admin”
MonoSetEnv admin “SimiasUrl=http:///simias10;SimiasLogDir=/srv/ifolder/simias/log”

MonoSetServerAlias admin
Order allow,deny
Allow from all
AddHandler mono asax aspx ascx asmx ashx
DirectoryIndex Default.aspx index.html

#
# Configure user web panel
#
Alias /ifolder “/opt/ifolder/lib/simias/webaccess”
AddMonoApplications ifolder “/ifolder:/opt/ifolder/lib/simias/webaccess”
MonoSetEnv ifolder “SimiasUrl=http:///simias10;SimiasLogDir=/srv/ifolder/simias/log”

MonoSetServerAlias ifolder
Order allow,deny
Allow from all
AddHandler mono asax aspx ascx asmx ashx
DirectoryIndex Default.aspx index.html

#
# Configure backend for clients
#
Alias /simias10 “/opt/ifolder/lib/simias/web”
AddMonoApplications simias10 “/simias10:/opt/ifolder/lib/simias/web”
MonoSetEnv simias10 “SimiasRunAsServer=true;SimiasDataPath=/srv/ifolder/simias”

MonoSetServerAlias simias10
Order allow,deny
Allow from all
SetHandler mono

You need to replace every with your server address, for example ifolder.yourserver.com. This address must be the same as given in the simias-server-setup script (public and private URL).
[edit]
Now to see if it works

Start up (or restart) your apache web server and check that simias is running:

> /etc/init.d/apache2 start
> ps ax | grep simias

You should get something like:

2372 ? Ss 0:38 /opt/mono/bin/bin/mono /opt/mono/bin/lib/mono/1.0/mod-mono-server.exe –filename /tmp/mod_mono_server_simias10 –applications /simias10:/opt/ifolder/lib/simias/web –nonstop

Next check the web interface. Go to http:///admin and log in as admin with the password given to the simias-server-setup script.

Then create a user, go to http:// and log in as that user.
[edit]
Clients

The iFolder server 3.5 revision 6562 works great with 3.4 clients, especially:

* On Windows: Version 3.4.6167.1 (http://forgeftp.novell.com/ifolder/client/3.4/20060616-0101/win/ifolder3-3.4.6167.1-1-setup.exe) (2006-06-16)
* On Linux: ???
* On MacOSX: ???

[edit]
Troubleshooting

See the other HowTos for troubleshooting ideas if something doesn’t work.

But before you do so:

1. stop the apache web server (/etc/init.d/apache2 stop)
2. wait a few seconds
3. kill every remaining process you get by executing ps ax | grep simias
4. wait a few seconds again
5. start the apache web server again

[edit]
Known issues
[edit]
Flaim error FERR_FILE_EXISTS

If you go to http:///simias10, login for example as admin and you get the following error:

Simias.CreateException: Failed to create Flaim DB. —> Simias.SimiasException:
Flaim error FERR_FILE_EXISTS

then the reason may be that the directory /srv/ifolder/simias isn’t writeable to the apache web server.
Retrieved from “http://www.ifolder.com/index.php/HowTo:_Building_iFolder_Server_On_Debian_Sarge”

Discussion Area - Leave a Comment