S
S
svd2222015-10-23 00:40:50
Apache HTTP Server
svd222, 2015-10-23 00:40:50

How to create an alias for a virtual host on a virtual machine?

Have VHost apache2 on Debian Guest Jessie

<VirtualHost *:8081>
   ServerName myserver
   DocumentRoot /var/www/myserver
   ErrorLog /var/www/myserver/error_log
   CustomLog /var/www/myserver/access_log combined
</VirtualHost>

In VMWare, I configured port forwarding
localhost:9001 -> 192.168.153.131:8081
On host Windows 7 (apache2 is also installed), when opening localhost:9001, VHost opens as expected
Question: how and where to configure the config so that you can open this VHost on the host not localhost:9001 but myserver ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2015-10-23
@Stalker_RED

Open with notepad C:\Windows\System32\drivers\etc\hosts
Enter there 127.0.0.1 myserver
And yet, it's better not just myserver, but myserver.local or myserver.dev
Browsers like to have a dot in the address bar. It will be a little more convenient.
PS: you still have to specify the port. Either forward port 80, or start a separate browser, set up a proxy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question