散尽浮华 2023

過去心不可得,現在心不可得,未來心不可得。
安寻安放,不卑不亢;重剑无锋,大巧不工!
  1. 首页
  2. python
  3. 正文

搭建Jupyter Notebook服务器

2019年1月21日 2603点热度 0人点赞 0条评论
python3 -m pip install jupyter

(py3) [root@nginx test]# python 
Python 3.6.6 (default, Aug 13 2018, 18:24:23) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from IPython.lib import passwd
>>> passwd()
Enter password: 
Verify password: 
'sha1:97a35023d94d:138aa302a6d3b83d8856baa64efdcea3c6d46359'
>>> 


# jupyter notebook --generate-config --allow-root
# vim /root/.jupyter/jupyter_notebook_config.py


# jupyter notebook password
Enter password: 
Verify password: 
[NotebookPasswordApp] Wrote hashed password to /root/.jupyter/jupyter_notebook_config.json


# jupyter notebook --ip=0.0.0.0 --no-browser --allow-root  > /tmp/jupyter.log 2>&1 &



# jupyter notebook list
Currently running servers:
http://0.0.0.0:8888/?token=4eba2529552040a0c482f4e130210053b01db68ba957b3f8 :: /opt/test

Nginx 配置

server {
    listen 80;
    server_name py.yjsec.com;
    location / {
        proxy_pass         http://localhost:8888/;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_redirect off;
    }
}

重启Nginx服务让设置生效。
$ sudo nginx -s reload

标签: 暂无
最后更新:2019年1月21日

admin

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2023 散尽浮华 2023. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang