Version 1 (modified by ibaldin, 7 years ago)


Building FOAM

Building FOAM on CentOS 6.2

$ sudo yum install nginx 
$ sudo easy_install pip
$ sudo useradd -c "FOAM user" -M -N -g users www-data
$ cd onlab-foam-xxxx
$ sudo python 

# if dependency tracking by pip fails as part of FOAM install, can be installed manually:
$ sudo easy_install "Flask==0.7.2"
$ sudo easy_install "SQLAlchemy==0.7.4"
$ sudo easy_install Flask-XML-RPC
$ sudo easy_install "Blinker==1.1"
$ sudo easu_install lxml
#ElementTree 1.2.7 has to be installed from source
#unzip, then sudo python install
#Flup can be installed by easy_install via egg

# continuing after foam install (note: Installs under /opt/foam)

# FOAM install fails to install M2Crypto, could not get it from EPEL
# and easy_install fails due to differences in openssl-devel configuration
# so get the source, untar and run ./ install from within 
# the tar file:
$ chmod +x
$ ./ install

# change the permissions on the /opt/foam///
# note that FOAM uses www-data user under Debian (which is what nginx runs under)
# however on CentOS nginx runs under user nginx
$ sudo chown -R nginx /opt/foam

# configure foam
$sudo -u nginx foamctl init-db
# Note that foamctl is installed under /usr/bin

# sets the admin httppassword for foam
$ sudo foamctl set-password

# create a self-signed cert for foam and configure /etc/nginx/sites-available/foam.conf
# the default fails to do that

$ cd /etc/nginx/conf
$ ln -s ../sites-available/foam.conf

# download and bundle certs
$ sudo wget -O /opt/foam/etc/gcf-ca-certs/
$ sudo foamctl bundle-certs

# start NGINX
$ /etc/init.d/nginx restart

# start FOAM (needs a custom start script because CentOS does not have start-stop-daemon which can put foam in the background; default centos daemon() function does not have the background option)
$ /etc/init.d/foam start

# standard /etc/init.d/foam is written for Ubuntu/Debian and does not work on CentOS