I have Apache running and serving a page for one application using its index.html file stored in /usr/lnms/html. I have another application that needs to serve a web page using another index.html file (I’ll put it in /etc/apache). I’d like to use the same Apache server. I believe this can be done with virtual hosts.
I’ve added the following to the httpd.conf file:
NameVirtualHost X.X.X.X
DocumentRoot /etc/apache
ServerName www.ernie
I’ve alsoadded a cname record that points www.ernie to ernie. The original page should continue responding to ernie and the new page should respond to www.ernie. I tried replacing the cname record with an A record, but the result was the same. The DNS side returned the proper IP address in both cases.
When I go to either page ernie or www.ernie the browser appears to rotate between the two pages (watching the connect statement at the bottom of the browser) and ultimately settles on the last page.
I’d really like to do this without adding another IP address to the server. I can move around pretty good on Unix but I am new to Apache so please give details or examples of Apache syntax/setup.
I’ve already visited www.apache.org/docs and man pages. I think I am close, but I am missing one or two important things. Any help is appreciated.
Thanks.