je me demande si je fais quelque chose de malConfiguration d'Apache vhost: sites ayant des sites internes. possible?
i ont http://localhost
pointant vers le répertoire D:\Projects\Websites
alors je veux créer un site intérieur http://learningzf
en D:\Projects\Websites\php\ZendFramework\LearningZF\public
. il en est ainsi que je peux utiliser les URL comme /users/login
au lieu de spécifier l'URL complète
je trouve que si j'ajouter l'entrée en vhosts
au point http://learningzf
-D:\Projects\Websites\php\ZendFramework\LearningZF\public
, localhost pointera également D:\Projects\Websites\php\ZendFramework\LearningZF\public
<VirtualHost *:80>
DocumentRoot "D:/Projects/Websites/php/ZendFramework/LearningZF/public"
ServerName localhost
</VirtualHost>
<Directory "D:/Projects/Websites/php/ZendFramework/LearningZF/public">
AllowOverride All
Options All
Order allow,deny
Allow from 127.0.0.1
</Directory>
<VirtualHost *:80>
DocumentRoot "D:/Projects/Websites"
ServerName localhost
</VirtualHost>
<Directory "D:/Projects/Websites">
AllowOverride All
Options All
Order allow,deny
Allow from 127.0.0.1
</Directory>
i remarqué si je déplace les entrées pour learningzf
ci-dessous localhost
, les deux learningzf
& localhost
pointera vers D:/Projects/Websites
MISE À JOUR
suivant @KikoV answer, je l'ai modifié pour le faire fonctionner ...
NameVirtualHost 127.0.0.1:80
<VirtualHost localhost:80>
ServerName localhost
DocumentRoot "D:/Projects/Websites"
<Directory "D:/Projects/Websites">
AllowOverride All
Options All
Order allow,deny
Allow from 127.0.0.1
</Directory>
</VirtualHost>
<VirtualHost learningzf:80>
ServerName learningzf
DocumentRoot "D:/Projects/Websites/php/ZendFramework/LearningZF/public"
<Directory "D:/Projects/Websites/php/ZendFramework/LearningZF/public">
AllowOverride All
Options All
Order allow,deny
Allow from 127.0.0.1
</Directory>
</VirtualHost>
il semble maintenant, 'http: // localhost' va' C: \ Program Files (x86) \ Apache Software Foundation \ Apache2.2 \ htdocs' ... donc j'ai fait quelques changements ... ajouter ' DirectoryRoot' puis 'http: // learningzf' fonctionne. 'http: // localhost' pointe vers apache htdocs. J'ai donc changé '_default_' en' localhost'. code complet posté dans la mise à jour dans le message –
yup !, j'ai oublié le DocumentRoot ... désolé, – KikoV