Hyperz Documentation > Knowledgebase > PHP Websites > Adding More Websites

Adding More Websites

Hyperz

Table of Contents


Step 1 - Folder Creation

First, we need to navigate to your /var/www directory.

Next, lets create a new folder, and you want to just name it your domain. So for example if my domain that I am setting up a PHP website on is https://store.hyperz.net/ then I would want to create a folder in this directory just called store.hyperz.net.

Now, paste in your PHP website files inside of this newly created folder. This includes your index.php and any other folder or files that are apart of your PHP website.

If your website has a configuration file. Feel free to fill that out at this point.


Step 2 - Configuration

Navigate to your /etc/nginx/sites-available/default file.

Add in a new server block for your PHP website:

server {
    listen 80;
    server_name example.com;
    root /var/www/example.com;
    index index.php;

    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        autoindex on;
        autoindex_exact_size on;
    }
}

Next, we can restart NGINX with sudo systemctl restart nginx.


Step 3 - SSL Certificate

Now it is time to create an SSL cert so our website can be secure! This is very easy to do as we have already installed Certbot!

Simply run this command in your terminal: sudo certbot --nginx -d example.com after replacing example.com with the domain you intend to create the certificate for.

Make sure you have pointed your domain to your VPS with a DNS A record already!

If it asks you for a redirect option, press 2.


Was this article helpful?

12 out of 24 found this helpful