If you have multiple sites configured on the same IP address and port, then the hostname in the http request has to match the name of the site.
This means that if you've setup your second site as 'someother.com', then that's the URL you have to request: http://someother.com/
If you use any other hostname (e.g. http://www.someother.com/ ) it won't work since the name doesn't match.
If the name doesn't match then the default site will be used.
Somewhere in that dopey GUI, there's a (I think) checkbox that's supposed to be the default allowing for name based virtual hosting. Perhaps it got unchecked/selected?
The money line in httpd.conf is NameVirtualHost for name based virtual hosting.
Just for fun, you may want to run:
sudo apachectl configtest
and check /var/log/httpd/error_log
Those should point you to the problem.
I did make sure to enable the virtual host module. I think that's what you're talking about with a checkbox in the GUI, anyway.
I ran that test, and the results didn't show any errors- just a number of warnings that look like:
[Thu Dec 21 21:27:21 2006] [warn] long lost child come home! (pid 552)
They all had different timestamps and different pid's. From the timestamps, it would appear that these are all from when I was testing the config trying to get it to work a few days ago.
The virtual_host module just introduces the concept of virtual hosts to the core Apache server. It doesn't do anything towards selecting name based or IP based virtual hosting.
TBH, I know that name based virtual hosting is the default setup in Apple's implementation. The times that I've tried to use the stupid GUI, all it's done is anger me so I just edit the files by hand. I'm not really familiar with the GUI.
Sometimes working late at night, I forget to check the "Active" box next to the site's name.
Try this. Deactivate the first site that keeps on appearing and Activate the other site that doesn't work for you. Restart the Web service and see if you can now view the second site. If not, you've got some config problems within the second site.
Are you comfortable with pico? Using the Terminal.app, open the file /etc/httpd/sites/virtualhostglobal.conf.
You should see a line similar to:
Name Virtualhost 126.96.36.199:80
with your IP address.
Make sure that this line is not commented out with the "#" sign.
If you do not have this file, don't worry, it's not hard to recreate.
Extended Keyboard Server Mac OS X (10.4.7)
I finally figured it out.
In httpd.conf, at the end of the file there's a section stating to use all of the .conf files in the /etc/httpd/sites directory. Seemingly, Mac OS X Server sets up every site as a virtual host, and creates a .conf file for each site in this directory. The issue ended up being that the directive in http.conf was:
I removed the quotes and both of my virtual hosts are working now.
I don't know if this is a bug, or if there's supposed to be some other way to make this work.
Thanks for the help from all of you!