mathics-django
mathics-django copied to clipboard
Installing to Apache
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,
- there's a terminal window open and Mathics depends on it staying open
- 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.
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.
Use the option -p 443
mathicsserver -p 443
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.
MathicsServer is a Django server, so maybe this could be helpful: https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/modwsgi/