Ich führe Apache unter Windows XP über Xampplite aus und kann Hilfe bei der Konfiguration meines virtuellen Verzeichnisses gebrauchen. Folgendes hoffe ich auf meiner Entwickler-Box zu tun:
1 & 2 arbeitet daran, die Windows-Hosts-Datei zu bearbeiten und ein virtuelles Verzeichnis in der Datei Apache\conf\extra\httpd-vhosts.conf von xampp hinzuzufügen. Ich sehe nicht sofort, wie man 3 macht, ohne 4 durcheinander zu bringen.
Finde es heraus: benutze Alias für # 3 anstelle von VirtualHost, also:
Alias /myproject "C:/path/to/my/project"
<Directory "C:/path/to/my/project">
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
1) Machen Sie das Verzeichnis:
mkdir c:\xampp\sites\myproject
2) Bearbeiten Sie c:\windows\system32\drivers\etc\hosts so, dass es diese Zeile enthält:
127.0.0.1 meinprojekt
fügen Sie Folgendes zu c:\xampp\Apache\conf\extra\httpd-vhosts.conf hinzu:
NameVirtualHost myproject:80 <VirtualHost myproject:80> DocumentRoot c:/xampp/sites/myproject Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory>
3) Fügen Sie die folgenden Zeilen am Ende von c:\xampp\Apache\conf\httpd.conf hinzu:
Alias /myproject/ "/xampp/sites/myproject/" <Directory "/xampp/sites/myproject"> AllowOverride None Options None Order allow,deny Allow from all </Directory>
4) Lassen Sie DocumentRoot, Directory usw. in c:\xampp\Apache\conf\httpd.conf, um dies zu erreichen. Als Referenz wären diese Zeilen:
DocumentRoot "/xampp/htdocs" <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory> <Directory "/xampp/htdocs"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory>
Aktivieren Sie zuerst: LoadModule alias_module modules/mod_alias.so
<IfModule alias_module>
Alias /ddd "D:/prj/customer/www"
<Directory "D:/prj/customer/www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</IfModule>
Getestet auf WAMP 2.2 und seiner Arbeitsweise: http: // localhost/ddd
Fügen Sie in httpd.conf mutatis mutandis die folgenden Zeilen hinzu:
<IfModule alias_module>
Alias /angular-phonecat "C:/DEV/git-workspace/angular-phonecat"
</IfModule>
<Directory "C:/DEV/git-workspace/angular-phonecat">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride all
Order allow,deny
Allow from all
Require all granted
</Directory>
Dies hat auf meiner (Windows) XAMPP-Installation nach dem Neustart des Apache-Servers hervorragend funktioniert. Ich musste das "Require all grant" hinzufügen, aber ansonsten ist es so ziemlich dasselbe wie die obigen Antworten.
das Problem wurde behoben. Es fehlte das Verzeichnis-Tag.
NameVirtualHost myproject:80
<VirtualHost myproject:80>
DocumentRoot "D:/Solution"
<Directory "D:/Solution">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
NameVirtualHost myproject: 80 <VirtualHost myproject: 80>
</ Directory>
Muss sein:
NameVirtualHost myproject: 80 <VirtualHost myproject: 80>
</ VirtualHost>
grüßt;)