[英]Configuration for Jupyter Notebook on a home Ubuntu server: kernel is not connecting
I set up an Ubuntu server to host a Jupyter Notebook that I can access from the web.我设置了一个 Ubuntu 服务器来托管一个 Jupyter Notebook,我可以从 web 访问它。 Everything seems to work but whenever I open the notebook, the Python Kernel is stuck and it does not connect:一切似乎都正常,但每当我打开笔记本时,Python Kernel 就会卡住并且无法连接:
In the terminal, with the current configuration it does not report warnings or errors:在终端中,使用当前配置它不会报告警告或错误:
but I have tried many similar configurations and sometimes, when the kernel tried to connect, it was showing warnings like:但我尝试了许多类似的配置,有时,当 kernel 尝试连接时,它会显示如下警告:
I have found various similar issues online and they usually point to either the Jupyter configuration or the Apache/nginx configuration, however I have tried many of the proposed configurations and none of them solved my problem.我在网上发现了各种类似的问题,它们通常指向 Jupyter 配置或 Apache/nginx 配置,但是我尝试了许多建议的配置,但都没有解决我的问题。 I cannot exclude the problem is somewhere else.我不能排除问题出在其他地方。
jupyter_notebook_config.py: jupyter_notebook_config.py: Notice that I have commented out the references to the certificate, if I don't, then the notebook browser will give a "proxy error" and it won't load.请注意,我已经注释掉了对证书的引用,如果我不这样做,那么笔记本浏览器将给出“代理错误”并且它不会加载。 However, the certificate is loaded in the apache configuration and seems to work fine there.但是,证书是在 apache 配置中加载的,并且在那里似乎可以正常工作。 Is it necessary to have it loaded here as well?是否也需要在这里加载它?
apache configuration: apache配置: Commented out are some of the many lines I tried to add following suggestions from other pages.注释掉的是我试图从其他页面添加以下建议的许多行中的一些。 Any help will be really welcome, I have been stuck on this for one week now.任何帮助都会非常受欢迎,我已经坚持了一个星期了。
After a full day of attempts I found a solution.经过一整天的尝试,我找到了解决方案。
In the notebook configuration I uncommented the certificate lines.在笔记本配置中,我取消了证书行的注释。
In the apache configuration I added:在 apache 配置中我添加了:
SSLProxyEngine On SSLProxyEngine 开启
I have changed the reverse proxy lines using https:我已经使用 https 更改了反向代理行:
ProxyPass https://localhost:5000/notebook ProxyPass https://localhost:5000/notebook
ProxyPassReverse https://localhost:5000/notebook ProxyPassReverse https://localhost:5000/notebook
I removed the authentication lines:我删除了身份验证行:
AuthName "Please login" AuthName "请登录"
AuthType basic AuthType 基本
AuthBasicProvider file AuthBasicProvider 文件
AuthUserFile "/home/pomi/auth_file_name" AuthUserFile "/home/pomi/auth_file_name"
Require valid-user需要有效用户
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.