Ipython: remote access to laptop server via web browser

I want to remotely access the server for portals via a web browser, below shows how I installed my laptop:

1.generate configuration file

$ jupyter-notebook --generate-config $ cd ~/.jupyter 

2.Use the following command to create an SSL certificate (Linux and Windows).

 req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem 

3. Enter the profile configuration file, which is jupyter_notebook_config.py , a password has been created ..

 c = get_config() # You must give the path to the certificate file. c.NotebookApp.certfile = u'/home/azureuser/.jupyter/mycert.pem' # Create your own password as indicated above c.NotebookApp.password = u'sha1:b86e933199ad:a02e9592e5 etc... ' # Network and browser details. We use a fixed port (9999) so it matches # our Azure setup, where we've allowed :wqtraffic on that port c.NotebookApp.ip = '*' c.NotebookApp.port = 9999 c.NotebookApp.open_browser = False 

4.start $ jupyter-notebook server

Now you can access your Jupyter laptop at https: // [PUBLIC-IP-ADDRESS]: 9999 .

Launch Notepad:

 $ ~ jupyter-notebook [I 16:46:58.627 NotebookApp] Serving notebooks from local directory: /home/user [I 16:46:58.627 NotebookApp] 0 active kernels [I 16:46:58.627 NotebookApp] The Jupyter Notebook is running at: https://SERVER_IP:9999/ [I 16:46:58.627 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). 

But when I open my browser (at home, the laptop server is in my laboratory) at https: // MY_SERVER_IP: 9999 , the page may not be open. And the Chrome browser returns:

 ERR_ADDRESS_UNREACHABLE 

What should I do?

+5
source share
2 answers

The corresponding port 9999 is a block on the server, while the Centos7 server and iptables are not available for opening ports, so use firewall-cmd for the active port:

 $ firewall-cmd --zone=public --add-port=9999/tcp --permanent $ firewall-cmd --reload 

If firewallD is not running, just start the service.

0
source

The instructions below are a bit outdated:

  • Anaconda is in version 4.
  • Jupyter comes with a pre-installed version of Anaconda
  • Jupyter uses port "8888" by default
  • You must specify how to get the changes you noticed for the configuration. I ended up going to nano to do this.
  • You cannot use "sudo" with conda.

If you want to install an Ipython laptop from scratch on VPS and access it via ssh, I wrote an updated tutorial here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-jupyter-notebook-to-run-ipython-on-ubuntu-16-04

After installing and running Ipython Notebook using the command line on the server, you can connect to the laptop using SSH tunneling using Putty (through windows) or the ssh -L command on Unix-like systems (for example, Mac and Linux)

+3
source

Source: https://habr.com/ru/post/1244170/


All Articles