mirror of
https://github.com/YunoHost-Apps/linuxdash_ynh.git
synced 2024-09-03 19:36:07 +02:00
Launch Linux-dash with python server.\n - Using proxy_pass nginx configuration.\n - Use supervisor package to daemonize Linux-Dash.
This commit is contained in:
parent
f5d9fdb582
commit
ae7f617c2a
4 changed files with 23 additions and 23 deletions
|
@ -1,21 +1,6 @@
|
|||
location YNH_WWW_PATH {
|
||||
alias YNH_WWW_ALIAS ;
|
||||
|
||||
# Force https
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
|
||||
index index.html index.htm index.php;
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
fastcgi_param REMOTE_USER $remote_user;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
}
|
||||
|
||||
# Include SSOWAT user panel.
|
||||
include conf.d/yunohost_panel.conf.inc;
|
||||
location YNH_WWW_PATH/ {
|
||||
rewrite ^YNH_WWW_PATH$ YNH_WWW_PATH/ permanent;
|
||||
proxy_pass http://localhost:8081/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_buffering off;
|
||||
}
|
||||
|
|
5
conf/supervisor.conf
Normal file
5
conf/supervisor.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
[program:linuxdash]
|
||||
directory=/var/www/linuxdash/
|
||||
command=python python-server.py
|
||||
autostart=true
|
||||
autorestart=true
|
|
@ -20,9 +20,14 @@ sudo cp -a ../sources/* $final_path
|
|||
# Set permissions
|
||||
sudo chown -R www-data: $final_path
|
||||
|
||||
# Set as a service with supervisor
|
||||
sudo apt-get -y -qq install supervisor
|
||||
sudo cp ../conf/supervisor.conf /etc/supervisor/conf.d/$app.conf
|
||||
sudo supervisorctl update
|
||||
sudo supervisorctl restart $app
|
||||
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf
|
||||
sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf
|
||||
nginxconf=/etc/nginx/conf.d/$domain.d/$app.conf
|
||||
sudo cp ../conf/nginx.conf $nginxconf
|
||||
sudo chown root: $nginxconf
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
app=linuxdash
|
||||
domain=$(sudo yunohost app setting linuxdash domain)
|
||||
|
||||
# Remove sources and nginx configuration
|
||||
sudo rm -rf /var/www/linuxdash
|
||||
sudo rm -f /etc/nginx/conf.d/$domain.d/linuxdash.conf
|
||||
sudo rm -rf /var/www/$app
|
||||
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
||||
# Remove service
|
||||
sudo supervisorctl stop $app
|
||||
sudo rm -f /etc/supervisor/conf.d/$app.conf
|
||||
|
||||
# Reload nginx configuration
|
||||
sudo service nginx reload
|
||||
|
|
Loading…
Add table
Reference in a new issue