Cannot connect to Digital Ocean web server

Hello,I opened a Digital Ocean Ubuntu server with Docker and the followed the instructions to install OpenMRS on the server. Installen Maven and JAVA. Installation process completed with success. However, I struggle to connect to the webserver through the IP address. The IP address is 174.138.8.224 And the port should be 8080.

Can anyone here help me to fix this?

whats the full link you are using to connect ie the link you are trying to put in the browser,could it be some thing like http://174.138.8.224:8080/

Is this your external IP address for your docker instance ? doesn’t look responsive and port doesn’t look open

I use http://174.138.8.224:8080/openmrs

This is what i get trying to access the same.

Okay. I added port 8080 to the ports.conf file in apache2. How do I now make it open openmrs? It now goes to the apache2 landing page.

http://174.138.8.224:8080/

It does not open when I add /openmrs

Gives message: The requested URL was not found on this server.

Apache/2.4.41 (Ubuntu) Server at 174.138.8.224 Port 8080

when i go here http://174.138.8.224:8080/ i access your server,well it looks like there is an issue with the openmrs installation

are you able to access the full server logs

How do I pull the server logs on ubuntu

Which instructions have you followed? You shouldn’t need to add port 8080 to Apache. OpenMRS is served through a servlet container such as Tomcat. You could use Apache as a reverse proxy for the Tomcat container, e.g., using instructions like those here, e.g.,

# mod_proxy setup.
ProxyRequests Off
ProxyPass /openmrs http://localhost:8080
ProxyPassReverse /openmrs http://localhost:8080

<Location "/openmrs">
  # Configurations specific to this location. Add what you need.
  # For instance, you can add mod_proxy_html directives to fix
  # links in the HTML code. See link at end of this page about using
  # mod_proxy_html.

  # Allow access to this proxied URL location for everyone.
  Order allow,deny
  Allow from all
</Location>

But that assumes that OpenMRS is installed an running on port 8080, which doesn’t seem to be the case for you.

Thank you, but it is very strange. I follow the instructions as it is given and it just does not connect. Which installation instructions should I follow if I want to install it on a cloud server like digital ocean. In other words, which virtual machine do I setup, etc.? Cause somewhere I must be doing something wrong. I prefer the docker container. I started over and just started the docker container with the following command on a new system: docker run -d --name openmrs -p 80:8080 openmrs/openmrs-reference-application-distro

ip address: http://167.99.43.224:8080/openmrs

Still no refusing to connect. If I ping the ip address it works.

root@docker-openmrs:~# docker pull mysql Using default tag: latest latest: Pulling from library/mysql 15115158dd02: Pull complete d733f6778b18: Pull complete 1cc7a6c74a04: Pull complete c4364028a805: Pull complete 82887163f0f6: Pull complete 28abcb7f57e0: Pull complete 46d27a431703: Pull complete 8e745fe86aaf: Pull complete ab75add93486: Pull complete 09e3960383f3: Pull complete 59f780965951: Pull complete 8ead2303095c: Pull complete Digest: sha256:b17a66b49277a68066559416cf44a185cfee538d0e16b5624781019bc716c122 Status: Downloaded newer image for mysql:latest docker.io/library/mysql:latest root@docker-openmrs:~# docker rm -f openmrs openmrs root@docker-openmrs:~# docker run -d --name openmrs -p 80:8080 openmrs/openmrs-reference-application-distro 45de4e9bb556d9a1a9dde5d88285c8d27a4a9933cc388dce716d39663a8b3ed6 root@docker-openmrs:~# docker logs openmrs

  • DB_CREATE_TABLES=false
  • DB_AUTO_UPDATE=false
  • MODULE_WEB_ADMIN=true
  • DEBUG=false
  • cat /usr/local/tomcat/startup.sh: line 8: DB_HOST: unbound variable root@docker-openmrs:~#

So a few notes here:

  1. You also need to start the MYSQL Docker image.
  2. In your command to start the openmrs-reference-application-distro, you specify -p 80:8080 that says “bind the server port 80 to port 8080 from the container”. Since you’re apparently already running Apache which is likely using port 80, that’s unlikely to work.
  3. For a better method of installing this via Docker, please see Option 3 on this Wiki page.
1 Like

Hello, I eventually managed with the SDK. And used Docker for the database. Now it seems to be working. Thank you

Now I have a new problem. Tomcat fails to run. Why would this be?

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  05:57 min
[INFO] Finished at: 2022-03-16T15:45:36Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:4.4.0:run (default-cli) on project standalone-pom: Failed running Tomcat -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:4.4.0:run (default-cli) on project standalone-pom: Failed running Tomcat
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed running Tomcat
    at org.openmrs.maven.plugins.Run.runInFork (Run.java:230)
    at org.openmrs.maven.plugins.Run.executeTask (Run.java:112)
    at org.openmrs.maven.plugins.AbstractTask.execute (AbstractTask.java:201)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
root@openmrs2:~#

Could you try running the command with the -X flag to get the actual error?

This was the error code flagged

Only thing I can gather is maybe the virtual machine does not have enough memory. How much is advised? This one has 2gb

changed it to 4gb and now it is working.

Is it possible to run it as a service so that it does not stop when I exit the terminal?