Community
OpenEnergyMonitor

Community

Emoncms on a synology first registration failure

Hi Guys,

I am trying to get the website working on a Synology NAS.
followed the install instructions and I got the website online.

But if i want to register a first user i get this message
405 Not Allowed

the database tables are filled correctly by the first installation. but i cant register a user.
I also looked into some related discussions but didn’t not find the answer yet.

Using
webstation with Nginx and PHP7 Maria10 DB and latest emoncms 9.8.31

nginx errorlog

2018/10/08 17:10:14 [error] 3548#3548: *4675 open() "/var/services/web/emoncms/user/register.json" failed (2: No such file or directory), client: 192.168.1.3, server: , request: "POST /emoncm
s/user/register.json HTTP/1.1", host: "192.168.1.67", referrer: http://192.168.1.67/emoncms/ 

Apache24 errorlog

NAS2 [Sun Oct 07 13:05:23.208428 2018] [core:alert] [pid 28678:tid 139803620599552] [client 192.168.1.3:33542] /var/services/web/emoncms/.htaccess: Invalid command 'Order', perhaps
misspelled or defined by a module not included in the server configuration

regards,

natnek

Hello @natnek. It sounds like a modrewrite issue. The nginx server is not redirecting requests to the right place. e.g:

emoncms/user/register.json

maps to

emoncms?q=user/register.json

I’m not that familiar with the equivalent of apache’s modrewrite for nginx unfortunately.

thanx Trystan

I am still hanging here on this issue.

rgds
natnek

Hi Dennis,

Have you had a look at this?

Hi Bill

Thanks for your reply.
I use the emoncms on a synology with pre defined setting so it is a litte complicated to merge emoncms.

rgds
Dennis

It’s possible to run Apache on a Synology box which works easier with PHP.

Just putting this here incase others stumble upon it looking to set it up with nginx, The nginx config on the page linked by Bill.Thomson did not work for me, but its based on a much older install. It did however give me the one missing line that I needed for my existing nginx config:

rewrite ^/(.*)$ /index.php?q=$1 last;

my complete nginx config:

    upstream php {
        server unix:/var/run/php/php7.2-fpm.sock;
    }
    # Emon CMS Power Monitor HTTP
    server {
        listen 80;
        server_name emon.example.com;
        root /var/www/emoncms/;
        index index.php;

        location = /favicon.ico { log_not_found off; access_log off; }
        location / {
            rewrite ^/(.*)$ /index.php?q=$1 last;
        }
        location ~ \.php$ {
            include fastcgi.conf;
            fastcgi_intercept_errors on;
            fastcgi_pass php;
        }
        location ~* \.(js|css|png|jpg|jpeg|gif|ico|xml|woff|woff2)$ {
            expires max;
            log_not_found off;
        }
    }
2 Likes