ThomasP: Apache/Win: Lokale VirtualHosts

Beitrag lesen

Hoi!

Warum einfach, wenns auch kompliziert geht? *g*

Da ich keinen Bock hatte, fuer localhost einen eigenen VirtualHost einzurichten, sieht meine lokale config. so aus:

httpd.conf:

<-------------------------- snip ---------------------------->
NameVirtualHost 127.0.0.2
NameVirtualHost 127.0.0.3
NameVirtualHost 127.0.0.4

<VirtualHost 127.0.0.2>
ServerName www.thomas-poenicke.de
...
</VirtualHost>

<VirtualHost 127.0.0.3>
ServerName www.texprint.de
...
</VirtualHost>

<VirtualHost 127.0.0.4>
ServerName www.sagichnich.de
...
</VirtualHost>
<--------------------------- snap ---------------------------->

hosts.loc

127.0.0.1 localhost
127.0.0.2 www.thomas-poenicke.de
127.0.0.3 www.texprint.de
127.0.0.4 www.sagichnich.de

hosts.www
127.0.0.1 localhost

wwwhosts.bat

copy c:\windows\hosts.www c:\windows\HOSTS /Y

localhosts.bat

copy c:\windows\hosts.loc c:\windows\HOSTS /Y

localhosts

#!/usr/bin/bash
cp /etc/hosts.loc /etc/hosts

wwwhosts

#!/usr/bin/bash
cp /etc/hosts.www /etc/hosts

so kann ich nach dem Befehl localhosts (und unter win apache-start) lokal testen und nach den hochladen und dem Befehl wwwhosts mir das ganze im Netz anschauen.

Gruß
Thomas