[TESTING] LAMP stack on OSMC


#1

Hi

I have seen some users requesting an easy way to set up a LAMP stack in OSMC. I’ve decided to build an OSMC App that does this for you, but it needs some testing.

  • Apache2, running on port 8079.
  • PHP5
  • MySQL 5.5 (root password is 'osmc)

To try it out, run the following commands via SSH:

sudo -s
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install lamp-app-osmc

If this is works well, then I will add this to the OSMC App store by the end of the month. Please note that toggling this service on/off under My OSMC -> Services will not fully work yet. @Karnage must add some code to handle /etc/osmc/apps.d files which define multiple services.

Sam


MRTG install on Pi2 - How to?
Measureit power monitoring
#2

i asked for it and really even that there is a way for the user to do it following guides on the net as you said before, i really cannot express my gratitude for an ready to install package.

I will test it and report back in a week or two (sorry about that but i am out of country a lot the last months and work has become a #$@!$ in the @#$

Once more thank you very much.


#3

Looks good here Sam. One thing you may consider changing is to allow mysql to listen for remote connections as the default, since people may wish to use the Kodi MySQL shared database.


#4

Yes. It may also be a good idea to have a separate MySQL database package for people that wish to do this as well.

Sam


#5

Great! Works like charm!


#6

Also looks very good here


#7

Just installed. An error at the end which I hope is insignificant.

Setting up lamp-app-osmc (1.0.2) …
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘root’@‘localhost’ (using password: NO)’

I have no intention of using MySQL but am posting this as feedback.


#8

Great idea - I’ve been doing this “the hard way” for several years installing the base packages separately.

I wonder on the choice of Apache though - I found that it was too resource heavy (especially on Pi1) and could cause problems with playback. I swapped quite a while ago to Nginx instead and the resource utilisation is markedly lower for the same usecase.

Apart from it’s ubiquity, was there a specific reason for choosing Apache over the lighter-weight Nginx?


#9

It’s pretty much that more people are familiar with it. When apache2 is tuned properly, I find it to perform similarly to nginx.

It’s possible we need to tune it a bit more.


#10

@sam_nazarko I wasn’t being critical, just curious!

I’ve used Apache since the mid 1990s but switched to lighttpd and tinyproxy for the Pi last year after some performance issues with Apache. Swapped to Nginx about 6 months ago and never looked back - it’s lightweight, small and wonderfully easy to configure. Guess it all depends what you’re using it for and how good you are at tuning it.


#11

Out of interest, what modules are you including in Apache? I’m thinking now there is an officially supported package I might try switching back, be easier than manually installing plus nextcloud prefers apache over nginx.


#12

It’s very minimal, see https://github.com/osmc/osmc/blob/master/package/lamp-app-osmc/files/DEBIAN/control.

The LAMP package is aimed at beginner users for convenience. Or at least, it will be when it’s properly put in the App Store. If you’ve experience with nginx and you’re comfortable with it, then this package isn’t going to really provide much benefit to you. We like to support upstream Debian, so nginx packages from apt-get etc will work without conflicting with OSMC. You’ll want to remove apache2 first however, or you’ll have two things fighting over port 80. Also ensure Kodi web server runs on a different port.

Cheers,

Sam


#13

Thanks Sam, looks like I’d have to install a few modules to get that doing what I’d want it to do, maybe I’ll try it out on the test card when I test Krypton on my Pi2 next week.

Like I said, I’ve only been using nginx for about 6 months (compared to 20 years now for apache!) so I wouldn’t say I was experienced…


#14

In my experience, nginx is great for static files, SSL termination and reverse proxying. Apache2 fairs better for PHP with an appropriate model (fpm).

I use Varnish cache between nginx and the web application (Discourse / Ghost etc). This is very powerful and fast, and you can consolidate multiple backends and even vary them based on URL under one domain.

And (hopefully) it keeps OSMC websites snappy!

Sam


#15

I’m using nginx as a reverse proxy (and SSL layer) for the deluge web ui and also serving simple php using php-fpm. I’m keen to move my owncloud to the pi as it will save a fortune on electricity but configuring that for nginx is rather more difficult than for apache2. But the SSLd reverse proxy for deluge is more tricky on Apache (especially when trying to also use Apache for web traffic on the same port.

What I may end up doing is installing Apache also and the using nginx to proxy to both.

Varnish is a little overkill I think for a personal server (I use it for my web hosting customers, but that’s rather a different scale :slight_smile:)


#16

I first started using Pound, as using nginx for SSL proxying only was a little excessive in my eyes. It’s very fast, but at the time I had to use a Git version and not a repository version as Comodo certs which we used required SNI support. But it is worth checking out.

fpm is fine, FastCGI always seems to be problematic, and fpm is often employed as a fallback with hacky code when this is used anyway.

It’s probably worth moving to Nextcloud. I remember setting up OwnCloud a couple of times and it was not easy, it’s never been very well documented, possibly for ‘support’ reasons.

apache2 proxying is always a bit tricky, and it’s not worth it. I like using Varnish for that, as the VCL is very easy to edit (C like):

  • terminate at nginx
  • varnish
  • backend (such as apache2)

I find this combination of nginx for SSL termination and apache2 work well. I got rid of Pound because I thought that we may move to nginx in the future, and it was better to do it all with one daemon, but that never arose. If it isn’t broken…

It is – because you’ll spend more time writing VCL to set up cache exclusions than if you waited for pages to load :wink:


#17

Never heard of that one - I used to use tinyproxy forwarding to lighttpd but dropped the former when I moved to SSL and the latter due to lack of development and a growing number of unfixed security bugs - shame really as it was very lightweight.

I like nginx as a proxy as it allows me (being something of a nerd) to insert this too. Easier than hacking the deluge-ui to do it natively…

Yes, “move my owncloud” should read as “install new nextcloud and decommission owncloud”. It is an absolute nightmare to configure, especially if you don’t use Apache.

Not sure though about running nginx and Apache2 on the Pi2 on top of everything else. I guess I’ll install it and see if I get any loading issues.


#18

Awesome! To me, it seems to run well enough. Then again, I haven’t put any load on the server…

Any word on when this might be in the App Store? Just curious…


#19

When we rework the App Store, so soon.

Sam


#20

Hi, is there still a chance to add this add-on?