# How to setup FengOffice collaboration platform over Nginx

**URL:** <https://www.ruby-forum.com/t/how-to-setup-fengoffice-collaboration-platform-over-nginx/208187>\
**Category:** NGINX\
**Created:** [June 11, 2011, 6:20pm UTC](https://www.ruby-forum.com/t/how-to-setup-fengoffice-collaboration-platform-over-nginx/208187 "2011-06-11T18:20:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [June 11, 2011, 6:20pm UTC](https://www.ruby-forum.com/t/how-to-setup-fengoffice-collaboration-platform-over-nginx/208187/1 "2011-06-11T18:20:35Z")

</div>

How to setup FengOffice collaboration platform over Nginx.

Any suggestions on how to improve the bellow described procedure are  
greatly appreciated.

Than you,

M.

Feng Office \< [http://www.fengoffice.com/](http://www.fengoffice.com/) \>, previously known as OpenGoo,  
is an open source collaboration platform (much like a Google Apps  
platform that you may install and maintain in your own web or  
local server).

I will show how we have set Feng Office in an Ubuntu 10.10 server +  
Nginx. I will assume that you already have a properly setup Nginx 1.0.x  
with all the ancillary paraphernalia of your choice (including php-fpm,  
ssl certificates, a dns or /etc/hosts pointing to feng.localhost, etc.)

# put code in place

wget  
[http://sourceforge.net/projects/opengoo/files/fengoffice/fengoffice\_1.7.5.rc3/fengoffice\_1.7.5rc3.zip/download](http://sourceforge.net/projects/opengoo/files/fengoffice/fengoffice_1.7.5.rc3/fengoffice_1.7.5rc3.zip/download)  
unzip fengoffice\_1.7.5rc3.zip  
sudo mv fengoffice/ /home/fengoffice\_1.7.5rc3/  
(cd /home/;sudo ln -svfn fengoffice\_1.7.5rc3 fengoffice)

# create the feng\_db database in MySQL

echo “create database feng\_db” | mysql -u root -p  
echo “create user ‘feng\_user’@‘localhost’ identified by  
‘feng\_user\_password’” | mysql -u root -p  
echo “grant all on feng\_db.\* to ‘feng\_user’@‘localhost’” | mysql -u  
root -p  
echo “flush privileges;use feng\_db;show grants for  
‘feng\_user’@‘localhost’;flush privileges;” | mysql -u root -p

# change permissions to make it more secure

sudo chown -R $USER.www-data /home/fengoffice/  
find /home/fengoffice/ -type d -exec chmod 0750 {} ;  
(for i in cache config tmp upload; do sudo chmod  
0770 /home/fengoffice/$i; done)  
find /home/fengoffice/ -type f -exec chmod 0640 {} ;  
find /home/fengoffice/ -type f -iname "_.txt" -exec chmod 0600 {} ;  
chmod g+r /home/fengoffice/robots.txt  
sudo ln -svfn /home/fengoffice /var/www/fengoffice  
ls -ld /home/feng_ /var/www/feng\*

# create a nginx conf file like this

# nginx - /etc/nginx/sites-available/feng

# 

server {  
listen 80;  
server\_name feng.localhost;

# redirect to secure https page

rewrite ^ https://feng.localhost$request\_uri? permanent;  
}  
server {  
#listen 80;  
listen 443 ssl;  
server\_name feng.localhost;  
access\_log /var/log/nginx/feng.access.log;  
error\_log /var/log/nginx/feng.error.log;  
root /var/www/fengoffice;  
index index.php;

ssl\_certificate /etc/ssl/certs/excom-web.crt;  
ssl\_certificate\_key /etc/ssl/private/excom-web.key;

# gzipping SSL encrypted data is a waste of time

#gzip off;

location ~ ^(?.+.php) {  
include /etc/nginx/fastcgi\_params;  
fastcgi\_pass unix:/tmp/php-fpm.socket;  
fastcgi\_index index.php;  
fastcgi\_param SCRIPT\_FILENAME  
$document\_root$fastcgi\_script\_name; fastcgi\_param HTTPS on;  
}  
}  
############

sudo ln -svf /etc/nginx/sites-available/feng /etc/nginx/sites-enabled/  
sudo nginx -s reload  
sudo /usr/sbin/nginx -t && /etc/init.d/nginx status

# enable writing in the config.php file & set php memory to at least 10M

chmod g+w /home/fengoffice/config/config.php  
sudo sed -i ‘/^memory\_limit/s/[0-9]+M/64M/’ /etc/php5/fpm/php.ini

# run feng’s own setup from:

[http://feng.localhost/public/install](http://feng.localhost/public/install)

# When done with feng’s setup, enable https & protect config.php

sed -i ‘/ROOT\_URL/s/http:/https:/’ /home/fengoffice/config/config.php  
chmod g-w /home/fengoffice/config/config.php

## procedure ends

# You may also enable the following open-source libraries and

applications to work with Feng Office:  
ActiveCollab 0.7.1: [www.activecollab.com](http://www.activecollab.com)  
ExtJs: [www.extjs.com](http://www.extjs.com)  
Reece Calendar: [Reece Calendar download | SourceForge.net](http://sourceforge.net/projects/reececalendar)  
Swift Mailer: [www.swiftmailer.org](http://www.swiftmailer.org)  
Open Flash Chart: [Open Flash Chart – Teeth Grinder UK](http://teethgrinder.co.uk/open-flash-chart)  
Slimey: [slimey.sourceforge.net](http://slimey.sourceforge.net)  
FCKEditor: [www.fckeditor.net](http://www.fckeditor.net)  
JSSoundKit: [jssoundkit.sourceforge.net](http://jssoundkit.sourceforge.net)  
PEAR: [pear.php.net](http://pear.php.net)
