Access Java Jetty server on port 9999 using vagrants on the local machine

I installed the centos virtual server using Vagrant and Puphpet, inside the VM I have a java application running on the pier. "the server is running on http://127.0.0.1:9999 "

However, I had problems with this access from my local computer, I configured the port forward, so 9999 moved to 9999, but when I find awesome.dev:9999 or 192.168.56.103:9999, I get a website error.

Obviously, I lost something in my config.yaml puphpet file, I'm just not sure what.

               machines:
                    vflm_b214h6dav8jj:
                        id: machine1
                        hostname: machine1.puphpet
                        network:
                            private_network: 192.168.56.103
                            forwarded_port:
                                vflmnfp_hmt0pd4imhhd:
                                    host: '5997'
                                    guest: '22'
                                vflmnfp_b74egg9hlvog:
                                    host: '9999'
                                    guest: '9999'
                        memory: '1024'
                        cpus: '1'

If I have awesome.dev, then the welcome page I put on works, so I know the VM is up and running.

+4
1

:

" http://127.0.0.1:9999"

, .

, IP- , 0.0.0.0 ( IP-, )

jetty.host,

  • , :

    java -Djetty.host=0.0.0.0 -jar start.jar
    
  • connector

    <New class="org.eclipse.jetty.server.ServerConnector">
      <Set name="host">0.0.0.0</Arg>
      ....
    </New>
    
  • ant jetty-build.xml

    <systemProperty name="jetty.ant.server.host" value="0.0.0.0"/>
    
+2

Source: https://habr.com/ru/post/1659742/


All Articles