Ja, das geht, Ich habe es zu Hause so am Laufen:
Datei hosts:
(Diese Datei muss "hosts" heissen und nicht hosts.txt oder hosts.sam oder... Du musst sie meist neu anlegen. Wo?
Windows 95/98/ME c:\windows\hosts
Windows NT4/2000/XP c:\windows\system32\drivers\etc\hosts
Linux: /etc/hosts
127.0.0.1 localhost
127.0.0.1 www.meinweb.local meinweb
127.0.0.1 anderes.web.von.mir.local anderesweb
Verwende nicht: www.meinweb.de, weil Du dann solange der Eintrag existiert auf www.meinweb.de zugreifen kannst. Dieser Eintrag ersetzt den Nameserver.
In der Grundausstattung mag das genügen und funktionieren. Aber um es kompfortabel zu haben wäre wünschenswert, wenn verschiedene Rechnernamem zu verschiedenen verzeichnissen führen würden. Stimmts?
Also: httpd.conf (c:\apache\conf\httpd.conf oder /etc/httpd/httpd.conf) in etwa so:
NameVirtualHost 127.0.0.1
<VirtualHost localhost>
ServerAdmin webmaster@localhost
DocumentRoot C:/apache/htdocs/
ServerName localhost
ErrorLog logs/error_localhost.log
CustomLog logs/access_localhost.log common
</VirtualHost>
<VirtualHost www.meinweb.local>
ServerAdmin webmaster@localhost
DocumentRoot C:/apache/htdocs/www.meinweb/
ServerName www.meinweb.local
ErrorLog logs/error.www.meinweb.local.log
CustomLog logs/access.www.meinweb.local.log common
</VirtualHost>
<VirtualHost anderes.web.von.mir.local>
ServerAdmin webmaster@localhost
DocumentRoot C:/apache/htdocs/anderes.web.von.mir/
ServerName anderes.web.von.mir.local
ErrorLog logs/error.anderes.web.von.mir.local.log
CustomLog logs/access.anderes.web.von.mir.local.log common
</VirtualHost>