1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00

add dedicated pool for php-fpm

This commit is contained in:
src386 2015-08-21 17:45:36 +02:00
parent c44b6e40b9
commit f590cc1861
3 changed files with 33 additions and 13 deletions

View file

@ -16,7 +16,7 @@ Current Movim version : 20150820.
- Public/Private policy changed. The SSO portal is not used anymore
But when a pod is marked as "private", only accounts with @yourdomain.com are able to connect.
This change was necessary for public content (blog)
- Revert to www-data system user
- Add dedicated php-fpm pool for Movim
0.7b 2015-08-20
- Update to upstream Movim 20150820 to fix #5

16
conf/php-fpm.conf Normal file
View file

@ -0,0 +1,16 @@
[movim]
listen = /var/run/php5-fpm-movim.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0600
user = movim
group = movim
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chroot = /var/www/movim
;chdir = /var/www/movim
php_admin_value[open_basedir] = none

View file

@ -57,27 +57,28 @@ sudo cp -a ../sources/* $final_path
sudo cp $final_path/config/db.example.inc.php $final_path/config/db.inc.php
# Create movim system user and set permissions
sudo chown -R www-data: $final_path
sudo useradd -d /var/www/movim -s /bin/sh movim
sudo chown -R movim: $final_path
sudo chmod -R 750 $final_path
# Install PHP dependencies
sudo su -c "curl -sS https://getcomposer.org/installer | php -- --install-dir=$final_path" -s /bin/sh www-data
sudo su -c "cd $final_path && php composer.phar install" -s /bin/sh www-data
sudo su -c "curl -sS https://getcomposer.org/installer | php -- --install-dir=$final_path" movim
sudo su -c "cd $final_path && php composer.phar install" movim
# Movim configuration
sudo sed -i "s@'username' => 'username'@'username' => '$db_user'@g" $final_path/config/db.inc.php
sudo sed -i "s@'password' => 'password'@'password' => '$db_pwd'@g" $final_path/config/db.inc.php
sudo sed -i "s@/ws/@$path/ws/@g" $final_path/app/assets/js/movim_websocket.js
sudo su -c "cd $final_path && php mud.php db set" -s /bin/sh www-data
sudo su -c "cd $final_path && php mud.php config locale:$language" -s /bin/sh www-data
sudo su -c "cd $final_path && php mud.php config loglevel:1" -s /bin/sh www-data
sudo su -c "cd $final_path && php mud.php config environment:production" -s /bin/sh www-data
sudo su -c "cd $final_path && php mud.php config timezone:`cat /etc/timezone`" -s /bin/sh www-data
sudo su -c "cd $final_path && php mud.php config username:$admin" -s /bin/sh www-data
sudo su -c "cd $final_path && php mud.php config password:`echo -n $password | sha1sum | awk '{print $1}'`" -s /bin/sh www-data
sudo su -c "cd $final_path && php mud.php db set" movim
sudo su -c "cd $final_path && php mud.php config locale:$language" movim
sudo su -c "cd $final_path && php mud.php config loglevel:1" movim
sudo su -c "cd $final_path && php mud.php config environment:production" movim
sudo su -c "cd $final_path && php mud.php config timezone:`cat /etc/timezone`" movim
sudo su -c "cd $final_path && php mud.php config username:$admin" movim
sudo su -c "cd $final_path && php mud.php config password:`echo -n $password | sha1sum | awk '{print $1}'`" movim
if [ $public_site = "No" ];
then
sudo su -c "cd $final_path && php mud.php config xmppwhitelist:$domain" -s /bin/sh www-data
sudo su -c "cd $final_path && php mud.php config xmppwhitelist:$domain" movim
fi
sudo yunohost app addaccess movim -u $admin
@ -98,6 +99,9 @@ else
sudo /etc/init.d/movim start
fi
# php-fpm configuration
sudo cp ../conf/php-fpm.conf /etc/php5/fpm/pool.d/movim.conf
# Nginx configuration
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf
@ -110,5 +114,5 @@ sudo yunohost app setting movim skipped_uris -v "/"
sudo yunohost app ssowatconf
# Start Movim
sudo service nginx reload
sudo service php5-fpm restart
sudo service nginx reload