turnkeylinux / tracker

TurnKey Linux Tracker
https://www.turnkeylinux.org
71 stars 16 forks source link

Default TurnKey webserver: Continue with Apache? Switch to Nginx instead? #1582

Open JedMeister opened 3 years ago

JedMeister commented 3 years ago

TurnKey has historically always provided Apache as the "default webserver" for all appliance usage. Where we were only serving a simple landing page provided by us (aka tklweb-cp), we used LigHTTPd. In more recent times, we've continued to use Apache as the "default", except where the requirement is serving simple HTML, or usage as a reverse proxy. Then we're used Nginx in more recent times. Over the years, there have been suggestions/requests to change from Apache2 to Nginx as our "default webserver".

We've considered that a few times, but always landed back on continuing to use Apache as the "default webserver" The rationale has been because of the following points:

Having said that, there is growing interest in more "modern" and "advanced" features, such as HTTP/2 support (Apache's support requires php-fpm). So some pushback against points raised above could be:

JedMeister commented 1 year ago

We'll continue with Apache for v18.x. Moving this issue to the v19.0 milestone for further consideration...

gstrauss commented 1 year ago

FYI: lighttpd is frequently the web server used in OpenWRT, and home routers behind firewalls are not counted in the in the metrics about web server "popularity". lighttpd supports HTTP/2 OOTB and supports many of the features discussed above. Using PHP-FPM to which lighttpd connects via unix domain socket is the recommended way to manage PHP applications, though lighttpd can also run PHP as CGI.

While lighttpd does not support .htaccess -- because .htaccess dates back to the 1990s where it was common to run a single, monolithic Apache server -- nowadays if you need a specific Apache .htaccess feature and do not want to convert to another server syntax, then you can easily configure lighttpd or nginx to reverse proxy back to an Apache instance, and use Apache as a backend application server for the specific web app, and let lighttpd or nginx handle everything else, using lower resources than Apache.

JedMeister commented 1 year ago

Hi @gstrauss I see you are a member of the LigHTTPd team! Thanks for dropping in to say hi. :smile:

FWIW, we already use lighty for a number of our appliances. When we started, lighttpd was our lightweight option. We have continued to use Apache as the main web server for all of the above mentioned points.

I agree that most, if not all of the + points for Nginx above also related to Lighty.

Thanks for the tip re reverse proxying to Apache. Whilst that might be relevant for end users, as much as possible we try to keep our appliances as light as possible. If we needed to use .htaccess files, then we'd either convert them, or just use Apache.

Regardless, thanks again for dropping in and sharing your perspective. It's appreciated.

TBH, the main reason why we have considered switching from Apache is users requesting Nginx.