How to setup virtual host in zend apache2.4 and window 7?

97 Views Asked by At

I am setting virtual host in my local but not success. pls help me check.

Server local info. Zend apache2.4 system: window 7.

my config: the content of file httpd.conf:

....
include  extra/httpd-vhost.conf
....

file httpd-vhost.conf:

<VirtualHost *:80>
     ServerAdmin girl.test
     DocumentRoot "C:\localhost\source"
     ServerName girl.test
     ServerAlias www.girl.test
     ErrorLog "logs\girl-error.log"
     CustomLog "logs\girl-access.log" common
 </VirtualHost>

 <VirtualHost *:80>
     ServerAdmin boy.test
     DocumentRoot "C:\localhost\source"
     ServerName boy.test
     ErrorLog "logs\boy-error.log"
     CustomLog "logs\boy-access.log" common
 </VirtualHost>

File: etc/hosts I add two line

127.0.0.1/source girl.test
127.0.0.1/source boy.test

After I restart service and go to:

  • girl.test get message

This site can’t be reached girl.test’s server IP address could not be found.

  • 127.0.0.1/source is work.

pls help me check, Many thanks.

1

There are 1 best solutions below

0
xanka On

I have fixed this issue when change file etc/hosts to 127.0.0.1 girl.test 127.0.0.1 boy.test