I'm struggling with Proxy, host, httd.conf and httd_vhosts.conf and need some help to understand how it is supposed to work in my specific implementation.
First, let me try to explain what I'm trying to do.
I want to install a websimulator intended to be implemented on a server that is not connected to the internet. The user are using WS7 PCs connected to a WS7 server via a local network (workgroup or domestic network) or via a client WS of a Windows terminal server.
The simulator includes a copy of 150 different web sites, some of them dynamic (i.e with sql tables) and some of them static. The "index page" is a list of site categories, each item in a site category list includes the hyper link to the site e.g : http://www.example1.org. The corresponding site is stored in a directory : /xampp/htdocs/WebSimulator/example1
Let's examine the second implementation (WS terminal Server). In this implementation, I have set the following :
- hosts : 127.0.0.1 localhost
- httd.conf :
- ServerRoot "C:/xampp/apache"
- Listen 127.0.0.1:80
- ServerName WebSimulator
- DocumentRoot "C:/xampp/htdocs" <Directory "C:/xampp/htdocs">
- <Directory "C:/xampp/cgi-bin"> AllowOverride All Options None Require all granted </Directory>
- Include conf/extra/httpd-vhosts.conf
- httpd-vhosts.conf :
- <VirtualHost localhost:80>
ServerName localhost
DocumentRoot "c:/xampp/htdocs/"
</VirtualHost> - <VirtualHost *:80>
DocumentRoot "c:/xampp/htdocs/XebSimulator/example1"
ServerName www.example1.org
</VirtualHost>
- <VirtualHost localhost:80>
Unfortunately, I have observed that the "virtual hosts" directives are ineffective unless I add "127.0.0.1 www.example1.org" line in the host file.
My question is quite simple : is it mandatory to have a specific redirection line in the hosts file for each "virtual host" that I have to address on my server ?
Thanks in advance for your help.
PS : the other implementation is only different in the sense that I have to remplace 127.0.0.1 by the IP address of the server (or name in the workgroup) and have a the client browser connect thru a proxy file that give the server IP or logical address