Host notebook() at localhost:8080/<something> instead of simply at localhost:8080

51 views
Skip to first unread message

Gere Mia

unread,
Mar 9, 2017, 9:00:35 PM3/9/17
to sage-devel
Is there a way to make make notebook() host at localhost:8080/<something> instead of simply at localhost:8080?

William Stein

unread,
Mar 9, 2017, 9:08:46 PM3/9/17
to sage-devel
On Thu, Mar 9, 2017 at 6:00 PM, Gere Mia <alan....@gmail.com> wrote:
> Is there a way to make make notebook() host at localhost:8080/<something>
> instead of simply at localhost:8080?

sagenb doesn't support base url's, but Jupyter definitely does.
Try searching the jupyter docs for command line options. You can see
how I set them up here for SageMathCloud proxying if you want:

https://github.com/sagemathinc/smc/blob/master/src/smc_pyutil/smc_pyutil/jupyter_notebook.py

>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.



--
William (http://wstein.org)

kcrisman

unread,
Mar 10, 2017, 12:12:30 AM3/10/17
to sage-devel

> Is there a way to make make notebook() host at localhost:8080/<something>
> instead of simply at localhost:8080?

sagenb doesn't support base url's, but Jupyter definitely does. 

There was some work done along these lines in sagenb a while ago by Jonathan Gutow at https://github.com/sagemath/sagenb/pull/328,though I don't know if it would support your specific use case.  Sadly this whole path is somewhat moribund though I don't see why you shouldn't be able to use that approach as he has had success with it. 

Jeroen Demeyer

unread,
Mar 10, 2017, 3:39:02 AM3/10/17
to sage-...@googlegroups.com
On 2017-03-10 03:00, Gere Mia wrote:
> Is there a way to make make notebook() host at
> localhost:8080/<something> instead of simply at localhost:8080?

Not directly. One way to make something like that work is to use reverse
proxying using a separate webserver. For example see

https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html

Jonathan

unread,
Mar 10, 2017, 11:43:00 AM3/10/17
to sage-devel


On Thursday, March 9, 2017 at 8:00:35 PM UTC-6, Gere Mia wrote:
Is there a way to make make notebook() host at localhost:8080/<something> instead of simply at localhost:8080?
Gere,
As kcrisman noted. I patched the notebook to do exactly that so that it properly also properly handles being proxied through Apache or nginx. As things were shifting to Juypiter, I have stopped working on it. I do not know if the patches will work on the latest versions of Sage. I do not have time to put into it at the moment, but would be willing to answer questions that arise when you try it.

The pull request is: https://github.com/sagemath/sagenb/pull/328
My repository is: https://github.com/gutow/sagenb_slickgrid

Jonathan
Reply all
Reply to author
Forward
0 new messages