Fresh Ubuntu system, emoncms 9.6/9.7 not working

Hi all, I’ve been trying to get a fresh clean install of Ubuntu server with emoncms 9.6, now 9.7 working but I’m not having any luck.
I’ve tried with Ubuntu 14.04 and 16.04. Followed the installation instructions verbatim and cannot get emoncms to work.
I only get the login page displayed. If I try to create a new user all I get is “undefined”.

Any ideas where I can look to get this working?

This question has already been asked here:

sound again the apache redirect option is missing : mod_rewrite option active ?
the create button sends to a particular script that is not really called statically but via an url_rewrite

not 100% sure it is this but in my case it was the problem (though not on Ubuntu)

Yes, it’s a mod rewrite issue, did you follow the steps to configure apache:

Hi, I had the same problem a few hour ago.
I just solved installing phpmyadmin on my Ubuntu and granting permissions to the emoncms db user.
Hope this helps.

Ok, I just got home.
Yup, followed instructions to the letter.
Just tried to enable rewrite and got “Module rewrite already enabled”

Anything else I can check?

Ok, tried install phpmyadmin.
phpmyadmin works like a charm.

Still no functional emoncms.
:frowning:

do you have a file called emoncms in /etc/apache2/sites-enabled/ ?

Please show the contents:

$ cat /etc/apache2/sites-enabled/emoncms

Where are you hosting emoncms from? Is it in /var/www/html/emoncms ?

Please attach the contents of your /etc/apache2/apache2.conf file

$cat /etc/apache2/apache2.conf

Yup, hosting from /var/www/html/emoncms.
Interestingly, the timestamp on the apache2.conf file dates back to 2014
contents of /etc/apache2/sites-enabled/emoncms


<Directory /var/www/html/emoncms>
  Options FollowSymLinks
  AllowOverride All
  DirectoryIndex index.php
  Order allow,deny
  Allow from all
</Directory>
<Directory /var/www/html/emoncms>
  Options FollowSymLinks
  AllowOverride All
  DirectoryIndex index.php
  Order allow,deny
  Allow from all
</Directory>

apache2.conf.txt (6.9 KB)

In the attached apache2.conf file, it looks like the Allow override is set to none not all, try changing this and then restart apache

YAY! That did it Jimmy.
Happy dance.:joy:

I knew if would be something simple and silly.
You guys have been great help as usual.
So, now I/we can have a “stock” install working.

Now I’ll get back to my “production” server.

Cool, I’ll remove these vms and reclaim the space, glad it’s working now.

It’s is daft how one thing can throw it all out.

Well in the process i have learnt that theoretically I can upgrade my production box to 16.04 now.

@glyn.hudson, should the installation wiki be updated?
Or did I miss a step somewhere?

It’s listed in the apache config section. Did you run each of these lines:

 sudo a2enmod rewrite
 sudo sh -c "echo '<Directory /var/www/html/emoncms>' >> /etc/apache2/sites-available/emoncms"
 sudo sh -c "echo '  Options FollowSymLinks' >> /etc/apache2/sites-available/emoncms"
 sudo sh -c "echo '  AllowOverride All' >> /etc/apache2/sites-available/emoncms"
 sudo sh -c "echo '  DirectoryIndex index.php' >> /etc/apache2/sites-available/emoncms"
 sudo sh -c "echo '  Order allow,deny' >> /etc/apache2/sites-available/emoncms"
 sudo sh -c "echo '  Allow from all' >> /etc/apache2/sites-available/emoncms"
 sudo sh -c "echo '</Directory>' >> /etc/apache2/sites-available/emoncms"
 sudo ln -s /etc/apache2/sites-available/emoncms /etc/apache2/sites-enabled/
 sudo service apache2 reload

Hi again Glyn, yup.
I certainly did follow those steps.
I’ll run another fresh install tonight and double check that the “AllowOverride All” directive actually gets added.

Please let me know if the instructions could be improved.

The lines above create a site specific config in a file called emoncms.
This config then gets enabled in sites-enabled

Ok, here’s what’s going on.
I followed the installation instructions to the letter once again, for ubuntu 16.04 with php7.
No success.

It looks like Apache is not picking up the “sites-available” directory and/or options.

If I edit the apache2.conf file and manually add the required entries:

->Directory /var/www/html/emoncms
  Options FollowSymLinks
  AllowOverride All
  DirectoryIndex index.php
  Order allow,deny
  Allow from all
->Directory<-

Then all is beautiful.

We must be missing a little something somewhere …

P.S. Everything is good if I also remove the /var/www/html/emoncms from apache2.conf
but change /var/www to “AllowOverride All”

Ok, I may have found the solution here.

In the apache2.conf file at the end of the file there is an entry:
IncludeOptional sites-enabled/*.conf

I renamed the /etc/apache2/sites-available/emoncms file
to
/etc/apache2/sites-available/emoncms.conf

Then to enable the site, I executed:
sudo a2ensite emoncms

Voila!
It all works.
P.S. I now have a github account so I can perform pull requests.

Cheers everyone !

1 Like

Excellent! Could you try and make a pull request to suggest an addition the setup documentation to include the change required to apache.conf.

Let me know if you have any trouble.

Ah I see you have already done it! Thanks, been merged :thumbsup:

If it helps, I have emoncms 9.7.8 | 2016.11.10 at latest revision as of yesterday running on an Ubunti 16.04 server with no problems. Here is the public demo dashboard:

http://emoncms.energymonitorsystems.co.uk/demo/

Let me know if there is anything I can usefully check for you.

Richard