1
votes

I set up my EC2 and I configured my jupyter notebook config file like here: https://chrisalbon.com/jupyter/run_project_jupyter_on_amazon_ec2.html.

I now run: jupyter notebook, and here's what I get:

[I 03:42:26.400 NotebookApp] Serving notebooks from local directory: /home/ec2-
user/courses/deeplearning1/nbs
[I 03:42:26.400 NotebookApp] 0 active kernels
[I 03:42:26.400 NotebookApp] The Jupyter Notebook is running at: https://[all ip addresses on your 
system]:8888/
[I 03:42:26.400 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to 
skip confirmation).

However, now that I'm trying to go to my site (http://ec2-54-202-213-129.us-west-2.compute.amazonaws.com:8888/), here's what I see on my terminal.

 Exception in callback (<socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('0.0.0.0', 8801)>, <function wrap.<locals>.null_wrapper at 0x7fc3e0210620>)
Traceback (most recent call last):
  File "/home/ec2-user/anaconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 887, in start
    handler_func(fd_obj, events)
  File "/home/ec2-user/anaconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 275, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/ec2-user/anaconda3/lib/python3.6/site-packages/tornado/netutil.py", line 272, in accept_handler
    callback(connection, address)
  File "/home/ec2-user/anaconda3/lib/python3.6/site-packages/tornado/tcpserver.py", line 244, in _handle_connection
    do_handshake_on_connect=False)
  File "/home/ec2-user/anaconda3/lib/python3.6/site-packages/tornado/netutil.py", line 513, in ssl_wrap_socket
    context = ssl_options_to_context(ssl_options)
  File "/home/ec2-user/anaconda3/lib/python3.6/site-packages/tornado/netutil.py", line 490, in ssl_options_to_context
    context.load_cert_chain(ssl_options['certfile'], ssl_options.get('keyfile', None))
IsADirectoryError: [Errno 21] Is a directory

Any idea what I'm doing wrong?

1

1 Answers

2
votes

At first did you try to use https:// instead http://? I.e. https://ec2-54-202-213-129.us-west-2.compute.amazonaws.com:8888/

Regardless of this I think you should follow the recommendations from official documentation: http://jupyter-notebook.readthedocs.io/en/latest/public_server.html#using-ssl-for-encrypted-communication

  • Create cert and key: openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mykey.key -out mycert.pem
  • Then start your notebook this way: jupyter notebook --certfile=mycert.pem --keyfile mykey.key