I hope I post the question at correct place. If not, please forgive me.
I am running Slackware linux 4.0 with Apache 1.3.6, and would like to setup
Following the documentation coming with apache, first I tried name-based.
At the end of httpd.conf, added the following lines:
(I only tested it with loopback address)
Then I fired up apache server, run netscape, open http://www.test.com.
The browser complained that it cannot resolve name www.test.com. So I added
above two name in /etc/hosts, both point to 127.0.0.1. Restart apache server
and browser. Now both virtual hosts points to main_server's root (say,
/usr/local/apache/htdocs), not the location specified in VirtualHost section.
Aparantly, DocumentRoot in VirtualHost section did not take effect. And
apache documentation didn't say that those names should appear in /etc/hosts
Next, I tried port-based virtual hosts. Added Listen directives in main part
and put respective port number for each virtual host as:
<VirtualHost 127.0.0.1:port#>, kept others the same. After fired up server and
browser, I can only open the location as specified 127.0.0.1:port#, but not
the name as www.test.com (without putting them in /etc/hosts file), although
this time, they pointed to correct locations specified by DocumentRoot.
Could someone point out what I did wrong? Your time and suggestions are highly