httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yehuda Katz <>
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 <>

> 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 and
>, when I execute a2dissite I get
> (its contents) and if I execute a2dissite
> I get (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
Now when you disable a site using a2dissite, you will get the error message
from the default vhost.

- Y

View raw message