Accessing openmrs in vagrant through host machine IP issue

I have set up port forwarding in vagrant file from

Host port 443 to guest port 443 Host port 8070 to guest port 8069

The above works fine when I browse

https://localhost/bahmni (bahmni) http://localhost:8070 (openerp)

However when I tried

http://localhost/openmrs

It doesn’t connect. But If I type exactly

http://localhost/openmrs/admin/index.htm it loads the page correctly. The issue comes again when I try to navigate any links in openmrs since the URL is never complete.

Anyone has any ideas why this is happening? Is there a workaround for this ?

Hi,

Try using config.vm.network "forwarded_port", guest: 443, host: 4443. Forwarding to 443 port on host doesn’t work as it is a privileged port (< 1024). You can access OpenMRS using https://localhost:4443/openmrs/ or Bahmni using https://localhost:4443/bahmni/home/index.html#/login. Please refer to https://www.vagrantup.com/docs/networking/forwarded_ports.html for more details.

Port forwarding from host 443 to guest 443 works for Bahmni but not for OpenMRS (this is what I am experiencing).

I tried to change the forwarding from host 4443 to guest 443 and get the same result… Please see the screenshot below

This issue looks specific to Windows. I am not facing any issue in my Ubuntu machine. Please visit https://groups.google.com/forum/#!forum/vagrant-up for help regarding Vagrant.

Which version of Bahmni are you using? The httpd logs are present at /var/log/httpd. Check the access and error logs for a specific error.

vagrant version 1.8.7

ssl_access_log

10.0.2.2 - - [19/Jan/2017:12:12:34 +0530] “GET /openmrs HTTP/1.1” 302 -

ssl_request_log

[19/Jan/2017:12:12:34 +0530] 10.0.2.2 TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 “GET /openmrs HTTP/1.1” -

I’ve posted the same issue in the group channel https://groups.google.com/forum/#!topic/vagrant-up/Fjo6uWSyafY

I found myself a solution after searching online. Instead of using port forwarding I added this line instead in the vagrantfile

config.vm.network :public_network, ip: “192.168.0.117”

This way the other machines in the network will need to access through that IP address.

Nice. Is it working fine now?

Yes it is :slight_smile:

1 Like

Hello @abiieez.

I added this line in my vagrant file but nothing worked. I cant access the system on my machine…I cant also even ssh to that IP address.

Is there any config am missing.Or any other thing to virtualbox… U can share ur vagrant file for comparison may be…

Thank you