[英]Specify hostname to jupyter notebook when running on remote server
我在远程服务器上运行笔记本,我通过浏览器从本地计算机连接到该服务器。 我有一个轻微的烦恼是它在开始时打印:
Serving notebooks from local directory: /home/xxxxxxx
0 active kernels
The Jupyter Notebook is running at:
http://(friendly or 127.0.0.1):8888/
其中friendly
是主机的友好名称。 主机的 FQDN 实际上是friendly.xyzcom
。 我希望它打印这个:
The Jupyter Notebook is running at:
http://friendly.x.y.z.com:8888/
这样 URL 就可以直接从控制台点击。 是否有一个配置选项我可以通过某个地方在 jupyter notebook 中执行此操作以明确指定我想要显示的主机名?
需要明确的是,尽管有上述消息, http://friendly.xyzcom:8888/
仍能在浏览器中正确解析。
您应该首先生成配置文件:
jupyter notebook --generate-config
然后使用配置文件,您可以通过编辑配置文件 ~/.jupyter/jupyter_notebook_config.py 更改以下行来设置自定义 URL:
c.NotebookApp.custom_display_url = 'http://friendly.x.y.z.com:8888'
因此,当您启动服务器时,它将显示此 URL 与令牌连接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.