-
Notifications
You must be signed in to change notification settings - Fork 0
Jupyter Notebook
SaeHie Park edited this page Aug 7, 2020
·
39 revisions
Run Jupyter-notebook as a Service at http://localhost:3010/
Apache2 will proxy http://localhost:3010/ to http://domain.com/jupyter/
sudo apt-get update
sudo apt-get install python-is-python3
sudo apt-get install build-essential libssl-dev libffi-dev
sudo apt-get install python3-pip python3-dev
sudo apt-get install ipython3
python -m pip install --upgrade pip
pip install --upgrade numpy --user
pip install --upgrade jupyter --user
jupyter notebook --generate-config
will create
/home/pi/.jupyter/jupyter_notebook_config.py
$ python
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from notebook.auth import passwd; passwd()
Enter password:
Verify password:
'sha1:whatever-the-result'
c.NotebookApp.base_url = '/jupyter/'
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'sha1:whatever-the-result'
c.NotebookApp.port = 3010
to run without apache proxy
c.NotebookApp.ip = '192.168.1.100'
in mods-enabled/proxy.conf file
ProxyPass /jupyter http://127.0.0.1:3010/jupyter
ProxyPassReverse /jupyter http://127.0.0.1:3010/jupyter
enable proxy
sudo a2enmod proxy
sudo a2enmod proxy_http
restart apache2
Create a file
/etc/systemd/system/jupyter.service
[Unit]
Description=Jupyter-Notebook
[Service]
Type=simple
PIDFile=/run/jupyter-notebook.pid
ExecStart=/usr/local/bin/jupyter-notebook --config=/home/pi/.jupyter/jupyter_notebook_config.py
User=pi
Group=pi
WorkingDirectory=/var/jupyter
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
Add www-data
user to ubuntu
group in /etc/group
file
sudo systemctl restart apache2
sudo systemctl reenable jupyter.service
sudo systemctl restart jupyter.service