Apache - VirtualHost setting not working?
Hi,
I just set up my Apache configuration file, and I added a VirtualHost (IP-based) for one domain that I am hosting on my server. There are no errors, however, the domain seems to be reading the htdocs folder instead of the DocumentRoot set for the VirtualHost. Here is the VirtualHost in question, of course with all domain/IP details removed. Code:
<VirtualHost the.ip.address.here> Code:
ServerRoot "/usr/local/apache" Thanks! Splenden |
Looks to me that it sees the default path: DocumentRoot "/usr/local/apache/htdocs" and doesn't have anything to tell it to look for a virtual host:
NameVirtualHost *:80 See: http://httpd.apache.org/docs/2.0/vhosts/examples.html |
Does that apply for an IP-based virtual host? I am using unique IPs for all of my sites right now.
Thanks! Splenden |
Not to be back-asswards, but a single server shouldn't have more than one WAN IP address. I can understand multiple NIC's for varied LAN IP's, but one machine should only be accepting / broadcasting to one WAN IP, and therefore, I do not think Apache is setup to work on multiple IP's.
Obviously, the *:80 or *:443 or *:whatever-port will allow it to glom over and serve HTTP(S) to all IPs that come up for the machine. However, I am not so sure this was intended to be used for differentiating directories to be served by IP address. None the less, I think your 'calling' of the VirtualHost directive is missing the port. Quote:
|
Dedicated servers and VPS'es can sometimes have more than one IP address - in fact, they usually do. It is not uncommon to see one machine with several IP addresses on it and one NIC.
I'll try the port thing and report back in the morning. Thank you. Splenden |
Quote:
I use IP-based virtual hosting (one nic, 4 addresses). I 'have to' as the 4 sites that I host (on an intranet) are all https sites; the only alternative is four dedicated servers. I might be wrong, but I can't imagine that a hosting provider buys a new server for every client that wants https. |
well... i hadn't thought about that.
although, i had thought that 'big servers' (the type that do hosting for various websites and such) just used domain name virtual hosting. ie -- joeblow.com and myothersite.com would both redirect to the same IP, with virtual hosting taking care of sending requests for each to their respective directories. as far as https goes, taking into account what i just said, certificates don't really care what IP they're coming from, they reference the domain. as long as the issuer and holder are from the domain calling https, then it shouldn't be an issue... i've run 3 domain names from my single IP address, all with virtual hosting, and all were able to run https. |
I wonder how you got that working; I could not get it working as I get the message in my browser that the certificate is not valid for the domain (or something like that; can't remember exact text anymore).
from http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html Quote:
|
It was something in the config file. I decided to redo my config file and it worked fine. User error.
Thank you! Splenden |
You can only run one ssl server per port or address. To run more you must specify a separate port/address for each. ie: :443, 444, etc.
http://lists.freebsd.org/pipermail/f...il/000119.html You can only resolve on SSL certificate to any given IP/port configuration. Your apache conf file can be listening to 30 different IP address/port configurations, and have 30 seperate SSL certificates for each. <VirtualHost 123.456.789.1:443> <VirtualHost 123.456.789.1:444> <VirtualHost 123.456.789.1:445> <VirtualHost 123.456.789.1:446> or <VirtualHost 123.456.789.1:443> <VirtualHost 123.456.789.2:443> <VirtualHost 123.456.789.3:443> <VirtualHost 123.456.789.4:443> are all acceptable with the appropriate certificate entries in each container. You cannot however, have more than 1 SSL certificate for a single IP/Port configuration. |
All times are GMT -5. The time now is 05:58 AM. |