mirror of
https://github.com/YunoHost-Apps/framagames_ynh.git
synced 2024-09-03 18:36:28 +02:00
Adjustments for framagames webapp
This commit is contained in:
parent
bc539cfe7c
commit
d870339fa3
5 changed files with 27 additions and 50 deletions
|
@ -1,5 +1,5 @@
|
|||
location PATHTOCHANGE {
|
||||
alias ALIASTOCHANGE;
|
||||
alias FOLDERTOCHANGE;
|
||||
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
|
|
|
@ -195,7 +195,7 @@ rlimit_core = 0
|
|||
; Chdir to this directory at the start.
|
||||
; Note: relative path can be used.
|
||||
; Default Value: current directory or / when chroot
|
||||
chdir = /var/www/FOLDERTOCHANGE
|
||||
chdir = /var/www/NAMETOCHANGE
|
||||
|
||||
; Redirect worker stdout and stderr into main error log. If not set, stdout and
|
||||
; stderr will be redirected to /dev/null according to FastCGI specs.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Retrieve arguments
|
||||
app=webapp_multi_inst
|
||||
app=framagames
|
||||
domain=$1
|
||||
path=$2
|
||||
is_public=$3
|
||||
|
@ -19,7 +19,7 @@ else
|
|||
path=${path%/}
|
||||
fi
|
||||
|
||||
final_path=/var/www/webapp\_multi/$domain/$sitename
|
||||
final_path=/var/www/$app
|
||||
|
||||
# Check domain/path availability
|
||||
sudo yunohost app checkurl $domain$path -a $app
|
||||
|
@ -32,31 +32,24 @@ sudo yunohost app setting $app final_path -v $final_path
|
|||
sudo yunohost app setting $app sitename -v $sitename
|
||||
|
||||
# Creation of folder
|
||||
#sudo rm -rf $final_path
|
||||
sudo rm -rf $final_path
|
||||
sudo mkdir -p $final_path
|
||||
|
||||
# Base site
|
||||
sed -i "s@DOMAINTOCHANGE@$domain@g" ../sources/index.html
|
||||
sed -i "s@SITETOCHANGE@$sitename@g" ../sources/index.html
|
||||
sudo cp ../sources/index.html $final_path/
|
||||
# Copy of sources
|
||||
sudo cp ../sources/* $final_path/
|
||||
|
||||
# Set permissions
|
||||
sudo chmod 775 /var/www/webapp\_multi
|
||||
sudo chmod 775 /var/www/webapp\_multi/$domain
|
||||
sudo chmod 775 -R $final_path
|
||||
sudo chown www-data:www-data /var/www/webapp\_multi
|
||||
sudo chown www-data:www-data /var/www/webapp\_multi/$domain
|
||||
sudo chown -hR www-data:www-data $final_path
|
||||
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
||||
sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf
|
||||
sed -i "s@NAMETOCHANGE@$domain\_$sitename@g" ../conf/nginx.conf
|
||||
sed -i "s@FOLDERTOCHANGE@$final_path/@g" ../conf/nginx.conf
|
||||
sed -i "s@NAMETOCHANGE@$sitename@g" ../conf/nginx.conf
|
||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$sitename.conf
|
||||
|
||||
sed -i "s@NAMETOCHANGE@$domain\_$sitename@g" ../conf/php-fpm.conf
|
||||
sed -i "s@FOLDERTOCHANGE@webapp\_multi/$domain/$sitename@g" ../conf/php-fpm.conf
|
||||
finalphpconf=/etc/php5/fpm/pool.d/$domain\_$sitename.conf
|
||||
sed -i "s@NAMETOCHANGE@$sitename@g" ../conf/php-fpm.conf
|
||||
finalphpconf=/etc/php5/fpm/pool.d/$app.conf
|
||||
sudo cp ../conf/php-fpm.conf $finalphpconf
|
||||
sudo chown root: $finalphpconf
|
||||
sudo chmod 644 $finalphpconf
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
app=webapp_multi_inst
|
||||
app=framagames
|
||||
|
||||
#user=$(sudo yunohost app setting $app user)
|
||||
path=$(sudo yunohost app setting $app path)
|
||||
|
@ -14,18 +14,8 @@ sudo rm -rf $final_path
|
|||
|
||||
# Suppression de la config nginx de la webapp
|
||||
sudo rm -f /etc/nginx/conf.d/$domain.d/$sitename.conf
|
||||
sudo rm -f /etc/php5/fpm/pool.d/$domain\_$sitename.conf
|
||||
|
||||
# We check if folders are empty and if yes we delete them
|
||||
if test -z "$(ls /var/www/webapp_multi/$domain | head -n1)"
|
||||
then
|
||||
sudo rmdir /var/www/webapp_multi/$domain
|
||||
fi
|
||||
|
||||
if test -z "$(ls /var/www/webapp_multi/ | head -n1)"
|
||||
then
|
||||
sudo rmdir /var/www/webapp_multi
|
||||
fi
|
||||
sudo rm -f /etc/php5/fpm/pool.d/$app.conf
|
||||
sudo rm -rf /var/www/$app/
|
||||
|
||||
sudo service php5-fpm restart
|
||||
sudo service nginx reload
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Retrieve arguments
|
||||
app=webapp_multi_inst
|
||||
app=framagames
|
||||
|
||||
#domain=$(sudo yunohost app setting $app domain)
|
||||
path=$(sudo yunohost app setting $app path)
|
||||
|
@ -10,32 +10,26 @@ sitename=$(sudo yunohost app setting $app sitename)
|
|||
is_public=$(sudo yunohost app setting $app is_public)
|
||||
final_path=$(sudo yunohost app setting $app final_path)
|
||||
|
||||
|
||||
#netftp_path=/ftp_webapp_$user
|
||||
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
||||
sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf
|
||||
sed -i "s@NAMETOCHANGE@$domain\_$sitename@g" ../conf/nginx.conf
|
||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$name.conf
|
||||
sed -i "s@FOLDERTOCHANGE@$final_path/@g" ../conf/nginx.conf
|
||||
sed -i "s@NAMETOCHANGE@$sitename@g" ../conf/nginx.conf
|
||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$sitename.conf
|
||||
|
||||
|
||||
# php5-fpm configuration
|
||||
sed -i "s@NAMETOCHANGE@$domain\_$sitename@g" ../conf/php-fpm.conf
|
||||
sed -i "s@FOLDERTOCHANGE@webapp_multi\_$domain/$sitename@g" ../conf/php-fpm.conf
|
||||
|
||||
finalphpconf=/etc/php5/fpm/pool.d/$domain\_$sitename.conf
|
||||
sed -i "s@NAMETOCHANGE@$sitename@g" ../conf/php-fpm.conf
|
||||
finalphpconf=/etc/php5/fpm/pool.d/$app.conf
|
||||
sudo cp ../conf/php-fpm.conf $finalphpconf
|
||||
sudo chown root: $finalphpconf
|
||||
sudo chmod 644 $finalphpconf
|
||||
|
||||
# We copy sources again
|
||||
rm -rf /var/www/$app
|
||||
mkdir -p /var/www/$app
|
||||
cp -a ../sources/* /var/www/$app
|
||||
|
||||
# We adjust permissions
|
||||
sudo chmod 775 /var/www/webapp\_multi
|
||||
sudo chmod 775 /var/www/webapp\_multi/$domain
|
||||
sudo chmod 775 -R $final_path
|
||||
sudo chown www-data:www-data /var/www/webapp\_multi
|
||||
sudo chown www-data:www-data /var/www/webapp\_multi/$domain
|
||||
sudo chown -hR www-data:www-data $final_path
|
||||
sudo chmod 775 -R /var/www/$app
|
||||
sudo chown -hR www-data:www-data /var/www/$app
|
||||
|
||||
# Make app public if necessary
|
||||
sudo yunohost app setting $app is_public -v "$is_public"
|
||||
|
|
Loading…
Add table
Reference in a new issue