Question

Je l'ai téléchargé et installé l'image en mode Virtual PC Microsoft et Windows XP pour tester IE6. J'ai plusieurs projets sur localhost que l'accès I par les numéros de port dans mon fichier vhosts, par exemple:

Listen *:82
<VirtualHost *:82>
    DocumentRoot "path/to/htdocs/project-folder/public/"
</VirtualHost>

Dans la machine virtuelle j'ai changé le fichier hosts afin que http://mymachine redirige vers mon répertoire localhost racine (équivalent à http://localhost:80/).

Comment puis-je configurer la machine virtuelle de sorte que http://project-n/ va au port localhost correct? Et malheureusement, http://mymachine:82/ ne fait pas le travail = (

Était-ce utile?

La solution

Sur l'ordinateur virtuel, dans le fichier hosts j'ai ajouté

xxx.xxx.xxx.xxx      project-n.dev

o'u les x sont l'adresse IP de mon ordinateur hôte.

Dans mes ordinateurs hôtes fichier httpd-vhosts.conf je changé le *: 80 port à localhost: 80. Je ne sais pas pourquoi cela fonctionne, tout ce qu'il fait.

Mon fichier httpd-vhosts.conf ressemble maintenant à:

<VirtualHost localhost:80>
    DocumentRoot "path/to/htdocs/"
</VirtualHost>

<VirtualHost *:81>
    DocumentRoot path/to/htdocs/project-a/"
</VirtualHost>

<VirtualHost *:82>
    DocumentRoot path/to/htdocs/project-b/public"
</VirtualHost>

Maintenant, dans le PC virtuel, quand je goto « http: // projet n: 81 / » il se chargera des projets a, et ' http: // projet n: 82 ' charges projet- b / publique = D

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top