voyanttools / VoyantServer

GNU General Public License v3.0
66 stars 8 forks source link

VoyantServer for Linux-based system #33

Closed ac27037 closed 1 year ago

ac27037 commented 1 year ago

Hello,

Do you release VoyantServer which can be deployed on ubuntu linux? I found it as a windows launcher and cannot be used as a server in other operating system. Thank you!

ajmacdonald commented 1 year ago

Yes, you can deploy VoyantServer on Ubuntu. What are you having trouble with? There is a bit more documentation available here: https://voyant-tools.org/docs/#!/guide/server

Also, what is the "windows launcher" you're referring to?

ac27037 commented 1 year ago

Thank you for your reply!

I have established an ubuntu server without X11 environment, and want to set up VoyantServer to be a server on it. What I mean "windows launcher" is what the guide said "a control panel", which cannot be run with the X11 support. Could you please teach me how to do that? Thank you!

ajmacdonald commented 1 year ago

The main content of the release is a Java servlet. It is the contents of the _app folder you can find once you've uncompressed the VoyantServer zip file.

The control panel is simply a wrapper for an Eclipse Jetty server used to deploy the servlet locally. However there's nothing stopping you from deploying it in a different manner. The official Voyant server uses Apache Tomcat, for example.

You should be able to find guides online to help you with server setup. If you're having trouble let me know.

ac27037 commented 1 year ago

Thank you.

I tried it, but errors were like the attached. I just tried to put the "_app" in ROOT and to load index.jsp.

=================================== HTTP Status 500 – Internal Server Error Type Exception Report

Message Unable to compile class for JSP:

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: [14] in the generated java file: [/var/lib/tomcat9/work/Catalina/localhost/ROOT/org/apache/jsp/VoyantServer2_005f6_005f3/_005fapp/index_jsp.java] Only a type can be imported. org.voyanttools.voyant.Trombone resolves to a package

An error occurred at line: [2] in the jsp file: [/VoyantServer2_6_3/_app/resources/jsp/html_head.jsp] org.voyanttools.voyant.Voyant cannot be resolved to a type 1: <% // not sure it matters, but just in case, don't have any whitespace before doctype declaration (and possible redirects) 2: if (org.voyanttools.voyant.Voyant.preProcess(request, response)) {return;} 3: %><%@ page contentType="text/html;charset=UTF-8" %><% 4: StringBuilder url = new StringBuilder(); 5: /*

An error occurred at line: [139] in the jsp file: [/VoyantServer2_6_3/_app/resources/jsp/html_head.jsp] Trombone cannot be resolved 136: <% } %> 137: 138: <%@ page import = "org.voyanttools.voyant.Trombone" %> 139: <% if (Trombone.hasVoyantServerResource("header-include.html")) { %> 140: <%= Trombone.getVoyantServerResource("header-include.html") %> 141: <% } %>

An error occurred at line: [140] in the jsp file: [/VoyantServer2_6_3/_app/resources/jsp/html_head.jsp] Trombone cannot be resolved 137: 138: <%@ page import = "org.voyanttools.voyant.Trombone" %> 139: <% if (Trombone.hasVoyantServerResource("header-include.html")) { %> 140: <%= Trombone.getVoyantServerResource("header-include.html") %> 141: <% } %>

An error occurred at line: [50] in the jsp file: [/VoyantServer2_6_3/_app/index.jsp] org.voyanttools.voyant.Voyant cannot be resolved to a type 47: extend : 'Voyant.VoyantDefaultApp', 48: name: 'VoyantDefaultApp', 49: config: { 50: baseUrl: '<%= org.voyanttools.voyant.Voyant.getBaseUrlString(request) %>', 51: version: '<%= application.getInitParameter("version") %>', 52: openMenu: '<%= System.getProperty("org.voyanttools.voyant.openmenu")==null ? "" : System.getProperty("org.voyanttools.voyant.openmenu") %>', 53: allowInput: '<%= System.getProperty("org.voyanttools.server.allowinput")==null ? "" : System.getProperty("org.voyanttools.server.allowinput") %>',

Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:213) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:519) org.apache.jasper.compiler.Compiler.compile(Compiler.java:392) org.apache.jasper.compiler.Compiler.compile(Compiler.java:362) org.apache.jasper.compiler.Compiler.compile(Compiler.java:346) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:605) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:400) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) Note The full stack trace of the root cause is available in the server logs.

Apache Tomcat/9.0.31 (Ubuntu)

ajmacdonald commented 1 year ago

What version of Java are you using? It needs to be 8 or 11.

ac27037 commented 1 year ago

The version of JAVA used in my server is as the attached:

openjdk version "11.0.17" 2022-10-18 OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu220.04) OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu220.04, mixed mode, sharing)

ajmacdonald commented 1 year ago

Hmmm, it could be that the directories are in the wrong places. I don't think you should be seeing references to VoyantServer2_6_3/_app if you've deployed it in Tomcat. The contents of the _app directory (not the _app directory itself) should be directly in ROOT directory.

ac27037 commented 1 year ago

It works! By following your teaching, I can make Voyant Server on my server! Thank you so much! But there is another question: the corpora cannot be found and it seemed not to be in "_app" but in the same directory of _app.

ajmacdonald commented 1 year ago

The data directory (where corpora and cached files get stored) defaults to your operating system's temporary directory. You can specify a different directory by creating a setenv.sh file and setting the CATALINA_TMPDIR environment variable there, e.g. CATALINA_TMPDIR="/voyant-data" Read these instructions for more information regarding that process: https://tomcat.apache.org/tomcat-9.0-doc/RUNNING.txt

ac27037 commented 1 year ago

I have found my path for CATALINA_TMPDIR and CATALINA_HOME, but it did not work when the 'data' folder was put in either TMPDIR or HOME. I have still been figuring it out.

By the way, I also noticed that when I used voyant tools built on my server, the process was created and stored on your server. For example, if corpus=f002c04cd0e855d5582e08c6f30f00f1, it was created and stored on your server, although I used my one.

ac27037 commented 1 year ago

I have found my path for CATALINA_TMPDIR and CATALINA_HOME, but it did not work when the 'data' folder was put in either TMPDIR or HOME. I have still been figuring it out.

By the way, I also noticed that when I used voyant tools built on my server, the process was created and stored on your server. For example, if corpus=f002c04cd0e855d5582e08c6f30f00f1, it was created and stored on your server, although I used my one.

When I taught my students Voyant Tools, I was afraid that your server could not afford 30 or more connections simultaneously. As for the offline version, the computer classroom management disallows them to open the port due to the firewall. Therefore, I am trying build it on my server.

ajmacdonald commented 1 year ago

I have found my path for CATALINA_TMPDIR and CATALINA_HOME, but it did not work when the 'data' folder was put in either TMPDIR or HOME. I have still been figuring it out.

By the way, I also noticed that when I used voyant tools built on my server, the process was created and stored on your server. For example, if corpus=f002c04cd0e855d5582e08c6f30f00f1, it was created and stored on your server, although I used my one.

This is odd. The URL for trombone (the backend of Voyant) should be derived from the URL that Voyant is hosted at.

ac27037 commented 1 year ago

I have finally figured it out. Everything is fine and the default corpora are successfully loaded. But another question is that the Voyant Tools Help cannot be displayed but a Tomcat Documentation Index. Could it be a problem of path setting or is it another instance of the server? Thank you!

ajmacdonald commented 1 year ago

It's hard to answer without seeing your configuration, but it does sound like the Tomcat documentation is overriding the Voyant one. You should be able to see it by just appending /docs/ to your Voyant path.