apache default page / sites-enabled/000-default

2 posts / 0 new
Last post
#1 Sat, 10/11/2008 - 14:58
pancholitis

apache default page / sites-enabled/000-default

Hi Folks,

After spending a lot of time searching the forum I didn´t find a solution for my problem.

I found, where the problem is, but not how to fix it:

Problems: The default Apache page seems to be the domain alphabetically first on the list of "sites-available" and not the default page.

Therefore every error happening on apache points to a certain domain/supdomain "aaaaa.aaaaa.com" (anymistake.bbbb.com) points to "aaaaa.aaaaa.com", which is no good at all.

Ronald mentioned the problem already, but I couldn´t find the solution to the problem.

Goal: -In case of errors/mistakes, the default mach should be "default" an not the 1. domain listed on "sites-available" -That all traffic coming in on a certain domain stays at the domain (virtual server).

facts: apache2/sites-enabled/000-default apache2/sites-available/default

Would a rename of apache2/sites-available/default to "000-default" fix the problem? This way, 000-default would be the 1st in line...

If this would work, what do I need to do?

I want to avoid to create 0000.com and then create a subdomain: 0000.0000.com on my server which would be maybe a workaround.

This problem afects subservers, subdomains and even domains...

Thank you in advance for your opinion on this.

Sun, 10/12/2008 - 10:40
Joe
Joe's picture

<div class='quote'>The default Apache page seems to be the domain alphabetically first on the list of &quot;sites-available&quot; and not the default page.</div>

There is no such thing as a &quot;default&quot; page in an VirtualHost configuration in Apache. The &quot;default&quot; is the &quot;first best match&quot; based on name:IP:port order in the request.

<div class='quote'>Would a rename of apache2/sites-available/default to &quot;000-default&quot; fix the problem? This way, 000-default would be the 1st in line...</div>

Yes. Though again, beware that Apache does first bast matching...and there is no such thing as &quot;default&quot;. If you have multiple IPs, you can easily confuse yourself about what's supposed to happen.

The ideal is to never expect &quot;default&quot; behavior in a virtual hosting system. e.g. use names exclusively for accessing your server. Names are completely predictable in a virtual hosting Apache configuration.

--

Check out the forum guidelines!

Topic locked