6
$\begingroup$

Is it possible to put the webMathematica folder outside the usual Tomcat webapps folder and still have webMathematica work?

webMathematica does work OK if its whole folder is placed inside Tomcat's webapps — and accessed in the browser as localhost:8080/webMathematica.

(This is with Tomcat 9 under OS X 10.10.4 and using webMathematica 3.3.2 calling Mathematica 10.2.)

Configuration details would be greatly appreciated!

In asking this I have four aims:

  1. Granularize things so that I can just back up the webMathematica folder, along with other documents of mine, separately from backing up Tomcat's own files such as those in its distributed webapps folder.

  2. Be able to access webMathematica (and, eventually, some specific apps using it) on localhost by means of a simple URL "alias", such as webmathematica, rather than the usual complete URL localhost:8080/webMathematica — just as I can now access Tomcat's webapps by entering the URL tomcat.local.

  3. [added] Still allow use of Tomcat for webapps other than webMathematica. Thus changing the entire Tomcat docBase value — if that actually worked — would not allow achieving this aim.

  4. [added] Be able to run webMathematica in my browser by entering a simple URL such as webmathematica.local(without the fully-qualified URL localhost:8080/webMathematica).

$\endgroup$
4
  • $\begingroup$ Did you try a symbolic link? $\endgroup$ May 6, 2013 at 21:00
  • $\begingroup$ @Rolf Mertig: Yes, a symlink works, with URL http://localhost:8080/webMathematica! But what I'd actually like to do is use a simpler URL such as webmathematica.local, and for that obviously some kind of additional configuration of tomcat and/or apache is required. (In apache I'm passing calls to tomcat via ajp.) $\endgroup$
    – murray
    May 6, 2013 at 21:24
  • $\begingroup$ For the URL part I think this and no.4 in this should get you started... $\endgroup$ May 7, 2013 at 6:12
  • $\begingroup$ Alas, I don't comprehend how to put the "this" and "no. 4 in this" together for the situation I describe. Don't I need, also to add an entry such as 127.0.0.1 webmathematica.local to /etc/hosts and a corresponding VirtualHost entry to apache2/conf/extra/httpd-vhosts.conf?` $\endgroup$
    – murray
    Aug 14, 2015 at 14:01

1 Answer 1

1
$\begingroup$

Yes, it's possible. So you don't have to type the webMathematica after your localhost address.

Steps:

  1. Put your webMathematica folder in some place like C:\webMathematica
  2. Create a file named ROOT.xml inside \Tomcat\conf\Catalina\localhost\
  3. In this file, write: <Context docBase="C:\webMathematica" reloadable="false"/>
  4. Restart you Tomcat, and now your new root is your webMathematica application
$\endgroup$
3
  • $\begingroup$ Will test this with my OS X configuration & report back soon. Thanks! $\endgroup$
    – murray
    Mar 15, 2015 at 17:10
  • $\begingroup$ @murray let me know if it works $\endgroup$
    – Murta
    Mar 15, 2015 at 17:12
  • $\begingroup$ No, that's not working (OS X 10.10.4) even if I keep the webmathematica folder in its default position /usr/local/apache-tomcat-7.0.37/webapps and use that location in the docBase value in the file ` /usr/local/apache-tomcat-7.0.37/conf/Catalina/localhost/ROOT.xml` that you describe. After restarting Tomcat (and apache), browsing to localhost:8080 still brings up the default Tomcat page, not the webMathematica page. $\endgroup$
    – murray
    Aug 13, 2015 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.