diff --git a/conf/gunicorn.service b/conf/gunicorn.service index 65206c2..5a2afad 100644 --- a/conf/gunicorn.service +++ b/conf/gunicorn.service @@ -6,8 +6,8 @@ After=network.target PIDFile=/run/gunicorn/YNH_APP_INSTANCE_NAME-pid User=YNH_APP_INSTANCE_NAME Group=www-data -WorkingDirectory=/opt/YNH_APP_INSTANCE_NAME -ExecStart=/opt/YNH_APP_INSTANCE_NAME/venv/bin/gunicorn -c /opt/YNH_APP_INSTANCE_NAME/gunicorn_config.py YNH_APP_INSTANCE_NAME.wsgi +WorkingDirectory=/var/www/YNH_APP_INSTANCE_NAME +ExecStart=/var/www/YNH_APP_INSTANCE_NAME/venv/bin/gunicorn -c /var/www/YNH_APP_INSTANCE_NAME/gunicorn_config.py YNH_APP_INSTANCE_NAME.wsgi ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s TERM $MAINPID PrivateTmp=true diff --git a/conf/gunicorn_config.py b/conf/gunicorn_config.py index 7e6c034..dd3d075 100644 --- a/conf/gunicorn_config.py +++ b/conf/gunicorn_config.py @@ -1,8 +1,8 @@ -command = '/opt/__YNH_APP_INSTANCE_NAME__/venv/bin/gunicorn' -pythonpath = '/opt/__YNH_APP_INSTANCE_NAME__' +command = '/var/www/__YNH_APP_INSTANCE_NAME__/venv/bin/gunicorn' +pythonpath = '/var/www/__YNH_APP_INSTANCE_NAME__' workers = 4 user = '__YNH_APP_INSTANCE_NAME__' -bind = 'unix:/opt/__YNH_APP_INSTANCE_NAME__/sock' +bind = 'unix:/var/www/__YNH_APP_INSTANCE_NAME__/sock' pid = '/run/gunicorn/__YNH_APP_INSTANCE_NAME__-pid' errorlog = '/var/log/__YNH_APP_INSTANCE_NAME__/error.log' accesslog = '/var/log/__YNH_APP_INSTANCE_NAME__/access.log' diff --git a/conf/nginx.conf b/conf/nginx.conf index 36fa9f3..185a8c1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,19 +7,19 @@ location __PATH__/ { } location __PATH__/protected/ { internal; - alias /opt/__NAME__/__NAME__/smedia/; + alias /var/www/__NAME__/__NAME__/smedia/; } location __PATH__/media { - alias /opt/__NAME__/media; + alias /var/www/__NAME__/media; } location __PATH__/static { - alias /opt/__NAME__/static; + alias /var/www/__NAME__/static; } location __PATH__/assets { - alias /opt/__NAME__/static; + alias /var/www/__NAME__/static; } location @__NAME__ { @@ -27,5 +27,5 @@ location @__NAME__ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass http://unix:/opt/__NAME__/sock; + proxy_pass http://unix:/var/www/__NAME__/sock; } diff --git a/scripts/install b/scripts/install index f5d9c99..e5936b3 100644 --- a/scripts/install +++ b/scripts/install @@ -35,7 +35,7 @@ export secret=$(ynh_string_random 24) #================================================= ynh_script_progression --message="Validating installation parameters..." -export final_path=/opt/$app +export final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Register (book) web path diff --git a/scripts/upgrade b/scripts/upgrade index 2e09bd0..9592dd8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -63,7 +63,7 @@ fi # If final_path doesn't exist, create it if [ -z "$final_path" ]; then - final_path=/opt/$app + final_path=/var/www/$app ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi