我试图在自己的服务器上设置IPython笔记本服务器。安装工作正常(我从github源3.0.0编译和安装)。
我成功设置了基本的HTTP连接,并且笔记本电脑正常工作。
然而,从那以后,我做了两件事: - 我切换到ssl(生成自签名证书)和https(从http强制执行apache重定向) - 我在apache中添加了一个代理重定向,让subdomain.domain.com指向domain.com:8888
我可以很好地连接到服务器,列出笔记本,然后打开一个。但是笔记本电脑无法连接到内核,状态是“重新连接”#34;而且我无法运行任何细胞。
这是相关的apache配置
<VirtualHost *:80>
ServerName sub.domain.com
ServerAdmin admin@domain.com
Redirect / https://sub.domain.com/
</VirtualHost>
<VirtualHost *:443>
SSLEngine On
SSLProxyEngine On
SSLCertificateFile /etc/ssl/certs/ssl-cert-ipython.crt
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-ipython.key
ServerName sub.domain.com
#ServerAdmin admin@domain.com
ErrorLog ${APACHE_LOG_DIR}/ipython-error.log
CustomLog ${APACHE_LOG_DIR}/ipython-access.log combined
ProxyPreserveHost On
# setup the proxy
#<Proxy *>
# Order allow,deny
# Allow from all
#</Proxy>
ProxyPass / https://localhost:8888/
#retry=1 acquire=3000 timeout=600 Keepalive=On
ProxyPassReverse / https://localhost:8888/
</VirtualHost>
这是来自ipython的示例会话:
...
[I 17:02:51.383 NotebookApp] 0 active kernels
[I 17:02:51.383 NotebookApp] The IPython Notebook is running at: https://[all ip addresses on your system]:8888/
[I 17:02:51.383 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 17:03:04.701 NotebookApp] Kernel started: bb4905f6-d883-4efc-9282-869f098d2b22
[W 17:03:04.948 tornado.access] 400 GET /api/kernels/bb4905f6-d883-4efc-9282-869f098d2b22/shell (::1) 0.31ms referer=None
[W 17:03:10.110 tornado.access] 400 GET /api/kernels/bb4905f6-d883-4efc-9282-869f098d2b22/shell (::1) 0.27ms referer=None
[W 17:03:15.278 tornado.access] 400 GET /api/kernels/bb4905f6-d883-4efc-9282-869f098d2b22/shell (::1) 0.82ms referer=None
[W 17:03:20.505 tornado.access] 400 GET /api/kernels/bb4905f6-d883-4efc-9282-869f098d2b22/shell (::1) 0.51ms referer=None
使用--debug,每一秒这样的一行就会弹出:
[D 17:02:22.545 NotebookApp] Polling kernel...
编辑:在摆弄后,我设法使其工作,但没有子域前缀,如果我明确指定端口(使用另一个配置)。所以似乎问题来自代理。
感谢任何人花时间阅读本文!