1

I use a Ubuntu-Vagrant to make a API by Apigility. Apigility is installed and works very well:

$ sudo php -S 10.10.10.30:8888 -t public public/index.php
PHP 5.6.4-1+deb.sury.org~trusty+1 Development Server started at Tue Jan 27 13:40:23 2015
Listening on http://10.10.10.30:8888
Document root is /var/www/public
Press Ctrl-C to quit.

When I do a wget from inside the vagrantbox, I receive a wellformed html-file by Apigility. When I surf to the url (http://10.10.10.30:8888) from my guest-system (osX) than the site is not reachable.

The firewall seems also ok:

$ sudo netstat -tulpn

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:46165           0.0.0.0:*               LISTEN      619/rpc.statd   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2371/sshd       
tcp        0      0 10.10.10.30:8888        0.0.0.0:*               LISTEN      5717/php        
tcp        0      0 0.0.0.0:1080            0.0.0.0:*               LISTEN      1062/mailcatcher
tcp        0      0 0.0.0.0:1025            0.0.0.0:*               LISTEN      1062/mailcatcher
tcp        0      0 0.0.0.0:59106           0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      1010/php-fpm.conf)
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1016/mysqld     
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      572/rpcbind     
tcp6       0      0 :::22                   :::*                    LISTEN      2371/sshd       
tcp6       0      0 :::443                  :::*                    LISTEN      1345/apache2    
tcp6       0      0 :::42974                :::*                    LISTEN      619/rpc.statd   
tcp6       0      0 :::39553                :::*                    LISTEN      -               
tcp6       0      0 :::111                  :::*                    LISTEN      572/rpcbind     
tcp6       0      0 :::80                   :::*                    LISTEN      1345/apache2    
udp        0      0 0.0.0.0:19413           0.0.0.0:*                           794/dhclient    
udp        0      0 0.0.0.0:741             0.0.0.0:*                           572/rpcbind     
udp        0      0 0.0.0.0:51436           0.0.0.0:*                           -               
udp        0      0 0.0.0.0:44542           0.0.0.0:*                           619/rpc.statd   
udp        0      0 127.0.0.1:795           0.0.0.0:*                           619/rpc.statd   
udp        0      0 0.0.0.0:68              0.0.0.0:*                           794/dhclient    
udp        0      0 0.0.0.0:848             0.0.0.0:*                           -               
udp        0      0 0.0.0.0:111             0.0.0.0:*                           572/rpcbind     
udp        0      0 10.10.10.30:123         0.0.0.0:*                           2666/ntpd       
udp        0      0 10.0.2.15:123           0.0.0.0:*                           2666/ntpd       
udp        0      0 127.0.0.1:123           0.0.0.0:*                           2666/ntpd       
udp        0      0 0.0.0.0:123             0.0.0.0:*                           2666/ntpd       
udp6       0      0 :::741                  :::*                                572/rpcbind     
udp6       0      0 :::10482                :::*                                794/dhclient    
udp6       0      0 :::50958                :::*                                -               
udp6       0      0 :::111                  :::*                                572/rpcbind     
udp6       0      0 fe80::a00:27ff:fe3a:123 :::*                                2666/ntpd       
udp6       0      0 ::1:123                 :::*                                2666/ntpd       
udp6       0      0 :::123                  :::*                                2666/ntpd       
udp6       0      0 :::34952                :::*                                619/rpc.statd   

What can be the problem then?

Aerypton
  • 51
  • 4

1 Answers1

0

You can forward ports or make a private network: In the Vagrantfile you can add this line to forward port: config.vm.network "forwarded_port", guest: 80, host: 81 In the line bellow when "localhost:81" is accessed, the request will be forwarded to port 80 of VM. Or make a private newotk: config.vm.network "private_network", ip: "192.168.10.10" In this other line the guest VM will be accessed throug the IP 192.168.10.10, and you can acess it: http://192.168.10.10:8080 To make things simple you can add an entry to the hosts file on your sistem: 192.168.10.10 myvm and access: http://myvm:8080

Holpe this helps.