Score:0

How to disable a specific subdomain for apache virtualhost?

cn flag

I want to run one apache and one asp.net server at the same time. What i want to achieve:

apache: domain1.com, sub1.domain1.com, domain2.com,

asp.net: sub2.domain1.com

Currently i can't achieve this because in the current configuration:

apache: *.domain1.com

asp.net: completely shadowed i think

My current httpd.vhosts file:

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:\xampp\htdocs\domain1.com" 
    ServerName domain1.com 
    ErrorLog "logs/dummy-host.example.com-error.log" 
    CustomLog "logs/dummy-host.example.com-access.log" common 
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:\xampp\htdocs\sub1.domain1.com" 
    ServerName sub1.domain1.com 
    ErrorLog "logs/dummy-host.example.com-error.log" 
    CustomLog "logs/dummy-host.example.com-access.log" common 
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:\xampp\htdocs\domain2.com" 
    ServerName domain2.com 
    ErrorLog "logs/dummy-host.example.com-error.log" 
    CustomLog "logs/dummy-host.example.com-access.log" common 
</VirtualHost>

And my dotnet application is registered to http://[::]:8080 (in the config file the domain2.com was specified). I'm using Cloudflare for dns management and if sub2.domain1.com has no answer on port 80 it's gonna look for port 8080.

Thanks in advance!

in flag
Does this answer your question? [How can I forward requests from my web server?](https://serverfault.com/questions/1035016/how-can-i-forward-requests-from-my-web-server)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.