LAMP (Linux, Apache, MySQL, PHP):
```bash
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql
```
Configure MySQL root password and create a database as needed:
```pgsql
sudo mysql_secure_installation
CREATE DATABASE my_database;
GRANT ALL PRIVILEGES ON my_database.* TO 'user'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
```
Restart Apache: sudo systemctl restart apache2.
LEMP (Linux, Nginx, MySQL, PHP):
```bash
sudo apt install nginx mysql-server php-fpm php-mysql
```
Configure MySQL as above:
```pgsql
sudo mysql_secure_installation
CREATE DATABASE my_database;
GRANT ALL PRIVILEGES ON my_database.* TO 'user'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
```
Create an Nginx virtual host file under /etc/nginx/sites-available/example.com:
```nginx
server {
listen 80;
server_name example.com www.example.com;
root /var/www/example.com;
index index.php index.html;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}
```
Enable the site:
```swift
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
sudo systemctl restart nginx
```
Thank you for your feedback.
Sorry about that :( We'll work to make it better.
You voted before.
2 times viewed | 0 people fount it helpful