How to access localhost ports on a virtual machine?

I downloaded and installed the Microsoft Virtual PC and Windows XP image for testing IE6. I have several projects on localhost that I access by port numbers in my vhosts file, for example:

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

In a virtual machine, I changed the hosts file so that it was http://mymachineredirected to my localhost root directory (equivalent http://localhost:80/).

How to configure a virtual machine so that it http://project-n/switches to the correct local port? And, unfortunately, http://mymachine:82/does not complete the task = (

+3
source share
1 answer

On the virtual computer, in the hosts file, I added

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

x - IP- -.

- httpd-vhosts.conf *: 80 localhost: 80. , , .

httpd-vhosts.conf :

<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>

, , 'http://project-n:81/', -a, 'http://project-n:82 ' project-b/public = D

+2

Source: https://habr.com/ru/post/1751742/


All Articles