httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yehuda Katz <yeh...@ymkatz.net>
Subject Re: [users@httpd] Disabling virtual hosts in Apache
Date Tue, 31 Jan 2012 18:07:50 GMT
2012/1/31 Antonio Fernández Pérez <antoniofernandez@fabergames.com>

> Hi everybody,
>
> I would like to know how can I do to disable a virtual host and print an
> error page in virtual host not enabled. Having www.mydomain.com and
> www.mydomain2.com, when I execute a2dissite www.mydomain.com I get
> www.domain2.com (its contents) and if I execute a2dissite
> www.mydomain2.com I get www.domain.com (its contents).
>
> Please, can you tell me how can I do this? I would like to get to manage
> virtual hosts with different domains and to have the possibility to disable
> some virtual host, but having enabled another virtual hosts.
>

The a2dissite/a2ensite tools are part of the Debian-customized distribution
of Apache. The tool actually removes the vhost configuration from the files
included in the server's configuration. Apache does not even know that a
disabled site exists.

Here is my suggestion. Create a new vhost config with the filename starting
with 000 (or enable the included default vhost).
Set that vhost to show an "Site Disabled" error no matter what the request
is.
Now when you disable a site using a2dissite, you will get the error message
from the default vhost.

- Y

Mime
View raw message