I have read some articles on web hosting blogs and web hosts there mentioned to LAMP and LEMP but I really don't understand what they are. Can anyone tell me what is LAMP and what is LEMP stack? differences between LAMP stack and LEMP stack?
With a control panel such as cPanel all the elements needed for a lamp or lemp stack is included(nginx will need to be installed).
cPanel does not officially support nginx yet but you can set up nginx on cPanel using NginxCP installation script.
If you want to do a manual lamp install without using a control here is how.
Installing lamp stack on centOS 7 without using a control panel as root:
yum install httpd
systemctl start httpd.service
Set Apache to start at boot:
systemctl enable httpd.service
yum install mariadb-server mariadb
systemctl start mariadb
Enable MariaDB on boot:
systemctl enable mariadb.service
Finish setting up the MariaDB Install:
You will be asked for the root password. Because you didn't set it earlier, press Enter to set a password now.
Type "Y" to set the root password.
Enter and confirm the new password.
You will be asked more questions as part of the security configuration. Answer Y to these questions
yum install php php-mysql
systemctl restart httpd.service
create a file in /var/www/html/ called test.php
Enter the following into the file
go to http: //your server's IP address/test.php and make sure php is working.
Depends, are you using an .htaccess with your account with any rewrites? In such a case you will want to stick with LAMP (you can still use nginx as a reverse proxy frontend). Another option is to use an apache .htaccesss -> nginx convertor and use LEMP. The least hassle will come from using LAMP and extracting your host virtual configs from your httpd.conf file.
LAMP stack is consist of Linux, Apache, MySQL and PHP/perl/python. Below are the more details -
1. Linux - It is operating system. It is the base of stack component. So it can be Ubuntu, Centos etc.
2. Apache - Apache is web server. It can be used with Linux or Windows.
3. MySQL - It is relational database management system.
4. PHP/perl/python - These are server side scripting languages. You can use any of them.
LEMP stack consist of Linux,Ngnix, MySQL database, PHP/perly.python.
1. Major difference is that Apache webserver is replaced with Ngnix in LEMP. Ngnix pronounced as engine-X. That is why it's LEMP stack.
2. Ngnix can handle more requests concurrently than Apache. The same hardware produces the great output in Ngnix.
3. Apache slows down on heavy load. It will create new threads for consuming more RAM and CPU on heavy load. Ngnix can handle the heavy load with the same configuration and hardware. It will not create separate processes.
4. Apache refuses the new connections when load gets increase on server. Ngnix will never refuse the new connections as it can handle thousands of connections a time.
5. Deadlok occurs in Apache while Ngnix will never block any request.
6. Ngnix is faster and manage heavy load.
But in real scenario, both will work fine. Just it's mater of choice that what and how much processes you are going to run. If there are light weight processes then you can go with Apache.