Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

Please understand that I'm essentially without knowledge about much of this, but I'm trying to follow the directions to get it installed on Lubuntu 15.10 (if the version number is important?), which is still an acceptable version of Ubuntu as far as I know.

I'm not sure if there is a new set of instructions somewhere else, but these are the instructions I found:

https://github.com/emoncms/emoncms/blob/master/docs/LinuxInstall.md

 

I am able to follow the instructions, but reading on the forum, it seems that at some point the default folder for apache2 changed from /var/www to /var/www/html.  I then researched here and found where it was important to switch the download for emoncms to the /var/www/html location, and that discussion was marked solved.  That is fine, and I can do that.

But what I'm wondering about is the modification to the apache2.conf file.

I've followed the instructions, and found the places to modify the AllowOverride None to AllowOverride All for the / and the /var/www directory.

Do people then need to set up another directory entry in the apache2.conf file for the default file which is now /var/www/html?  And then set that directory from AllowOverride None to AllowOverride All?  Why change permissions in the /var/www directory if emoncms isn't going there?  Could you just download emoncms into both the /var/www directory and /var/www/html directory just to be safe?

I'm trying to do this step-by-step, so I haven't kept going to see what would work and what wouldn't work, since I don't want to destroy the progress I've made so far.

Thank you for any help with this.

 

Paul Reed's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

The default installation directory for emoncms is /var/www/emoncms 

However, if your html root (where your web pages are served from - usually contains index.html) is different to /var/www then you need to create a symlink in the html root -> /var/www/emoncms

The Raspberry Pi 'Jessie' installation guide is a good example, as emoncms is installed in /var/www/emoncms yet the server's html root is /var/www/html
So a symlink was created to direct web traffic to /var/www/emoncms

cd /var/www/html && sudo ln -s /var/www/emoncms

Then all of the system setting changes are made using /var/www/emoncms as the emoncms location.

​Paul
 

sub3marathonman's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

Thank you Paul for the help.

Now I'm hoping you, or somebody else even, can help a bit more, as there is another problem.

I downloaded the emoncms into the /var/www/ directory, as instructed in the official instructions.  On one thread on the forum it appears that the advice was to download emoncms into the var/www/html default directory, however I am thinking that if it was supposed to go into the /var/www/html directory as the new updated apache2 default directory is now that the directions for emoncms installation would be changed.  It is my understanding that the apache2 default directory has been /var/www/html now for awhile.

So I did that, downloading into the /var/www/ directory, and I then typed the above command exactly as written.  I am not sure if it two commands at once, as the cd is a command too, but however it is done it apparently did exactly as it was supposed to.  If I look in the html directory I can see the emonsms subdirectory, but in light blue instead of dark blue, I can go to the /var/www/html/emoncms folder (linked to the actual one I guess) and see all the files.

Now, the problem is that when I try to do the web browser and go to http://localhost/emoncms I get an error, "can't connect to database, please verify credentials/configuration in settings.php Error message: access denied for "me'@'localhost' (using password: YES)

This is the exact same problem brutzler had back in October 2015, but nobody responded to the question:

http://www.openenergymonitor.net/emon/node/11474?page=20

That was trying to install from one Windows installation to another Windows installation, if that is important.

So now I'm wondering what the next step should be, go forward somehow or go back, restore things to the before download of emoncms state, and then download emoncms into the /var/www/html default folder for apache2.

Thank you for any and all help.

 

Paul Reed's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

Have you used the correct database details in settings.php?
Is MYSQL running, have you looked at the emoncms & MYSQL logs to see if anything is reported? Paul

sub3marathonman's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

I have reinstalled everything to a newly formatted virtual hard drive (with Oracle VirtualBox), LUbuntu 15.10, and followed exactly all the instructions given to do the Install Emoncms V8, from the /var/www directory, with the exception of following the Raspberry Pi 'Jesse' instructions for the symlink.  (I thought the symlink instruction was supposed to list two directories, but apparently when only one is listed it automatically defaults to the directory the command is typed from.)  The symlink apparently worked fine, as before it now showed up in the /var/www/html directory.

I also followed the Raspberry Pi 'Jesse' instructions for modifying the settings.php file, using the $username of emoncms.

The results are exactly the same, with the error "can't connect to database ..."  The access denied listed the username of emoncms this time.

Also, I did follow Paul's advice and checked the log files of emoncms and mysql.  There was nothing in the emoncms, but many lines of error for each time the localhost/emoncms was attempted to be started in the mysql file.  I can provide a copy of that if it will help, but I was hoping to make progress with a different method.

So I did more research and found the "Update process from Version 8 to Version 9" (written by Paul)

http://openenergymonitor.org/emon/node/11636

In that instruction list it states to start with a fresh install of Version 8.5.2.  So I will try to follow that path, but I don't know how to do a git command for the Version 8.5.2.  The listed command is:
$ git clone -b stable https://github.com/emoncms/emoncms.git

I suspect that Version 9 is not working correctly with the mysql setup instructions from Version 8, and/or the problem is that emoncms has never been run at this point and it won't set up the database correctly.  I did see from other research that the php5 version must be higher than 5.4 for Version 9, which I checked and it is.  I thought it was a problem with the settings.php file, but there are really only two steps for modifying it, unless as I found there are some characters which won't work in the password.  My password does include numbers, but nothing that I would consider unusual such as the symbols or any slashes or question marks.  I followed the advice from the update thread and made feedwriter executable, but of course I don't know what that means or what it does or how it is different from Version 8.

This has really started to take some time, so I hate to give up, and I definitely appreciate the help here, but I don't understand why I can't get it to work following the instructions.  I also don't understand why I am apparently the only one having such a problem following the instructions.

Paul Reed's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

I have reinstalled everything to a newly formatted virtual hard drive (with Oracle VirtualBox)

That means very little to me, is it shared hosting? perhaps someone else may be more familiar and advise you.

many lines of error for each time the localhost/emoncms was attempted to be started in the mysql file

The logfile (or extracts from), may help.

start with a fresh install of Version 8.5.2

I would not recommend that approach.

Paul

sub3marathonman's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

is it is important to be in a specific directory when creating the mysql database?

Bill Thomson's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

I have reinstalled everything to a newly formatted virtual hard drive (with Oracle VirtualBox)

That means very little to me, is it shared hosting? perhaps someone else may be more familiar and advise you.

Hi Paul,

Taken from the Oracle Virtual Box web page: www.virtualbox.org/manual/ch01.html

VirtualBox is a cross-platform virtualization application. What does that mean? For one thing, it installs on your existing Intel or AMD-based computers, whether they are running Windows, Mac, Linux or Solaris operating systems. Secondly, it extends the capabilities of your existing computer so that it can run multiple operating systems (inside multiple virtual machines) at the same time. So, for example, you can run Windows and Linux on your Mac, run Windows Server 2008 on your Linux server, run Linux on your Windows PC, and so on, all alongside your existing applications. You can install and run as many virtual machines as you like -- the only practical limits are disk space and memory.

Bill Thomson's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

is it is important to be in a specific directory when creating the mysql database?

Short answer, no.

Provided nothing is preventing writing to the storage medium, e.g. user or file permissions, and there are no other issues preventing a MySQL user from creating a database, the present working directory is not relevant.

Robert Wall's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

For what it's worth, I use VirtualBox on Ubuntu to run Windows 10 to see my friend's security cameras, which use DirectX (available only in Windows).

So when I do that, I have an Ubuntu desktop with the Windows 10 desktop as a window on it, with the Camera app window inside that.

sub3marathonman's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

OK, I admit I don't know much in this area, but I can't be at absolute zero.  Somebody, somewhere, within the last couple of days, must have changed the emoncms file that is downloaded with the git clone -b stable command.

I entered a password without numbers, just in case that might have been the problem, and it worked!  So then I went back now and redid everything again, as I'm getting quicker each time, and yes, it still works with a password with numbers and letters.

However, I would still like to thank Paul once again for his help with the symlink command.  There seems to be two options with the apache2 default directory changing to /var/www/html, to do the git command from the default directory or do the symlink command.  I thought it was better to do the symlink command since emoncms had always been installed to /var/www/.

Either way, it seems that somehow the instructions should be updated to show these two options.

One more question I wondered about was making feedwriter executable, as stated in Update process from V8 to V9.  Is that necessary only for updating from V8 to V9, or is it necessary for V9 to operate correctly?  And does it matter if feedwriter is made executable no matter?

 

 

Paul Reed's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

I updated the git clone link a couple of days ago, however at this point in time, both stable and master branches are very similar, so it shouldn't have made much of a difference. Feedwriter is only required for v9 when it is put into low-write mode. So unless you are intending to use low-write, you can disregard it. Paul

sub3marathonman's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

Thanks again Paul!

 

sub3marathonman's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

OK, as an update today I have once again done a new installation on a virtual machine, and now the same problem as before is occurring, with the same "access denied" error message as I mentioned on my 08/01/2016 several days ago.

So somehow, somebody must have, once again, changed what emoncms files are downloaded with the git clone -b stable command, and somehow whatever is being changed in those files does not affect versions that are set up but won't set up the new database correctly.

I had this working fine with a previous git clone -b stable command, following exactly the same instructions, and I still have that virtual machine backed up, but I had wanted to try things again just to make sure everything was working correctly if I ever needed to do an update.

 

Paul Reed's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

Nothing has changed in the stable branch since your last successful installation. The last time any changes were made was the 8th January 2016.

The installation guide has not been changed either....

Paul 

sub3marathonman's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

Thank you again Paul.

I am now agreeing that it must be some small mistake I made somewhere in all the typing input for the commands.  I checked the screenshots I had when installing emoncms and it didn't work, and now I'm thinking I didn't go into the right directory (/var/www/emoncms/Modules) to download the dashboard and the app modules, but I didn't go back and redo everything with that wrong to check.

I still think it would be a welcome addition / clarification to the official instructions to include the sudo ln -s command as mentioned by Paul earlier, as every time I reinstalled emoncms I forgot it until the browser said "Not Found," then of course I remember.

 

Paul Reed's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

The reason why the sudo ln -s command doesn't form part of the guide is that different Linux distros do not all use the same html root directory. Some use /var/www whilst others use /var/www/html.
Let me think of some suitable wording and I'll update the guide.

Paul

sub3marathonman's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

Thanks Paul for all the help.

One other detail, as a newbie, that might help as people set this up is following the instructions for setting your time zone in the php.ini file.  It is easy and straightforward, just put in your correct time zone from the link provided, but you also must edit out the little ; (semicolon) at the beginning of the line which signified it as a comment in the php.ini file.  I almost overlooked this.

Is there any benefit in setting the default-latitude and default-longitude and the sunrise-zenith and the sunset-zenith in the php.ini file?

 

Bill Thomson's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

Is there any benefit in setting the default-latitude and default-longitude and the sunrise-zenith and the sunset-zenith in the php.ini file?

If you set the timezone, the lat/long isn't needed. (It's an alternate choice vice the timezone setting)

sub3marathonman's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

OK, that makes sense!  So it is somewhat of an either the time zone or the latitude/longitude setting or both (maybe?) if you want.  What would it do if you set the time zone as Europe and the latitude/longtidue as Asia though?

Thanks Bill.

 

Bill Thomson's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

Ooops, gave ya some bad info.

The lat/long is used for sunrise/sunset calculation.

Ref: http://php.net/manual/en/datetime.configuration.php

sub3marathonman's picture

Re: Install Emoncms V8 on Ubuntu / Debian Linux Instructions Question

No problem Bill, I'll just "keep on lookin' to the East."  If you're a fan of the old Doobie Brothers :) 

But here is a real question:

Why does the php5 version list the zenith as 90.583333, when it is apparently at least according to the U.S. Navy

http://aa.usno.navy.mil/faq/docs/RST_defs.php

it is 90.8333?  It seems so unlikely to be a random coincidence, is it possible that the php5 has a typographical error and put the extra digit 5 after the decimal point?

 

Comment viewing options

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