D
D
DarkByte20152017-01-21 22:17:07
linux
DarkByte2015, 2017-01-21 22:17:07

LAMP or not LAMP, that is the question?

To develop sites in PHP for Linux, LAMP is usually recommended. So this LAMP is essentially just a collection of 3 programs: Apache, MySql, PHP. I had this question: is there any difference at all to install LAMP or just install these 3 programs? Or can it be considered only as a simplification in terms of the fact that it is necessary to enter not 3 commands, but 1 for installation? And yet, it seems that nginx is now much more popular as a server. Why doesn't LAMP include it then? Or at least there would be 2 builds with apache and nginx. And then if I install LAMP, then Apache will still be superfluous to me, and nginx will have to be installed separately.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
DevMan, 2017-01-21
@DarkByte2015

lamp is just the name of the stack.
and how to put it (individually or ready-made assemblies) the piano does not play much.

E
Evgeniy Volf, 2017-01-21
@Wolfnsex

And yet, it seems that nginx is now much more popular as a server. Why doesn't LAMP include it then?
It's all cheap marketing. Sure, nginx is faster in some cases, but that doesn't mean it's faster 100% of the time. At a low load and in the absence of gigabyte files downloaded by users at a speed of 64Kbps, massively - Apache gives quite good speeds, very comparable to Nginx.
Apache is "slower" not by 100 times, but usually by 1.5-2.5 times (average statistics, it is clear that the indicators can vary greatly depending on the tests). And usually this "slowness" manifests itself on really good loads. I would even say that Nginx is rather more resistant to high load attacks like DDoS than Apache, because consumes less resources due to the peculiarities of its architecture. But, it is worthwhile to understand that a web server is far from everything that can consume server resources, and no specific server will save you from illiterate settings.
Apache is much easier to configure, if only because it has a ".htaccess" mechanism, can you imagine the difference (logically) between "copy 3 lines and paste them into .htaccess" and "rewrite a piece of nginx config"? When you do this systematically and when the server is yours, there is no problem. And when the user has to do this infrequently, and even more so on some virtual hosting - Apache is a solution to several problems at once.
Setting up an Apache bundle + one version of PHP is much easier for an inexperienced administrator than a similar PHP+Nginx bundle. But, you understand that people who are well versed in server settings usually try to do something like apt install lamp
For development - there is no fundamental difference what kind of web server you have. As a dev400 colleague rightly pointed out, even this option works fine in some cases. Well, except for cases when your part of the application is tied to the architecture of a particular server.
From Apache it is much easier to cut out unnecessary modules or include the ones you need. Nginx, in most cases, will need to be rebuilt entirely from source (yes, I know about the plugin mechanism, but so far, this is not a panacea and not even close).
Not infrequently, Apache "hides" behind Nginx.
PS What do I use? Basically Nginx, by the fact that I'm used to it, by the fact that the servers are usually their own and "hardware", by the fact that the structure of a couple of large applications is tied to its features, by the fact that it turned out to tie several PHP versions and all sorts of other nonsense (historically) because I build it from source more than half the time...etc. But don't write off Apache just because you read somewhere that "Nginx is faster". Both servers have every right to exist, and both have their strengths and weaknesses. No need to try to optimize the site for load if it is visited by 30 people a month.
I don’t know how to install LAMP and whether there is a command to install exactly "LAMP"a, but nothing prevents you from typing something like "apt install apache php mysql" (conditionally) in the console and putting everything exactly the same as and install LAMP, or "apt install nginx php mysql" and install exactly the same, only with Nginx instead of Apache.
UPD. There is also Varnish, so offhand, in 70% of projects it will give simply enchanting performance, especially with its very fine tuning, enough memory, etc. I think it will show much better performance even in conjunction with Apache + PHP than "naked" Nginx+PHP, because will "spit out" entire pages from the cache, without even accessing the backend (or rather, doing it infrequently). But, this does not mean that everyone urgently needs to get together and run to put Varnish on every 2nd site with Wordpress and 100 people a year.

D
dev400, 2017-01-21
@dev400

for development there is php -S localhost:8000

V
Vincent1, 2017-01-21
@Vincent1

If there is no desire to mess around with the intricacies of settings, then LAMP.
If you understand well (or have a desire to understand) how you can optimize the software through configs, then separately.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question