Link a domain name to my VPS

This article concerns version 2.4 of Apache HTTPD

  1. The domain name must point to the IP address of your VPS
  2. Connecting to the VPS via SSH
  3. Create the vhost file associated with the :
    nano /etc/apache2/sites-available/yourdomain.conf
  4. Add this to the :
ServerName yourdomain.tld
    ServerAlias alias.yourdomain.tld
    ServerAlias youralias.tld
    DocumentRoot /home/yourdomain/www
    	Options FollowSymLinks
    	AllowOverride All
  1. Save and close the file: CTRL+O, enter then CTRL-X
  2. Enable vhost in apache :
    a2ensite yourdomain.conf
  3. Restart apache :
    /etc/init.d/apache2 restart
Updated on May 24, 2023

Related Articles