0
I need to access a virtual host
of my machine, and of a device Android
(consume a API
)
When access the virtual host
with the name I defined in my hosts
"http://api.xpto/usuarios", I can receive the reply from API
normally, but when I try to access the IP
of my machine (example: http://192.168. 1.106/users), I get a reply similar to that:
E�_��l!/�Qe���b�����7�?�P�����@Gӗ(=�N��(����O�X��8���&M�8���z
���n֝�V�vq����$�`�^��� Y�z�
My file of hosts
:
127.0.0.1 api.xpto
127.0.0.1 client.xpto
My virtual host
:
<VirtualHost *:80>
DocumentRoot "c:/wamp64/www/api/pubic"
ServerName api.xpto
ErrorLog "logs/apache_error.log"
CustomLog "logs/apache_access.log" common
<Directory "c:/wamp64/www/api/public">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Has anyone gone through a similar situation? I’m using Windows 10 with WAMP
to the apache
.
Virtualhost is responding to "api.xpto" because it wants to use IP?
– lcssanches
@lcssanches if I try to access by 'api.xpto' on my Android device, connected on the same network, does not find the url, need to point to the IP of my machine, to find the virtual host.
– mauricio caserta
If you have access to the router, you can try putting the "api.xpto" on the router hosts via FTP or SSH. Also check the Apache error log .
– lcssanches
This putting in router hosts I usually do how much I need to do this kind of test.
– lcssanches