apache vhost problem
Hello.
First i will explain the structure of my small home lan. So i have router which is also a firewall and a real ip asigned to it for ext eth0 + internal eth1 and 192.168.1.1 ip asigned to it. Now i have domain register to my external ip - domain.com. But now the problem is that i run apache server on one of machines on my internal lan with ip 192.168.1.10. I have configured iptables script on my router so everything works fine, i can browse ''mydomain.com'' from my internal newtwork and people from internet can do. But i want to run virtual hosts for example "harmonyofsoul.mydomain.com" (this subdomain is registered also to my external addresse) on the same apache and on the same interface with ip 192.168.1.10. When i do this in the right section of my httpd.conf, and restarted the server i still get what i have in my /var/www/htdocs This is what i write in my httpd.con: NameVirtualHost 192.168.1.10:80 <VirtualHost 192.168.1.10:80> DocumentRoot /var/www/harmonyofsoul ServerName harmonyofsoul.mydomain.com </VirtualHost> Still no result am getting what i have in my /var/www/htdocs How can i fix this problem? |
In Apache, you have to have a virtual host for all sites, including your primary /var/www/htdocs site. For example:
Code:
NameVirtualHost *:80 Hope this helps a little. If not, check here http://httpd.apache.org/docs-2.0/vhosts/name-based.html for Apache 2 docs, or here: http://httpd.apache.org/docs/vhosts/name-based.html for Apache 1 docs. |
EDIT: I just deleted what I wrote. I'm getting ahead of myself..... ignore this second post of mine :o
|
I'm trying to get something very similar working.
I have a static internet addressable IP. We have several domain names for which we control the DNS. My Apache server is behind a Netgear FR114P firewall. The firewall is forwarding all http traffic to the Apache server. No matter which name we use on the outside of the firewall, we get sent to the same VirtualServer. Looking at the logs in the firewall, the traffic all appears with only the IP (no domain names). My hunch is that the names are stripped out be fore the Apache server gets hit, so all its seeing are the IPs and cant do the name based virtual host re-direction. I've poked all around the options in the firewall and dont see anything obvious to keep and pass the domain name along to the server. Is it possible to do this sort of thing, or do I need to put the web server outside the firewall? Thanks! Quote:
|
The docs do explain it, but it took me finding a post another forum to really understand.
http://httpd.apache.org/docs/2.0/mod...amevirtualhost Quote:
Individual VirtualHost blocks, all with that same IP but the Servername and DocumentRoot appropriate for each of the separate domains. It works just fine. |
All times are GMT -5. The time now is 06:55 AM. |