I am running apache 2 on our development server here in our office. For forever I had just 1 domain pointing to it but now I need to get another one setup and ready to do some extra bonanza stuff. I am trying to split everything into 2 different directories, /var/www/ for the 1st domain and the /var/www2/ for the 2nd domain. I am trying to use a virtual host to do this but its just not taking.
The first domain is tallinn.rakeback.com and the new one I am trying to get to point to /var/www2/ is uus.rakeback.com. I have this at the end of my httpd.conf file:
but this doesn't work when I go to the domain. if I change the domain to the * it throws every request into there so I at least know it works the problem is that the server does not seam to recognize that the domain that was requested was uus.rakeback.com. How can I fix this and get this to work properly?
Well that does pretty much the same thing as mine was doing. I need tallinn.rakeback.com to go to /var/www/html and uus.rakeback.com to go to /var/www2/html and neither of those are working. The server does not seam to figure out what domain is being requested.
Where do your requests end up?
"/var/www/html" or "/var/www2/html"?
I have same thing set up, various domain names leading to different directories on one server, but i'm currently still at work(sort of...) and don't have access to that httpd.conf file, so I can't exactly tell you how I managed it until I get home, which will be in a couple of hours.
Edit: I have noticed that even though apache does not seam to understand that I am requesting different domains, my PHP sessions are not carried between the 2 so even though the same page loads, if I am logged in on 1 then that does not make me logged into the other. Not sure if that means anything but ya....
I'm home. Looked up on my configuration, and its pretty much what you already did, and what I posted.
Do your have VirtalHost for tallinn.rakeback.com set up,and how does it look?
This should work. It's exactly like mine configuration, only with your values:
I don't have a virtual host setup for tallinn.rakeback.com since it was the only domain pointing to that server until today. I tried your example but it just throws both domains to whatever the first entry is.
I am not sure where to find my apache log file but I get no errors on httpd restart or anything so not sure.
and when I startup apache I get this error message:
Starting httpd: [Wed Apr 02 11:47:03 2008] [warn] VirtualHost tallinn.rakeback.com:0 overlaps with VirtualHost uus.rakeback.com:0, the first has precedence, perhaps you need a NameVirtualHost directive
Soooo I am thinking this is my problem. How do I fix this?
Hooray! It took a bit extra because with your config and with mod_ssl it forces you to be in https at all times. After I realized that under https everything was working properly I changed my config to this: