1. Install jupyter in virtual environment
    • python3 -m venv jupyterenv
    • source jupyterenv/bin/activate
  2. Install jupyter
    • pip install jupyter
  3. Generate or modify jupyter_notebook_config.py
    • jupyter notebook --generate-config
    • vim ~/.jupyter/jupyter_notebook_config.py
  4. maintain the following entries in config file
    • c.NotebookApp.notebook_dir = ‘/home/myfolder/’
    • c.NotebookApp.open_browser = False
    • c.NotebookApp.port = 5000
    • c.ServerApp.local_hostnames = [‘localhost’,’notebook.erprealm.com’]
    • c.NotebookApp.allow_origin = ‘*’
  5. Apache Configuration add to 000-default.conf
<VirtualHost *:443>
    ServerName sub.domain.com
    ProxyPreserveHost On

    ProxyPass /api/kernels/ ws://localhost:5000/api/kernels/
    ProxyPassReverse /api/kernels/ http://localhost:5000/api/kernels/

    ProxyPass / http://localhost:5000/
    ProxyPassReverse / http://localhost:5000/
</VirtualHost>

6. Run the following commands to activate apache services

sudo a2enmod proxy 
sudo a2enmod proxy_http 
sudo a2enmod proxy_wstunnel

7. Restart apache server : sudo service apache2 restart

8. Start jupyter notebook : jupyter notebook

Reference:

https://samgriesemer.com/Remote_jupyter_notebook


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *