Ziel ist es verschiedene Webprojekte unter unterschiedlichen lokalen Adressen verfügbar zu machen:
http://webdesign.localhost
http://webentwicklung.localhost
Windows hosts-Datei editieren
- 1. Start -> Alle Programme -> Zubehör -> Rechtsklick auf Editor
- 2. Als Administrator ausführen
- 3. C:WindowsSystem32driversetchosts öffnen
- 4. Die hosts Datei um folgende Punkte ergänzen:
127.0.0.1 localhost
127.0.0.1 webdesign.localhost
127.0.0.1 webentwicklung.localhost
XAMPP/Apache für Virtual Hosts konfigurieren
- 5. Wechsel zu XAMPP Konfigurations-Ordner
INSTALLATIONS_PFAD/xampp/apache/conf/extra
- 6. Datei httpd-vhosts.conf um folgende Informationen ergänzen
NameVirtualHost 127.0.0.1:80
# Pfad muss angepasst werden
DocumentRoot INSTALLATIONS_PFAD/xampp/htdocs
ServerName localhost
# Pfad verweist auf Projekt-Ordner
DocumentRoot "INSTALLATIONS_PFAD/xampp/htdocs/webdesign"
ServerName webdesign.localhost
DirectoryIndex index.php
AllowOverride All
Allow from All
# Pfad verweist auf Projekt-Ordner
DocumentRoot "INSTALLATIONS_PFAD/xampp/htdocs/webentwicklung"
ServerName webentwicklung.localhost
DirectoryIndex index.php
AllowOverride All
Allow from All
- 7. Apache neustarten
Gestestet mit:
- Windows 7/8/10
- Apache Friends XAMPP (Basispaket) version 3.2.2