Digital Ocean vps build of Rocky

Hi! So its great that Digital Ocean offers Rocky Linux as a base install for a vps! Whenever I install a lemp stack (from command line only) the default website seems to work fine. Any time i try to install multiple sites it does not seem to work - probably some sort of nginx config error? It is very easy to install lemp stack via command line from ubuntu, Rocky is a bit different of course. NONE of websites offering tutorials seem to work tho for a rocky vps (lemp) with multiple domains.
Here are the commands I use- the multiple domains do not resolve tho.

sudo dnf update -y
adduser a2
passwd a2

usermod -aG wheel a2
Check the sudoers file with

dnf install nginx

sudo systemctl enable nginx

sudo systemctl start nginx
sudo dnf -y install @mariadb

$ sudo systemctl enable mariadb
$ sudo systemctl start mariadb


dnf install epel-release -y

dnf install dnf-utils -y

dnf module list php

dnf module reset php

dnf module enable php:remi-8.1

dnf install php php-cli php-mysqlnd php-gd php-curl php-sqlite3 -y

php -v

sudo dnf install php-fpm

sudo systemctl enable --now php-fpm

This is the default index.html page that is distributed with nginx on Rocky Linux. It is located in /usr/share/nginx/html.

You should now put your content in a location of your choice and edit the root configuration directive in the nginx configuration file /etc/nginx/nginx.conf.


sudo mkdir -p /var/www/

sudo mkdir -p /var/www/

sudo mkdir -p /var/www/

sudo chown -R $USER:$USER /var/www/

sudo chown -R $USER:$USER /var/www/

sudo chown -R $USER:$USER /var/www/

sudo chmod -R 755 /var/www

sudo nano /var/www/

sudo nano /var/www/

sudo nano /var/www/

sudo mkdir /etc/nginx/sites-available
sudo mkdir /etc/nginx/sites-enabled
sudo nano /etc/nginx/nginx.conf

Paste the following lines. The first line specifies the path to the directory containing additional configuration files. The second line increases the memory allocated to parsing domain names.

include /etc/nginx/sites-enabled/*.conf;
server_names_hash_bucket_size 64;

sudo nano /etc/nginx/sites-available/

server {
listen 80;


location / {
    root  /var/www/;
    index  index.html index.htm index.php;
    try_files $uri $uri/ =404;

error_page  500 502 503 504  /50x.html;
location = /50x.html {
    root  /usr/share/nginx/html;


sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/
sudo systemctl restart nginx