-4

I am trying to set up a subdomain that serves a different website that what my main domain name serves. I am using Debian Stretch.

www.domain.name > my website
application.domain.name > separate application

I read up about virtual hosts, but it seems to only specify for completely different domain names. Are there any meaningful differences and how should I configure my A records as well? I am very new to website hosting and any advice is appreciated.

user121392
  • 13
  • 1
  • 6

2 Answers2

0

It's the same whether the second website is in the same domain or a completely different one.

pjz
  • 10,497
  • 1
  • 31
  • 40
0

Straight from the apache examples page

# Ensure that Apache listens on port 80
Listen 80
<VirtualHost *:80>
    DocumentRoot "/www/example1"
    ServerName www.example.com

    # Other directives here
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/www/example2"
    ServerName www.example.org

    # Other directives here
</VirtualHost>

Reference -> https://httpd.apache.org/docs/2.4/vhosts/examples.html

samson4649
  • 73
  • 4