我希望通过Web浏览器远程访问笔记本服务器,以下是我设置笔记本服务器的步骤:
1.生成配置文件。
1.生成配置文件。
$ jupyter-notebook --generate-config
$ cd ~/.jupyter
2. 使用以下命令创建SSL证书(适用于Linux和Windows)。
req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
3.编辑配置文件,该文件名为jupyter_notebook_config.py
,密码已生成。
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. 启动 $ jupyter-notebook
服务器
现在,您应该可以通过地址https://[PUBLIC-IP-ADDRESS]:9999访问您的Jupyter笔记本。
启动笔记本:
$ ~ 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).
但是,当我在家打开浏览器时(笔记本服务器在实验室),在https://MY_SERVER_IP:9999页面无法打开。Chrome浏览器返回:
ERR_ADDRESS_UNREACHABLE
我该怎么办?