LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to disable all subdomain on apache2? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-disable-all-subdomain-on-apache2-211260/)

gepesz 07-29-2004 09:00 PM

How to disable all subdomain on apache2?
 
Hello gurus,

I have apache2 running on my Debian Sarge box. I just got my domain name and was about to setup subdomains under it when I realized that ALL subdomains are currently active!! This is what I want to disable.

For example, say I have a website under www.mysite.com. The problem is that all these requests go to the same website:

- mysite.com
- asdf.mysite.com
- anythinghere.mysite.com

How can I disable these subdomains? How can I disable ALL subdomains?

zatriz 08-01-2004 03:44 AM

If every subdomain resolves to your ip address then The problem is not with apache but with your dns configuration at your domain provider. Its probably set to forward everything to your ip address just delete that mx record from you dns configuration or change it so that only www is set to be forwarded within that mx record.

peter_robb 08-01-2004 03:20 PM

There are 2 systems working for http name resolution.. dns and url
(mx records are just for mail zatriz and won't apply to gepesz's http question)

dns tries to find a server that will match the url asked for, so you either delegate this to a dns provider, or do it yourself with your own dns server. Very few isps allow you to manage your subdomains remotely, but you can always ask them.. It's included in a commercial contract but not normally in a domestic contract.

If your isp by default resolves everything to your box, then apache has to filter it.
apache has virtual servers that match what you specify, and a default server that handles the rest.
If you want to stop the default page from being given for crazy http urls, make it a 404 ERROR page and only have valid virtual sites.

If you have your own dns server, you need to tell your isp to forward all requests to you so that you can manage all the subdomains yourself..

The difference between the 2 ideas is that with your own dns server, apache never gets a connection for a bad url, but the dns server does, which is less and faster traffic.

zatriz 08-01-2004 04:52 PM

Sorry My mistake on the first post I meant A records not mx


All times are GMT -5. The time now is 11:43 AM.