Underground Forum
- #1
Installing LAMP
In this tutorial, we will install the LAMP on a server running Ubuntu, and at the same time we will configure the server.Installing LAMP packages via the tasksel utility
This utility will allow you to install the entire LAMP stack in one command, tasksel can also be used on a Debian OS server.# Install tasksel
sudo apt -y install tasksel
sudo tasksel install lamp-server
Manual installation
Server preparation
# Update the package indexsudo apt update
sudo apt install ufw
sudo ufw enable
Install Apache + PHP
# To install Apache, use the commandsudo apt install php libapache2-mod-php
sudo service apache2 status
sudo systemctl start apache2
Install NGINX + PHP
# Install nginx и php-fpmsudo apt install nginx php-fpm
Add the following config so that nginx can handle php
server {
# . . . other code
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:q;
}
}
# Restart NGINX
sudo systemctl restart nginx
Install MySQL
# Run the MySQL installationsudo apt -y install mysql-server
# Check status
sudo systemctl status mysql
# If the service is not running, start it manually
sudo systemctl start mysql
# Run MySQL setup
sudo mysql_secure_installation