I’ve recently begun fiddling around with PHP at home, and so have installed Xampp on my Mac and I can access (locally) sites that I create. Nothing fancy but it’s a start. I’m thinking I might make a sort of household ‘organiser’ / to-do list that I can display on an iPad in our kitchen.
However the trouble is that my Mac is not always on, or always at home.
I have a Raspberry Pi running Hassio at home, so I wondered if there was a way / any add-ons for Hassio that essentially allow it to function as an apache / PHP web server?
The other option is to get another Pi and use that as the server but I’d rather not if I can avoid it.
Old topic I know, but a generic web server add-on would be really useful (I’ve looked and not found one). I’ve got some simple php pages that I’d like to use for my weather station.
@frenck could you add one to your repertoire, please?
The problem is “what is generic?” You use PHP as a server side language. Some people use other languages. As a developer of such an add-on it would mean all kinds of people asking to add support for whatever language or Apache module or anything like that to add to the HA add-on. I don’t think this would be a good way to spend HA development time. If you install HA on your RPI on top of a normal raspbian image using docker (explained on the installation page in the documentation on the HA website) you can choose from the many LAMP docker containers on docker hub to run on the side.
Yes I acknowledge that. I’m sure there are solutions to that though. For me, it would certainly not be for anything that required a complex setup - it is for the hosting of a simple mini website. I also suspect that, for someone who knows the add-on system, it would be relatively quick as it seems that various parts are already templated. I would also wager that PHP modules could easily be included (much like Node-RED npm packages can be installed via the options).
My thought is that there are lots of custom views that could then be created using the iframe card in Lovelace that could point to this local webserver.
The problem with a generic docker, is it loses the integration with the supervisor, SSL etc.
I’ve installed the add-ons for DuckDNS, MariaDB, phpMyAdmin and your Apache2. My index.html displays just fine. Thank you very much! However, none of my .php programs will display. Perhaps you can tell me the most likely cause of php problems. I’m not sure where to start.
Thanks FaserF !! What whould be the way if I want to host more thant 1 web site. NGINX reverse proxy doesnt allow me to redirect to subpath, only other port.
hmmm, good question. Right now I dont have support in my addons for multiple sites.
You could use for example the full apache2 addon and also a minimal apache2 addon from my addons.
Both at the same time. This would allow you to host multiple sites.
There is no need to feel stupid
If you are launching the web ui from the addon (ingress) it is normal to get the 502 error.
That is due to the need of an SSL certificate, described here:
Doh! That makes sense now. I had been playing around with it that way too and was getting a connection error, now I realise it was actually a connection error generated from my php failing to connect to the DB. I remembered that when I installed through XAMPP it went through the process of creating the underlying DB etc too.
Now I’ll try figure that out - thanks again for your help.
okay, okay, great! thank you! basically the key to getting everything to wokr is understanding nginx whcih i messed with all day today. I was thinking Open WebUI was supposed to open some kind of special admin page for apache or whatever.
Hey man, I thought of something else I Wanted to ask you. Is there really no way to like run multiple instances of the add-on through 1 HA OS install? I’d really like to try and host another page becauze neither of them are going to get alot of traffic. Have you ever see nanyone host 2 pages with your add-on?