Resolved - Installing emonCMS on a Synology NAS

Hi guys..

Iv got emonCMS installed fine running on my pi but getting it to display graphs is getting painful..

I thought i give installing emoncms on my synology nas as it supports mysql and has more grunt than the pi..

But im having a problem getting it to work..

It has created the database structure fine but when ever i try to register a user it fails..  I get a red box under the confirm password box but it has no text or error message not even in the source html. 

Anyideas as im a bit suck..

PS im not a lunix expert at all.

PPS im guessing this is a mod rewrite problem but iv not got a clue on where to look for the file to change..

Taken from the Pi setup guide.

4) Enable mod rewrite

$ sudo a2enmod rewrite
$ sudo nano /etc/apache2/sites-enabled/000-default

 

Robert Wall's picture

Re: Resolved - Installing emonCMS on a Synology NAS

On my Wamp, there's an Apache configuration file httpd.conf, in that is a line:

LoadModule rewrite_module modules/mod_rewrite.so

(A line starting with a hash character is a comment - the line may well be there but commented out).

robw's picture

Re: Resolved - Installing emonCMS on a Synology NAS

Robert Thanks for replying.

Found that line and its not commented out. so i guess is active.. 

Im not sure if the NAS has two versions of Apache or Web servers running one for its admin pages and one for the users.. I cant seem to see any other by running top.

See below..

Mem: 497040K used, 14160K free, 0K shrd, 154136K buff, 222544K cached
CPU:  0.1% usr  0.0% sys  0.0% nic 99.8% idle  0.0% io  0.0% irq  0.0% sirq
Load average: 0.02 0.03 0.08 1/155 9932
  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
4699  4630 admin    S     108m 21.6  0.0 /usr/syno/mysql/libexec/mysqld --basedir=/usr/syno/mysql --datadir=/volume1/@database/mysql --user=admin --max_allowed_packet=8M
9576     1 root     S    65104 12.7  0.0 /usr/syno/apache/bin/httpd -DHAVE_PHP
9581  9576 nobody   S    65104 12.7  0.0 /usr/syno/apache/bin/httpd -DHAVE_PHP
9579  9576 nobody   S    65104 12.7  0.0 /usr/syno/apache/bin/httpd -DHAVE_PHP
9580  9576 nobody   S    65104 12.7  0.0 /usr/syno/apache/bin/httpd -DHAVE_PHP 
4887     1 root     S N  33216  6.4  0.0 /usr/syno/sbin/synoindexd
4892     1 root     S N  32224  6.2  0.0 /usr/syno/bin/synomkthumbd
5433     1 root     S N  32216  6.2  0.0 /usr/syno/sbin/synomkflvd
5256  5240 root     S    25728  5.0  0.0 /usr/syno/sbin/smbd -D
9271     1 root     S    25656  5.0  0.0 /var/packages/iTunesServer/target/sbin/mt-daapd
5240     1 root     S    25600  5.0  0.0 /usr/syno/sbin/smbd -D
5027     1 root     S    19220  3.7  0.0 /usr/syno/sbin/nmbd -D
9808  5472 root     S    19156  3.7  0.0 sshd: admin [priv]
9814  9808 root     S    19156  3.7  0.0 sshd: admin@pts/0
9451     1 root     S    17112  3.3  0.0 /var/packages/DownloadStation/target/sbin/scheduler
3332     1 root     S    17092  3.3  0.0 scemd
6803  5600 root     S    14352  2.8  0.0 /usr/syno/apache/bin/httpd -DSSL -f /usr/syno/apache/conf/httpd.conf-sys
6804  5600 root     S    14352  2.8  0.0 /usr/syno/apache/bin/httpd -DSSL -f /usr/syno/apache/conf/httpd.conf-sys
9692  5600 root     S    14352  2.8  0.0 /usr/syno/apache/bin/httpd -DSSL -f /usr/syno/apache/conf/httpd.conf-sys
5261     1 root     S    14216  2.7  0.0 /usr/syno/sbin/afpd -g guest -c 256 -n NAS AFPServer -l default log_error
5600     1 root     S    14216  2.7  0.0 /usr/syno/apache/bin/httpd -DSSL -f /usr/syno/apache/conf/httpd.conf-sys
5684  5681 root     S    14068  2.7  0.0 /usr/syno/apache/bin/httpd -f /usr/syno/apache/conf/httpd-webdav.conf-sys
5685  5681 root     S    14068  2.7  0.0 /usr/syno/apache/bin/httpd -f /usr/syno/apache/conf/httpd-webdav.conf-sys
4215     1 root     S    13984  2.7  0.0 /usr/syno/sbin/snmpd -Ln -c /usr/syno/etc/snmpd.conf -p /var/run/snmpd.pid udp:161,udp6:161,tcp:161,tcp6:161
5681     1 root     S    13932  2.7  0.0 /usr/syno/apache/bin/httpd -f /usr/syno/apache/conf/httpd-webdav.conf-sys
4188     1 root     S    13408  2.6  0.0 /usr/syno/sbin/hotplugd
4877     1 root     S N  13024  2.5  0.0 /usr/syno/sbin/fileindexd

 Thanks again.

Robert Wall's picture

Re: Resolved - Installing emonCMS on a Synology NAS

I'll have to leave it to someone more knowledgeable to help you. I doubt that there are 2 Apaches running, though. From what I've read here about Raspberry Pi setups, emoncms is fairly particular about where it is installed. I'd suggest you plod through the forums looking for similar failure modes - I think I've seen something similar reported - and take it from there. Sorry I can't help any more.

robw's picture

Re: Resolved - Installing emonCMS on a Synology NAS

Robert No worries Thanks for spending the time to have a think about it.

robw's picture

Re: Resolved - Installing emonCMS on a Synology NAS

seems the mod rewrite is not working.. Even though its uncommitted 

as going to http://localhost/dev/admin/view i get a 404 error 

 

correction it is enabled..

Loaded Modules core mod_authn_file mod_authn_default mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_default mod_auth_basic mod_include mod_filter mod_log_config mod_env mod_mime_magic mod_setenvif prefork http_core mod_mime mod_status mod_autoindex mod_asis mod_cgi mod_negotiation mod_dir mod_actions mod_userdir mod_alias mod_so mod_rewrite mod_xsendfile mod_php5 mod_deflate mod_headers

do i need a .htaccess file????

Robert Wall's picture

Re: Resolved - Installing emonCMS on a Synology NAS

The rewrite rules can appear either in .htaccess or in the Apache httpd.conf file. I have a .htaccess in the emoncms directory, courtesy of the emoncms installation (.htaccess is 'per directory and children',  httpd.conf is processed once and is system-wide).

.htaccess is of course a hidden file (that's what the preceding '.' does). So ls -al to see it.

I think you can prove whether mod-rewrite is working by making a new .htaccess in a test directory ("NewTestDir") and just see if it does work on a test file - e.g. make a one-liner "Hello World" php web page, then make a rule (check Google - what else!) to change the request from .html to .php:

RewriteEngine On
Redirect 301 HelloWorld.html http://localhost/NewTestDir/HelloWorld.php

(Note the target must be the fully qualified URL)

Then use the browser to request HelloWorld.html.  If you get the php page, it's working!

But as I wrote above, if you haven't - because of existing material on your server - got emoncms in the place it expects to be, your rewrite rules will need changing.
 

[Edit]

Have you set up permissions properly? As I understand it, you need to change ownership of the emoncms www directory to be owned by a user 'pi'. That might be different in your case.

 

robw's picture

Re: Resolved - Installing emonCMS on a Synology NAS

Well after looking at this after a good nights sleep. It seems the .htaccess file was missing.. Some how not copied over or not in the zip file when downloaded..  
Anyway created it and all fine now.. 

I will say seems alot snappier on the NAS than on the pi.

Robert Wall's picture

Re: Resolved - Installing emonCMS on a Synology NAS

Well, I've just installed emoncms-the-latest on Wampserver under Windows XP, and the .htaccess is there for me. So it looks as if being hidden, it didn't get copied...

Petrik's picture

Re: Resolved - Installing emonCMS on a Synology NAS

Cool, need to do the same. Do you use pi as forwarder or nanoderf ? Would be interesting to hear of your experiences of the topic.

Petrik's picture

Re: Resolved - Installing emonCMS on a Synology NAS

zEVOK - so lets try this out...

 1) installed emoncms - OK

2) installed myphpadmin, created database emoncms - OK

stopped here: 3) added user emon, thats not visble on priviledges screen. when starting emoncms get an errormessage: Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'emon'@'localhost' (using password: YES) in /volume1/web/emoncms/index.php on line 26

now trying to figure out whats going on. can not see user emon, can not delete user emon .. ?

...continued...

4) edited settings.php, changed to user root and correct password

5) typed http://localhost/emoncms/index.php and logged into emoncms using user root and correct password

... stopped here ...

Now I see a vulnerability due to storing my root password to settings.php - wow how can I overcome that ???

recall vaguely that there is a scipt to import input feeds from emoncms.org. need to also find that thread. having talked to Glyn I understand that need to regenerate the dashoards by hand.

... to be continued when have more time...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.