Reputation: 5896
I am able to access the sub domain in my local machine as follows test.localhost
but I need test.myMachineName
or test.myMachineIp
to access from another computer in my own network
I have setup the sub domain in my local wamp server as follows:
IN https-vhost.conf:
<VirtualHost *:80>
#ServerAdmin [email protected]
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
#ErrorLog "logs/dummy-host.example.com-error.log"
#CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
#ServerAdmin [email protected]
DocumentRoot "c:/wamp/www/test"
ServerName localhost
ServerAlias test.localhost
#ErrorLog "logs/dummy-host.example.com-error.log"
#CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
127.0.0.1 test.localhost
Upvotes: 1
Views: 1681
Reputation: 664
I don't understand your configuration. First, if you access test.localhost from another computer will not work because your website does not exist on that computer. You have to use the IP address and port forwarding in your router settings (Private IP: Computer local IP, Type: TCP, Range: 80 - 80).
In https-vhost.conf:
<VirtualHost *:80>
#ServerAdmin [email protected]
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
#ErrorLog "logs/dummy-host.example.com-error.log"
#CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
#ServerAdmin [email protected]
DocumentRoot "c:/wamp/www/test"
ServerName test.youripaddress
ServerAlias test.youripaddress
#ErrorLog "logs/dummy-host.example.com-error.log"
#CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
In HOST file:
127.0.0.1 localhost
youripaddress test.youripaddress
Ask me any questions.
Upvotes: 1