Skip to content

u/ebbv

In this archive from Dec 2010 to May 2015

0
posts
178
comments
0
media
488
score

Nginx is ridiculously easy to learn, and my feeling is people who rely on Apache modules for functionality necessary to their application are designing their application wrong.

That said, you CAN make Apache almost as fast and efficient as nginx, it's just easier to install nginx and get that speed and efficiency out of the box.

I'm sure it is 100% a case of the people in charge of the decision at Slack know Apache and don't know nginx, as you said. But I think learning nginx takes no time at all. I made the switch for our internal servers a few years ago and it was really painless.

-14 points

Oh please. Don't get over defensive just because I called you out on your ridiculous claim that web apps cause a beach ball due to AJAX requests.

Yes, the calculation will take longer when you have to do an AJAX request instead of doing it in JS. But it shouldn't be more than a fraction of a second, unless your server is having issues, it will be plenty fast.

OP wanted a solution for having to duplicate logic. I provided a total reasonable one. If you think making AJAX requests in a JS app is not doable you are the one who doesn't know anything about writing web apps. Because that's exactly how the web works.

1 points

Your assertion that PHP-FPM is only better than Apache with mod_php on multi0core servers is baloney. It depends on what your restriction is.

PHP-FPM has other advantages over mod_php, not least of which is not having to fire up additional PHP processes for every visitor to your site. Even on a single core server, this can be advantageous. Especially if your limiting factor is memory and heavy site usage is causing Apache to actually end up using a pagefile.

The bottom line is while yes, you CAN configure Apache to use PHP workers and be more comparable in performance to the default nginx configuration, Apache is bloated. Nginx is more stable and uses less resources to do the same job. Unless the project necessitates using Apache, I always use nginx.

1 points

Definitely if it's working for you don't rework everything.

BUT, if you're going to switch servers anyway, I think it's worth making the jump for a few reasons.

  1. Your HTTP server and your PHP workers SHOULD be separate processes. When you need to restart/reload one of them it shouldn't break both. Going to NGINX separates out the HTTP server from your PHP workers necessarily.

  2. NGINX w/PHP workers uses a lot less memory than Apache when you've got a lot of users hitting your site. It's also usually faster while using less resources.

I realize you can configure Apache with PHP workers, but it's not how most people run Apache. And if you're going to set up Apache that way, IMHO it's better to just switch over to NGINX which is much leaner than Apache.

As far as your rewrite rules, it's really not hard to port those over to NGINX. I'd say when you're hitting that point though, make sure whatever you're doing with rewrite rules really should be done with rewrite rules. A lot of people do application routing in rewrite rules just because it's so easy with .htaccess files, but that's a bad way to go and you should fix your application if that's what's going on.

2 points

I realize that. That should have been obvious to you from my last comment.

People use LAMP as a shorthand, though, to refer to any similar PHP stack. It's not 100% accurate but it's a lot easier than spelling out all the possible variations or saying "Unix-y PHP stack".

1 points

Yeah, developing for LAMP on Windows is like developing for .NET on Linux. Well, not quite that bad, but you get my point. People who are developing a web app on Windows are usually going to use .NET. And if someone is going to develop PHP (or Ruby, Node, etc.) they will usually be on Linux or OS X.

So if your new machine is a dedicated development machine I would strongly recommend dual booting Ubuntu or something.

1 points

There are no good programming patterns that use eval. People use it because they are solving a problem the wrong way. Don't use it.

EDIT:

People saying that you shouldn't trust user inputs are right, you shouldn't. Ever.

But you ALSO shouldn't use eval.

1 points

They're being complete idiots. Any program written in any language can be secure or insecure, there's nothing about the language itself that guarantees it will be one or the other.

If they're concerned about the security of the scripts then an audit should be done.

9 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.