Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wish to create a several number of virtual hosts which I want to access them via port and name. For example, I have two websites, one http://carrito:8080 and http://pagina:80. At first glance it works, but when I write on the browser http://pagina:8080, it sends me to the carrito web page. I want Apache to deny me access to the website instead of redirecting me to the other. How can I accomplish this?

My configuration on the ports.conf is as follows:

NameVirtualHost *:80
Listen 80
NameVirtualHost *:8080
Listen 8080

And the virtual host configuration is:

<VirtualHost *:8080>
DocumentRoot /var/www/carrito
<Directory /var/www/carrito>
  Options None
  Order deny,allow
  allow from all

The configuration of the other virtual hosts are ver similar, except for their respective data of name, directory etc.

share|improve this question

One way is to make a dummy website and place it's definition first in the configuration file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.