How to access the Tomcat that is inside a Vagrant machine?

0

I'm starting to learn about Vagrant. I started provisioning a machine with Centos 7 Minimal, I installed Java and Tomcat, I ran Tomcat, I checked the processes it is running, but I can not access it through my machine.

I configured a static ip for this machine in several ways, but the last configuration was as follows:


Vagrant.configure(2) do |config|

  config.vm.define :tomcat do |tom|
      tom.vm.box = "relativkreativ/centos-7-minimal"
      tom.vm.network "private_network", ip: "192.168.33.10"
  end

end

I ping from my machine on the ip that I set up (192.168.33.10) and everything is fine, even when I turn off my Vagrant vm the ping stops working as it should.

Apparently all right but I can not access the URL through my machine: link stating that the page is not available. But when I check in vm port 8080 is being used by java also as it should be.

If you serve as extra information:

  • My machine is a Mac
  • Yes, all the settings in the Vagrant that I made came from vm
  • Both java and tomcat installed via yum

Does anyone know what it could be? How do I access tomcat from my machine? :)

    
asked by anonymous 19.07.2015 / 22:14

1 answer

0

I found several solution suggestions that were based on tweaking Tomcat settings, but in the end I found the correct solution to the Centos firewall.

The solution is to enable port 8080 on the firewall with the following commands:


    firewall-cmd --zone=public --add-port=8080/tcp --permanent 
    firewall-cmd --reload

This solution was found in serverfault: link

    
27.07.2015 / 01:30