mathics-django icon indicating copy to clipboard operation
mathics-django copied to clipboard

Installing to Apache

Open toddmo opened this issue 3 years ago • 4 comments

I'm sure this question is beyond the scope of this project itself, but what would be the general approach to integrating my (working) Mathics core/Django installation to a local Apache web server running on the same machine? Perhaps all Python apps are integrated into Apache in roughly the same way, perhaps not.

My motivation is that now I have Mathics running OK locally,

  1. there's a terminal window open and Mathics depends on it staying open
  2. it won't restart when my machine restarts

I would prefer it just be running in the background so that when I go to the url, it just works, just like any other website.

If I end up pushing this to Apache, perhaps I could put those integration files into a pull request. And it could just be an optional part of setup.

toddmo avatar Sep 24 '22 21:09 toddmo

An update

I got it fully installed to my shared Linux hosting account, (which is cloud linux not Apache, but has cPanel and is easier to administer), and ran mathicsserver from ssh, successfully; however, once again, it's running from inside a ssh window, and it seems to be hard-coded to listen to port 8000

I need to marry the mathics server to a python web application that I have defined on my hosting provider. This needs to map it to a url path on my server and requests will come in on 443 not 8000. the command "mathicsserver" can be part of the startup code for the web application.

toddmo avatar Sep 24 '22 22:09 toddmo

Use the option -p 443 mathicsserver -p 443

mmatera avatar Sep 25 '22 04:09 mmatera

I need a general clue as to how to route traffic at mywebserver.com/myapppath to/from mathicsserver. Mathics is its own standalone webserver, but I'm putting it on another hosted web server. If it was just a bunch of py files i might be able to take the mathics Web server py file and adapt it by removing the http server and connecting it to the hosting web service instead. But it's compiled and very complicated. So i need to do something with tunneling or routing or redirecting or something.

toddmo avatar Sep 25 '22 04:09 toddmo

MathicsServer is a Django server, so maybe this could be helpful: https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/modwsgi/

mmatera avatar Sep 25 '22 13:09 mmatera