nginxraspberry-pilibgphoto2

'[crit]' 398#398: *45 error - loading jpg from gphotofs mounted file system


Background: Busy with a project with the goal of serving jpg from a nikon d750 camera with nginx. Physical key -> GPIO RPI -> Callback -> websocket -> client -> show jpg from: gphotofs mounted file system.

Everything works fine as long as I don't try to load from the mounted file system, if I do I get the error:

[crit] 398#398: *45 stat() nginx

The mounted directory is: /var/www/html/mount/ [store_00020001/DCIM/110D7100] I can see all the files, so its properly mounted.

I tried:

chown -R 777 /var/www/html/mount

and:

adduser www-data /var/www/html/mount

Anyone ideas on how to solve this?


Solution

  • So this was an permissions based fault.

    I ran gphotofs command from root, and tried to acces this directory via a symlink from www-data.

    I solved this as followed (with using APACHE instead of NGINX):

    1. changed envvar files as followed:

      sudo nano /etc/apache2/envvars

    change:

    export APACHE_RUN_USER=www-data
    export APACHE_RUN_GROUP=www-data
    

    to:

    export APACHE_RUN_USER=pi
    export APACHE_RUN_GROUP=pi
    

    Created the symlink, and allowed apache to follow symlinks by editing conf file:

    sudo nano /etc/apache2/sites-enabled/000-default.conf
    

    and added the following lines BETWEEN virtualhost tags:

    <Directory />
            Options FollowSymLinks
            AllowOverride Indexes
    </Directory>
    

    Done.