Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Well I reformulate as an answer. It might not be complete but I hope it contributes to a better understanding. I found the whole sage server story, while perfectly clear for the pros, is very confusing for real beginners (Took me some time to figure that out myself).

Every time you start the notebook with

sage -notebook

you have the sage notebook server running, which is potentially enough to access it remotely. It listens to input and generates html output on port:8000 (so it doesn't need apache or another server for that - side note: the default port is going to change to 8080 in the upcomming sage 5.0 release).

if you want to access the server from another machine than you have to make sure that it is not blocked somewhere (firewall/router). In the beginning you can check if you can reach the server in your LAN. Get your machines local IP with the command ifconfig. It can look like 192.168.2.102 (but will probably be different on your computer). Then try to access it from another machine on the LAN with this IP-adress (http://192.168.2.102:8000). If it doesn't work check the firewall setting of the sage server.

If you want to access the machine from outside the LAN then you have to setup your network so that your Router/web access point forwards any incoming request on a specific port (e.g. 8000 of router to 8000 to your sage server). You can change the settings of most routers over a web login. Just google up the online doc for your model.

You can get the real IP-address from your network e.g. from the admin pannel of your router or just surf on a website like http://www.whatsmyip.org/. If it is a "static" address then you have no problems - it will not change. However if it is "dynamic" then this address gets reassigned once in a while. So how exactly do you go around this problem? You could use a DDNS server. (google "webhosting with dynamic IP" to learn more) or if you have access to your own webspace you could also send autoupdated IP info there (e.g make a cron job which checks if link has changed and if yes, rsync the link on your webserver)

If you setup the server in this way it is of course accesible by the public (although I think only 1 user can work at the same time, without further setup i.e. additional worker accounts on the sage server). The most basic measure to secure things up a bit are: set a sage admin password create accounts as needed (maybe you want to share the server with others) start the notebook with the following commandline options:

sage -notebook secure=true require_login=true accounts=false

you might also need to specify the option interface='' to listen on all interfaces (the default is just 'localhost')

secure=true will enable ssh encryption so you have to use the secure protokol https://IP.of.Sage.server:8000 to access the notebook.

So this is my amateurish understanding of how a very basic setup of a "home sage server" works. Of course there are a lot of measures to make this more secure or beef it up (e.g. add a webserver like in the instructions of Jason Grout, add worker accounts to allow several people work at the same time on the server, put the server in a Virtual machine to sandbox it).

I also give a link about that ssh tunneling method I mentioned earlier. You will need to run a ssh daemon on your sage host, but I never used this so the link may be a starter to get additional help on it.

http://ask.sagemath.org/question/870/sage-notebook-server-ssh-tunneling-port-forwarding

Basically the connection is not made with http or https protocol, but with ssh protocol which should be more flexible/secure, but please correct me if I got it wrong.

Well I reformulate as an answer. It might not be complete but I hope it contributes to a better understanding. I found the whole sage server story, while perfectly clear for the pros, is very confusing for real beginners (Took me some time to figure that out myself).

Every time you start the notebook with

sage -notebook

you have the sage notebook server running, which is potentially enough to access it remotely. It listens to input and generates html output on port:8000 (so it doesn't need apache or another server for that - side note: the default port is going to change to 8080 in the upcomming sage 5.0 release).

if you want to access the server from another machine than you have to make sure that it is not blocked somewhere (firewall/router). In the beginning you can check if you can reach the server in your LAN. Get your machines local IP with the command ifconfig. It can look like 192.168.2.102 (but will probably be different on your computer). Then try to access it from another machine on the LAN with this IP-adress (http://192.168.2.102:8000). If it doesn't work check the firewall setting of the sage server.

If you want to access the machine from outside the LAN then you have to setup your network so that your Router/web access point forwards any incoming request on a specific port (e.g. 8000 of router to 8000 to your sage server). You can change the settings of most routers over a web login. Just google up the online doc for your model.

You can get the real IP-address from your network e.g. from the admin pannel of your router or just surf on a website like http://www.whatsmyip.org/. If it is a "static" address then you have no problems - it will not change. However if it is "dynamic" then this address gets reassigned once in a while. So how exactly do you go around this problem? You could use a DDNS server. (google "webhosting with dynamic IP" to learn more) or if you have access to your own webspace you could also send autoupdated IP info there (e.g make a cron job which checks if link has changed and if yes, rsync the link on your webserver)

If you setup the server in this way it is of course accesible by the public (although I think only 1 user can work at the same time, without further setup i.e. additional worker accounts on the sage server). The most basic measure to secure things up a bit are: set a sage admin password create accounts as needed (maybe you want to share the server with others) start the notebook with the following commandline options:

sage -notebook secure=true require_login=true accounts=false
accounts=false interface=''

you might also need to specify the option interface='' to listen on all interfaces (the default is just 'localhost')

secure=true will enable ssh encryption so you have to use the secure protokol https://IP.of.Sage.server:8000 to access the notebook.notebook. interface='' will listen on all interfaces (e.g. eth0), the default is just localhost.

So this is my amateurish understanding of how a very basic setup of a "home sage server" works. Of course there are a lot of measures to make this more secure or beef it up (e.g. add a webserver like in the instructions of Jason Grout, add worker accounts to allow several people work at the same time on the server, put the server in a Virtual machine to sandbox it).

I also give a link about that ssh tunneling method I mentioned earlier. You will need to run a ssh daemon on your sage host, but I never used this so the link may be a starter to get additional help on it.

http://ask.sagemath.org/question/870/sage-notebook-server-ssh-tunneling-port-forwarding

Basically the connection is not made with http or https protocol, but with ssh protocol which should be more flexible/secure, but please correct me if I got it wrong.

Well I reformulate as an answer. It might not be complete but I hope it contributes to a better understanding. I found the whole sage server story, while perfectly clear for the pros, is very confusing for real beginners (Took me some time to figure that out myself).myself ).

Every time you start the notebook with

sage -notebook

you have the sage notebook server running, which is potentially enough to access it remotely. It listens to input and generates html output on port:8000 (so it doesn't need apache or another server for that - side note: the default port is going to change to 8080 in the upcomming sage 5.0 release).

if you want to access the server from another machine than you have to make sure that it is not blocked somewhere (firewall/router). In the beginning you can check if you can reach the server in your LAN. Get your machines local IP with the command ifconfig. It can look like 192.168.2.102 (but will probably be different on your computer). Then try to access it from another machine on the LAN with this IP-adress (IP-adress: http://192.168.2.102:8000). . If it doesn't work check the firewall setting of the sage server.

If you want to access the machine from outside the LAN then you have to setup your network so that your Router/web access point forwards any incoming request on a specific port (e.g. 8000 of router to 8000 to your sage server). You can change the settings of most routers over a web login. Just google up the online doc for your model.

You can get the real IP-address from your network e.g. from the admin pannel of your router or just surf on a website like http://www.whatsmyip.org/. If it is a "static" address then you have no problems - it will not change. However if it is "dynamic" then this address gets reassigned once in a while. So how exactly do you go around this problem? You could use a DDNS server. (google "webhosting with dynamic IP" to learn more) or if you have access to your own webspace you could also send autoupdated IP info there (e.g make a cron job which checks if link has changed and if yes, rsync the link on your webserver)

If you setup the server in this way it is of course accesible by the public (although I think only 1 user can work at the same time, without further setup i.e. additional worker accounts on the sage server). The most basic measure to secure things up a bit are: set a sage admin password create accounts as needed (maybe you want to share the server with others) start the notebook with the following commandline options:

sage -notebook secure=true require_login=true accounts=false interface=''

secure=true will enable ssh encryption so you have to use the secure protokol https://IP.of.Sage.server:8000 to access the notebook. interface='' will listen on all interfaces (e.g. eth0), the default is just localhost.

So this is my amateurish understanding of how a very basic setup of a "home sage server" works. Of course there are a lot of measures to make this more secure or beef it up (e.g. add a webserver like in the instructions of Jason Grout, add worker accounts to allow several people work at the same time on the server, put the server in a Virtual machine to sandbox it).

I also give a link about that ssh tunneling method I mentioned earlier. You will need to run a ssh daemon on your sage host, but I never used this so the link may be a starter to get additional help on it.

http://ask.sagemath.org/question/870/sage-notebook-server-ssh-tunneling-port-forwarding

Basically the connection is not made with http or https protocol, but with ssh protocol which should be more flexible/secure, but please correct me if I got it wrong.

wrong.

Well I reformulate as an answer. It might not be complete but I hope it contributes to a better understanding. I found the whole sage server story, while perfectly clear for the pros, is very confusing for real beginners (Took me some time to figure that out myself ).

Every time you start the notebook with

sage -notebook

you have the sage notebook server running, which is potentially enough to access it remotely. It listens to input and generates html output on port:8000 (so it doesn't need apache or another server for that - side note: the default port is going to change to 8080 in the upcomming sage 5.0 release).

if you want to access the server from another machine than you have to make sure that it is not blocked somewhere (firewall/router). In the beginning you can check if you can reach the server in your LAN. Get your machines local IP with the command ifconfig. It can look like 192.168.2.102 (but will probably be different on your computer). Then try to access it from another machine on the LAN with this IP-adress: http://192.168.2.102:8000. If it doesn't work check the firewall setting of the sage server."sage server" machine.

If you want to access the machine from outside the LAN then you have to setup your network so that your Router/web access point forwards any incoming request on a specific port (e.g. 8000 of router to 8000 to your sage server). You can change the settings of most routers over a web login. Just google up the online doc for your model.

You can get the real IP-address from your network e.g. from the admin pannel of your router or just surf on a website like http://www.whatsmyip.org/. If it is a "static" address then you have no problems - it will not change. However if it is "dynamic" then this address gets reassigned once in a while. So how exactly do you go around this problem? You could use a DDNS server. (google "webhosting with dynamic IP" to learn more) or if you have access to your own webspace you could also send autoupdated IP info there (e.g make a cron job which checks if link has changed and if yes, rsync the link on your webserver)

If you setup the server in this way it is of course accesible by the public (although I think only 1 user can work at the same time, without further setup i.e. additional worker accounts on the sage server). The most basic measure to secure things up a bit are: set a sage admin password create accounts as needed (maybe you want to share the server with others) start the notebook with the following commandline options:

sage -notebook secure=true require_login=true accounts=false interface=''

secure=true will enable ssh encryption so you have to use the secure protokol https://IP.of.Sage.server:8000 to access the notebook. interface='' will listen on all interfaces (e.g. eth0), the default is just localhost.

So this is my amateurish understanding of how a very basic setup of a "home sage server" works. Of course there are a lot of measures to make this more secure or beef it up (e.g. add a webserver like in the instructions of Jason Grout, add worker accounts to allow several people work at the same time on the server, put the server in a Virtual machine to sandbox it).

I also give a link about that ssh tunneling method I mentioned earlier. You will need to run a ssh daemon on your sage host, but I never used this so the link may be a starter to get additional help on it.

http://ask.sagemath.org/question/870/sage-notebook-server-ssh-tunneling-port-forwarding

Basically the connection is not made with http or https protocol, but with ssh protocol which should be more flexible/secure, but please correct me if I got it wrong.