Emoncms on IIS problem

Hi,

I am trying to install emoncms on my WHS 2011. After a lot of trying around I have come to a point where the database is created in MySql, Emoncms has created the tables after connecting to 'localhost\emoncms'.

But now i have a problem to register (and login with) a new user. After putting in email and password and pressing 'register' or 'login', the answer is an Error 404.0 page. The error description says that the 'physical path' 'C:\Program files\Windows Server\Bin\WebApps\Site\emoncms\user\create' does not exist. And this is true, as under '\emoncms\' there is no folder 'user'.

Everything works on my (Win XP with Xampp) test system.

Can anybody give me a hint?

BR, Jörg.  

TrystanLea's picture

Re: Emoncms on IIS problem

Hello Jorg, A yes, you need to enable mod_rewrite as described on the bottom of this page: http://openenergymonitor.org/emon/emoncms/installation.

Im not sure exactly how to do this on windows but it should be straightforward to do as its often used by applications like drupal and others.

It might be worth you installing the new version of emoncms now as its much better and we just merged the dev branch into the master last night.

JBecker's picture

Re: Emoncms on IIS problem

Thanks a lot Trystan, I overlooked that.

It is sometimes not so easy to 'translate' installation guides from Linux (Apache, ....) to Windows (IIS, ...)  :-(

And then I am only an 'embedded' developer with not more than just very little insight into all this Web, PHP, MySql stuff.

I will try this evening when I am home again. Next thing will be to connect a Jeelink to the server and see how to send data from there to the database. I have a temperature/humidity Jeenode running and hope that my Emontx will arrive soon :-)

BR, Jörg.

 

edit: installed 'URL Rewrite 2.0' for IIS. But now I'm completely lost, because I have to define a redirection rule somehow. No idea what this means. For me the main problem is to understand what I really want to achieve !?!

If I type the user name and password into the form and press 'Login' or 'Register', what should happen next? Where is this user and password evaluated? I have no idea.......

 

 

TrystanLea's picture

Re: Emoncms on IIS problem

Hello Jorg, ah yes, the purpose of mod_rewrite is to convert

emoncms/user/login 

to:

emoncms/index.php?q=user/login

index.php then fetches the property q with $_GET['q'] and builds the page accordingly. Emoncms follows the Model-View-Controller architecture - Im working on better documenting exactly how emoncms works, there is a start on it here: 

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

JBecker's picture

Re: Emoncms on IIS problem

Wow, that is easy to understand (even for me )! Thanks again for your fast response. And I am far away from blaming your documentation, I understand that most users will run this on Linux and it also worked for me on Win XP with XAMPP more or less out of the box. But I have this WHS running since some years now and don't want to change to Linux there (this is also my TV server and I already had to fight hard to push the WAF to an acceptable level).

Ok, next try this evening. Should be possible to do in this 'URL Rewrite'.

BR, Jörg.

TrystanLea's picture

Re: Emoncms on IIS problem

Great, good to hear its understandable.

I should proably add that the mod_rewrite settings are usually contained in the .htaccess file that is one of the files in the root directory of the emoncms install. Will your server be able to make sure of that file and therfore save you having to construct the rewrite rule manually?

JBecker's picture

Re: Emoncms on IIS problem

Trystan,

I feel like a pig looking into a clockwork....

 

If the rewrite rules are there already (in the .htaccess file), then it should have recognized them. But as far as I can see, these rewrite rules are in Apache syntax !?

I understood that 'Apache' rules can be imported in URL Rewrite and transformed into IIS rules, but have to try this evening (or weekend).

Will come back with results. Jörg.

 

PS (OT): Emontx arrived yesterday , built and put into operation with three CTs, calibrated with 300W halogen flood ligth (resistive load). Data received with a Jeelink, everything working so far. But now I realize that the existing scripts are not really suitable for real power three-phase monitoring !?! I will try to do something with only the one existing voltage input  and use fixed 120° and 240° phaseshifted voltage sample table for calculation of L2 and L3. This should be 'good enough' and within some percent error. Hopefully the weekend will be long enough ....

 

 

JBecker's picture

Re: Emoncms on IIS problem

Sorry for bothering you again, but I still have not much progress here.

Now that I have 'implemented' some rewrite rules in the web.config of IIS following examples how to translate Apache into IIS syntax, I get a wrong substituion:

When the web browser 'URL line' (how is this called correctly?) shows:

localhost/emoncms3/user/login 

then the webserver gives a message that the requested URL is :

http;//localhost:80/index.php?q=emoncms3/user/login

Seems that the parsing of the original URl does not work correctly. I do have absolutely no experience with the regular expressions used there nor with the whole syntax of these rules, so I have no clue how to solve that.

Is the problem somewhere in here?:

  <rule name="Imported Rule 2" stopProcessing="true">
      <match url="^(.*)$" ignoreCase="false" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
        <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
      </conditions>
      <action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" />
    </rule>

Trystan, I know that you have other things to do and I really do not want to keep you busy with my very personal problems. Is there nobody else who wants to use emoncms on a windows home server and IIS and can help me?

BR, Jörg.

PS: my three-phase measuring setup with one voltage sensor and three CTs is now running near perfect (using the somwhat rewritten interrupt code of user Pcunha). So now I really want to have these data stored and presented. What emoncms does with presenting these data is absolutely fantastic. If I cannot get this to run on IIS then I will have another try on my RasPi (if and when it arrives hopefully the next days). 

 

 

 

Comment viewing options

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