I want to access notebook server remotely via a web browser, the following shows how did I setup my notebook server:
1.generate config file
$ jupyter-notebook --generate-config
$ cd ~/.jupyter
req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
c = get_config()
# You must give the path to the certificate file.
c.NotebookApp.certfile = u'/home/azureuser/.jupyter/mycert.pem'
# Create your own password as indicated above
c.NotebookApp.password = u'sha1:b86e933199ad:a02e9592e5 etc... '
# Network and browser details. We use a fixed port (9999) so it matches
# our Azure setup, where we've allowed :wqtraffic on that port
c.NotebookApp.ip = '*'
c.NotebookApp.port = 9999
c.NotebookApp.open_browser = False
$ ~ jupyter-notebook
[I 16:46:58.627 NotebookApp] Serving notebooks from local directory: /home/user
[I 16:46:58.627 NotebookApp] 0 active kernels
[I 16:46:58.627 NotebookApp] The Jupyter Notebook is running at: https://SERVER_IP:9999/
[I 16:46:58.627 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
The corresponding port
9999 is block on the server, and the server is
Centos7 and iptables is not available to open ports, so use
firewall-cmd to active the port:
$ firewall-cmd --zone=public --add-port=9999/tcp --permanent $ firewall-cmd --reload
If firewallD is not running, just start the service.