Create subdomain: Difference between revisions

From Utopia
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:




How to make a new subdomain on a Debian VPS, with an apache2  
How to make a new subdomain on a Debian VPS (Host Europe), with an apache2  




Line 10: Line 10:
{{code|cd /etc/apache2/sites-available}}
{{code|cd /etc/apache2/sites-available}}


{{Code}}
New Config:
{{code|cp 000-default.conf yourSubDomain.yourDomain.tld.conf}}
 
Let it at minimum look like this:
{{code|cat yourSubDomain.yourDomain.tld.conf}}
 
{{code|<VirtualHost *:80>
  ServerName yourSubDomain.yourDomain.tld
  DocumentRoot /path/to/your/subdomain/source
</VirtualHost>
}}
 
Enable site:
{{code|a2ensite yourSubDomain.yourDomain.tld.conf}}
 
Restart Apache:
{{code|service apache2 restart}}
 
 
==== DNS Config: ====

Revision as of 18:26, 16 April 2023


How to make a new subdomain on a Debian VPS (Host Europe), with an apache2


Apache Config:

cd /etc/apache2/sites-available

New Config:


cp 000-default.conf yourSubDomain.yourDomain.tld.conf

Let it at minimum look like this:


cat yourSubDomain.yourDomain.tld.conf


<VirtualHost *:80>

 ServerName yourSubDomain.yourDomain.tld
 DocumentRoot /path/to/your/subdomain/source

</VirtualHost>

Enable site:


a2ensite yourSubDomain.yourDomain.tld.conf

Restart Apache:


service apache2 restart


DNS Config: