[HELP] vhost apache2

edited May 2018 in Help
hello guys, i'm from indonesia. i had trouble with my instance. specially for vhost. i created my instance with one-click lamp stack application. now, i have 2 domains for that instance. the domain was pointing to ns vultr. in the dns manager i just setup that 2 domain with some subdomain. the domain: hijra.id and genoffe.com. i created sub with api.hijra.id then i created vhost for domain that redirect to specify folder. domain genoffe.com point to wordpress. but when i access to another subdomain example demo.hijra.id or demo.genoffe.com that can be accessed normally. i dont know the keyword for search this issue. of course i have bad english too. i need some human help here. thanks a lot for read my discuss

Ubuntu 16.04.4 LTS


  • Hello,

    I'd recommend starting with Apache's documentation for name based virtual hosting, this may point you in the right direction: https://httpd.apache.org/docs/2.4/vhosts/name-based.html

    Their docs also describe the default behavior if you don't have a vhost match:

    "If no matching ServerName or ServerAlias is found in the set of virtual hosts containing the most specific matching IP address and port combination, then the first listed virtual host that matches that will be used."

    Best regards.
  • "...then the first listed virtual host that matches that will be used." how do i know the first ? i've some *.conf

    thank you for reply
  • i see now, it is based on file name, right? then i rename http.conf and https.conf to file with number in front of it. thanks for the clue. my problem solved now :-D
  • Glad to hear that you were able to resolve that problem!
Sign In or Register to comment.