News for hackers. Stuff that matters.
Re:Overview of new features in Apache HTTP Server 2.6 by rbanffy on Saturday November 20, 2021 @07:35PM (#29293089)
What are current use cases for Apache where it is a better choice than, say, Nginx?
Re:Overview of new features in Apache HTTP Server 2.6 by keeperofdakeys on Saturday November 20, 2021 @09:34PM (#29293686)
Apache has shipped with an event-based backend for many years now, so in terms of architecture it's on par with Nginx (while still supporting the classic pre-forking).

Personally I've found apache is more fully featured for niche use cases. For example you can do client cert authentication, then further look up a username from the certificate in ldap for authorisation - all from your apache configuration. For Nginx many of these niche use cases seem to be gated behind Nginx Plus.

Re:Overview of new features in Apache HTTP Server 2.6 by chomp on Saturday November 20, 2021 @10:35PM (#29293988)
1.) Safe modification of the behavior of the webserver as an unprivileged user (.htaccess)

2.) Sticky Sessions (and various other features) without having to pay $$$ to F5

I end up reaching for Nginx before Apache these days, but I have a lot of production that uses Apache.

Re:Overview of new features in Apache HTTP Server 2.6 by shawnz on Saturday November 20, 2021 @10:28PM (#29293956)
One feature of Apache which Nginx annoyingly lacks is HTTP CONNECT support (there is a third-party module from Alibaba which implements it, but it only supports HTTP 1.x).
Re:Overview of new features in Apache HTTP Server 2.6 by forgotmypw17 on Saturday November 20, 2021 @09:22PM (#29293627)
I prefer Apache because of the development model, the stability of configuration, familiarity, dedication to backwards-compatibility.
Re:Overview of new features in Apache HTTP Server 2.6 by pbowyer on Sunday November 21, 2021 @04:23AM (#29295122)
I've used Apache for over 20 years and I'm going to give you a feature it's missing: request coalescing.

My servers mostly proxy requests to a backend (PHP-FPM, but this is applicable to all other server-side languages). If m requests come in for /foo and all requests have the same cookies, Apache will pass all m requests through to the backend.

nginx instead will pass one request to the backend and then serve the response to all m requesters, reducing backend load. The setting is called proxy_cache_lock (https://nginx.org/en/docs/http/ngx_http_proxy_module.html#pr...)

With Apache I have to put other software in front of the web server (Varnish usually) that does this for me. So switching to a server where I can reduce installs to support by 50% is appealing.

Re:Overview of new features in Apache HTTP Server 2.6 by Denvercoder9 on Saturday November 20, 2021 @08:37PM (#29293428)
What are current use cases for, say, nginx where it is a better choice than Apache?
Re:Overview of new features in Apache HTTP Server 2.6 by duskwuff on Saturday November 20, 2021 @09:47PM (#29293747)
Proxying requests to application servers. Apache can do this, but it's clumsy to set up. nginx handles it much more gracefully.
Re:Overview of new features in Apache HTTP Server 2.6 by briffle on Sunday November 21, 2021 @12:26AM (#29294395)
Haproxy to me is much better. The free version of nginx has absolutely abysmal stats for monitoring.
Re:Overview of new features in Apache HTTP Server 2.6 by LinuxBender on Sunday November 21, 2021 @08:44AM (#29296172)
I second this. NGinx has very powerful controls around content caching but very flimsy controls and monitoring around proxy operations. HAProxy has minimal controls around caching but incredible controls and flexibility with proxy operations. HAProxy is my go-to for the outer ring of my systems. I use NGinx when I need a lot of control around content caching and in that case NGinx is my middle ring. Think CDN model Both compliment each other quite well in various use cases.

I've interacted with the development teams of Apache, NGinx and HAProxy. The lead developer of HAProxy has by far been the easiest to work and interact with.

Re:Overview of new features in Apache HTTP Server 2.6 by szastamasta on Sunday November 21, 2021 @04:12AM (#29295087)
I’ve been using Apache exactly for that for years and it’s quite easy to setup. Maybe it’s me just being used to it, but I find Apache easier to configure than nginx.
Re:Overview of new features in Apache HTTP Server 2.6 by _-david-_ on Saturday November 20, 2021 @07:55PM (#29293191)
As far as I know Nginx doesn't have the equivalent of an htaccess. This can be quite beneficial for shared hosting.
Re:Overview of new features in Apache HTTP Server 2.6 by pstuart on Saturday November 20, 2021 @08:00PM (#29293224)
Re:Overview of new features in Apache HTTP Server 2.6 by chomp on Saturday November 20, 2021 @10:15PM (#29293887)
They are not making a fair argument. The bottom line is, Nginx offers no way for an unprivileged user to safely modify behavior of the webserver. Yeah, .htaccess is not performant, but high performance isn't always necessary.
Re:Overview of new features in Apache HTTP Server 2.6 by _-david-_ on Saturday November 20, 2021 @10:29PM (#29293966)
Not sure why you posted that? It agrees with what I said that Nginx doesn't support it. There is a use case for htaccess (shared hosting) and Nginx doesn't have a solution for it.
Re:Overview of new features in Apache HTTP Server 2.6 by RhodesianHunter on Saturday November 20, 2021 @09:17PM (#29293598)
Surely that's not true and the maintainers of Apache understand caching?
Re:Overview of new features in Apache HTTP Server 2.6 by duskwuff on Saturday November 20, 2021 @09:49PM (#29293756)
It's true. If .htaccess is enabled (AllowOverride not set to None), Apache httpd will search for them and parse them on every request. For most use cases, this is honestly fine; it only becomes an issue for very high traffic sites.
Re:Overview of new features in Apache HTTP Server 2.6 by vlovich123 on Saturday November 20, 2021 @10:03PM (#29293820)
Huh. I’m surprised they don’t use fs events to watch for changes rather than doing fs I/O in the critical path.
Re:Overview of new features in Apache HTTP Server 2.6 by duskwuff on Saturday November 20, 2021 @10:30PM (#29293968)
FS events are OS dependent, don't always work (e.g. on network volumes), and often have a limited number of "watches" available which could easily be exhausted by deep, complex directory structures.
Re:Overview of new features in Apache HTTP Server 2.6 by rndgermandude on Saturday November 20, 2021 @10:43PM (#29294032)
fs events do not scale on linux, at least not with the inotify facility as watching directories is not recursive and watching large trees, e.g. for creations, modifications or removals .htaccess, will essentially require you to have an additional watch descriptor per directory, and there are limits on number of queued events as well as number of watch descriptors per user. The alternate fanotify has it's own set of drawbacks, such as the need for CAP_ADMIN. Not to mention the mess you may get in when you're trying to monitor certain file systems, especially certain network-attached ones.

Other operating systems have drawbacks as well.

It's probably a safer and maybe even more efficient bet to just do the stats and opens and hope that the kernel/OS file system caches will save the day. Or you can go the nginx route and not support .htaccess like facilities (e.g. turn if off in apache).

Re:Overview of new features in Apache HTTP Server 2.6 by vlovich123 on Saturday November 20, 2021 @11:20PM (#29294164)
In theory yes. In practice, how often are people who are using htaccess going to be running into these corner cases? I would bet anyone using it is likely running a very small site anyway where the convenience is worth it.

You can also detect when you have too many watches needed or a network filesystem to fall back to the existing path. It’s a philosophical difference ultimately.

Re:Overview of new features in Apache HTTP Server 2.6 by rovr138 on Saturday November 20, 2021 @09:51PM (#29293773)
I can't point to code, but from experience, changes usually register quickly.

Changes being adding a new file, changes to an existing one and so on.

.

While I hadn't thought of it, I haven't noticed issues around it. Using a platform like Drupal, Wordpress, Django, etc most paths don't exist on disk and just fall to the index file or get proxied to another server.

So this might be an issue for static files uploaded or static sites. Talking about Drupal and Wordpress, that would usually be,

    sites/default/files/
    wp-content
Re:Overview of new features in Apache HTTP Server 2.6 by kiwijamo on Saturday November 20, 2021 @08:07PM (#29293263)
I've stuck with Apache given it is what I know, having used it for over 15 years. Despite its flaws, it does the job pretty well. I'm also more confident that Apache's code is more battle tested. On top of that I disable all the modules I don't need so my attack surface is pretty small. I run a static site so I basically run Apache with only a few of its core modules. I've tried others (especially Caddy) and while I appreciate some of the enhancements, they don't really add any significant improvements for my use cases.
Re:Overview of new features in Apache HTTP Server 2.6 by barryp on Saturday November 20, 2021 @09:15PM (#29293588)
Running CGI scripts.
Re:Overview of new features in Apache HTTP Server 2.6 by jhgb on Sunday November 21, 2021 @03:34AM (#29294970)
That really helped me once when I needed to try something using Chez Scheme which doesn't provide network connectivity out of the box. No problem with CGI, though.