Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
ServerAdmin webmaster@carrito.com
ServerName  carrito.com
DocumentRoot /var/www/carrito
<Directory /var/www/carrito>
  Options None
  Order deny,allow
  allow from all
</Directory>
</VirtualHost>

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

share|improve this question

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

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.