Greetings - I’m finally getting around to moving from Nethserver 7 to Nethserver 8, and am trying to set up Ampache. There area a few things I can’t work out.
Ampache recmmends using composer - but I can’t see how to run php from the command line.
Ampache also needs the document root to be set to a folder called ‘public’. I’ve tried putting configuration settings into the vhost.custom file in the /home/webserver1/.config/state/conf.d directory, but whatever I put in there causes both my vhosts to return ‘bad gateway’. If I try removing the configuration, I get 404 not found. The only way to get back to the working configuration is to go to the web admin page and save the settings for the vhost.
What do I need in the custom configuration file to change the root directory, and whats the best way to reload the configuration for the vhosts?
server {
location / {
root /usr/share/nginx/html/9002;
index index.html index.htm index.php;
autoindex on;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html/9002;
}
location ~ \.php$ {
root /usr/share/nginx/html/9002;
try_files $uri =404;
fastcgi_pass 127.0.0.1:9002;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /app/9002$fastcgi_script_name;
}
}
And various variations. I see today
[1:webserver1:nginx] nginx: [emerg] duplicate location "/" in /etc/nginx/conf.d/dyn-9002.conf:8
in the logs.
using
systemctl restart --user --now webserver.service
to restart the webserver. Just deleted the .custom config file, restarted, and get a 404 error for the vhost. Saving the vhost configuration in the web console fixes it.