PDA

View Full Version : vhosts by hostname, not ip


Dutchy
4th November 2009, 14:32
I have to configure and fix an existing ISPConfig 3 install and I encountered the following problem:

For all websites I create, vhosts are made in the form:
<VirtualHost ip:port>

This is wrong when it should be:
<VirtualHost domain.example.com:port>

I imagine this is a setting somewhere, but I have no idea where to look. I could obviously fix all these manually, but I hope somebody has a better idea?

till
4th November 2009, 15:35
Thats not wrong, the setting ip:port is absolutely correct.

Dutchy
4th November 2009, 17:23
If it is correct, would you be so kind as to explain why this is correct?

We have multiple domains pointing to the same IP and we want to run multiple sites on multiple (sub)domains. Coming from an Apache configs background myself, i would use VirtualHosts for this.

I get the idea this is not the way ISPConfig works, but I don't quite understand what should be used to do this then.

till
4th November 2009, 17:33
We have multiple domains pointing to the same IP and we want to run multiple sites on multiple (sub)domains.

Thats the standard way in configuring it and ispconfig uses virtualhosts for this. In ISPConfig, either select the IP address for all sites or select * for all sites.

See apache virtualhost documentation:

http://httpd.apache.org/docs/2.0/vhosts/examples.html

you always use * or the IP address in the virtualhost directive and not the domain name. The domain name is used in the ServerName directive and thats exctly how ispconfig configures it.

You should assiume that if a controlpanel is used many thousand hosting servers worldwide that it is able to configure virtualhosts then ;)

Dutchy
4th November 2009, 18:55
You are right, I should assume that :) (in most cases)

I have things working now, after a manual graceful restart of apache, not sure why it did not work before. I only noticed that it does not work with *:80 but I don't care about that at this point.