- create a virtual environment in python using Virtualenv
- intall jupyter notebook in the virtual environment
- Generate jupyter.config file using the below
$ jupyter notebook --generate-config
- Maintain password using :
- $ jupyter notebook password
- The password generated in stored in the json file in the same folder ad jupyter.config file
- Create a certificate using the following code
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem
- Note rsa 1024 will not work and will give error
- Link the jupyter notebook to the certificate
$ jupyter notebook --certfile=mycert.pem --keyfile mykey.key
- Set the following line of code in jupyter.config file
- # Set options for certfile, ip, password, and toggle off browser auto-opening
- c.NotebookApp.certfile = u’/absolute/path/to/your/certificate/mycert.pem’
- c.NotebookApp.keyfile = u’/absolute/path/to/your/certificate/mykey.key’ # Set ip to ‘*’ to bind on all interfaces (ips) for the public server
- c.NotebookApp.ip = ‘*’ c.NotebookApp.password = u’sha1:bcd259ccf…<your hashed password here>’
- c.NotebookApp.open_browser = False # It is a good idea to set a known, fixed port for server access c.NotebookApp.port = 9999
- create new subdomain
- encrypt the subdomain
$ certbot --expand -d jupyter.YOUR-DOMAIN.com
- Modify virtual host to apache server
SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
<Location /api>
ProxyPass http://127.0.0.1:3000/api/
ProxyPassReverse http://127.0.0.1:3000/api/
ProxyPass https://127.0.0.1:3000/api/
ProxyPassReverse https://127.0.0.1:3000/api/
</Location>
12. Make sure to run the following command for proxy_http to work
Run sudo a2enmod proxy_http
References and Error Messages
- How to configure Jupyter notebook
- How to uninstall jupter notebok
- How to configure redirect to local host from external subdomain
- Jupyter Notebook on a subdomain of your website
- Setting up redirect proxy in apache2
- Error :
- SSLError: [SSL: EE_KEY_TOO_SMALL] ee key too small (_ssl.c:4022) on Ubuntu when starting jupyter notebook
- PermissionError: [Errno 13] Permission denied when accessing
- Python SSL X509: KEY_VALUES_MISMATCH
- Why am I getting an “Invalid command ‘ProxyPass'” error when I start my Apache 2.2 server?
0 Comments