using openHAB server to show standard HTML pages

1,060 views
Skip to first unread message

Giuseppe Scarpi

unread,
Apr 22, 2014, 2:26:00 PM4/22/14
to ope...@googlegroups.com
I wonder if the web server embedded in oH (apache?) can be used to show some HTML pages and if it can be modified to support PHP as well.

Any hints?


Kai Kreuzer

unread,
Apr 22, 2014, 2:58:59 PM4/22/14
to ope...@googlegroups.com
Hi,

The webserver is Jetty and yes, it can show HTML pages.
According to http://stackoverflow.com/questions/5107684/jetty-server-run-php-code it is also possibly to get PHP running on it. Not sure how easy it is to setup, but you can have a try yourself :-)

Regards,
Kai

Am 22.04.2014 um 11:26 schrieb Giuseppe Scarpi <mdc....@gmail.com>:

I wonder if the web server embedded in oH (apache?) can be used to show some HTML pages and if it can be modified to support PHP as well.

Any hints?



--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

Giuseppe Scarpi

unread,
Apr 22, 2014, 3:32:15 PM4/22/14
to ope...@googlegroups.com
Thank you Kai,

I will keep you - and anyone - informed!

Jens Kastensson

unread,
Apr 23, 2014, 2:25:54 AM4/23/14
to ope...@googlegroups.com
Guisepppe, 
I'd like to show static pages html pages, so if you find out I'm interested to know what needs to be done. 
Jens

Kai Kreuzer

unread,
Apr 23, 2014, 2:58:56 AM4/23/14
to ope...@googlegroups.com
Jens,

simply create a folder („yourcontent“) with your static html inside the webapps folder of openHAB and it will be directly available through HTTP (http://localhost:8080/yourcontent).

Best regards,
Kai

Jens Kastensson

unread,
Apr 23, 2014, 4:02:39 AM4/23/14
to ope...@googlegroups.com
Thx Kai, 
that did the job!
Jens

Kai Kreuzer

unread,
Apr 23, 2014, 4:09:07 AM4/23/14
to ope...@googlegroups.com
Great!

Just as a warning: The content inside the webapps folder is always accessible without authentication - so even if you set the security option to ON in openhab.cfg, these files are still available. The authentication mechanism only applies to the servlet, i.e. the classic UI (openhab.app), the rest API (/rest) and the chart servlet.

Best regards,
Kai

Giuseppe Scarpi

unread,
Apr 23, 2014, 12:33:34 PM4/23/14
to ope...@googlegroups.com
Hello everybody, here are some results of the tests.

I read the post that Kai suggested on stackoverflow.com
They suggest two different approach:

1) get Quercus, a PHP interpreter written in Java, and configure Jetty to use it

2) use the fastCGI module of Jetty to transfer anything related with PHP to a standard PHP server

Unfortunately, so far I wasn't able to get any interesting results.
IMHO the first approach is the most interesting, but any attempt to let Jetty use Quercus has failed. I obtain this message:

WARN  o.eclipse.jetty.servlet.Holder[:98]-
java.lang.ClassNotFoundException: com.caucho.quercus.servlet.QuercusServlet
(etc...)

despite the fact that I attempted to write the JARs of Quercus in the correct directory.
I also attempted to change the start.ini found in openHAB/server/features/org.eclipse.jetty(...) by adding --module=ext and --module=resources

The problem seems quite trivial, Jetty does not find the JAR, but I wasn't able to solve it.

I will then attempt the second approach, but I am a bit worried: what will happen when I move from the test environment (a PC) to the production target (a RPI or something slightly better) ??

G.
Reply all
Reply to author
Forward
0 new messages