initial setup of tiddlywiki on AWS EC2

358 views
Skip to first unread message

Duncan Brown

unread,
May 20, 2019, 6:21:11 AM5/20/19
to TiddlyWiki
Hi

I'm trying to get a tiddlywiki running from AWS EC2 as an experiemnt.

I'm stuck :(

This is how far I've managed to get...

1. launched AWS workbench and go to EC2
2. launched a linux AMI
3. configured instance
4. created key pair
5. SSHd from the command line into EC2 using the .pem `ssh ec2-user@IP-ADDRESS -i MYPEMNAME.pem`
6. install NVM.
7. install git
8.  use npm to install tiddlywiki `npm  install -g tiddlywiki`
9. create root folder `tiddlywiki MYWIKI --init server`
10. start server `tiddlywiki MYWIKI --listen`

My problem is that I can't get step 10. to work... it keeping flicking to 127.0.0.1... rather that the EC2 ip.

I'm sure I'm doing something stupid... and help appreciated.

If there is an easier way of doing this - happy to hear that too. (I've tried Elastic Beanstalk - but found that even more confusing!)

Thanks

TonyM

unread,
May 20, 2019, 7:58:06 AM5/20/19
to TiddlyWiki
Duncan

I am no expert but would tiddlywiki not need you to specify 0.0.0.0 so that is available on the public AWS address just as you must on a desktop install of it if you want external access on you network?

regards
Tony

Duncan Brown

unread,
May 20, 2019, 8:24:49 AM5/20/19
to TiddlyWiki
Hi Tony

yes that sounds like it - I'm just not sure of the syntax to specify server address.

if I use:
tiddlywiki nameOfWikifolder --listen port=8080

it just reverts to my local wiki http://127.0.0.1:8080 not the AWS...

Thanks

Duncan Brown

unread,
May 20, 2019, 11:00:42 AM5/20/19
to TiddlyWiki

Duncan Brown

unread,
May 20, 2019, 5:19:47 PM5/20/19
to TiddlyWiki
OK so I put this together to try and help answer my own question...

You can read more about the arguments accepted by the server command here: http://tiddlywiki.com/#ServerCommand
--------------------------------------------------------------------------------------------------------------------
--server is now deprecated SEE: https://tiddlywiki.com/#ServerCommand
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--listen is the NEW command SEE: https://tiddlywiki.com/#ListenCommand
--------------------------------------------------------------------------------------------------------------------
EXAMPLE:
--server 80 $:/core/save/all text/plain text/html "" "" 0.0.0.0

--server 80 text/plain text/html username=designteam password=consistencyisking 3.94.127.18

NUMBERED EXAMPLE:
[1] --server 80 [2] $:/core/save/all [3] text/plain [4] text/html [5] "" [6] "" [7] 0.0.0.0


This command for example will make the server listen on all interfaces [7] on port 80 [1], but let's break it down so you understand what it means.


[1] is the port (listening on port 80)

--server 80

[2]is which tiddler will be served (this will serve all tiddlers)

$:/core/save/all

[3] what the tiddlers are saved as

text/plain

[4] is the tiddlers will be served as

text/html

[5] is the username for edits (in this case blank)

""

[6] is the password (also blank)

""

[7] is which interfaces to listen on

0.0.0.0

by setting this to 0.0.0.0 the server will be listening on all interfaces and people will be able to connect using your WAN IP, LAN IP, or your localhost

SEE: http://tiddlywiki.com/#ServerCommand for more about the arguments accepted by the server command (Remember it's deprecated... use --listen to be 'modern')


ALSO SEE: here: http://tiddlywiki.com/#ServerCommand


--listen <name>=<value>...

Most TiddlyWiki Commands use a position-based system for their parameters where each parameter must be listed in the precise order defined by the command.
(see the old --server numbering above)

Some of the more complex commands offer an alternative scheme of named command parameters. For example, here we provide two parameters named "port" and "host":

--listen port=8090 host=0.0.0.0


Note that the order of the parameters for --listen does not matter.

Using special characters within a parameter requires quoting. Unix, Linux and the Mac use single quotes:
--listen port=8090 username=joe 'password=s3cret(!'

and Windows uses double quotes:
--listen port=8090 username=joe "password=s3cret(!"

Note that the quotes are applied to the entire name=value pair, not just to the value part.

SEE: https://tiddlywiki.com/#NamedCommandParameters

--------------------------------------------------------------------------------------------------------------------
host= optional hostname to serve from (defaults to "127.0.0.1" aka "localhost")
--------------------------------------------------------------------------------------------------------------------
path-prefix= optional prefix for paths
--------------------------------------------------------------------------------------------------------------------
port= port number on which to listen; (defaults to "8080")
--------------------------------------------------------------------------------------------------------------------
credentials= pathname of credentials CSV file (relative to wiki folder)
--------------------------------------------------------------------------------------------------------------------
anon-username= the username for signing edits for anonymous users
--------------------------------------------------------------------------------------------------------------------
username= optional username for basic authentication
--------------------------------------------------------------------------------------------------------------------
password= optional password for basic authentication
--------------------------------------------------------------------------------------------------------------------
authenticated-user-header= optional name of header to be used for trusted authentication
--------------------------------------------------------------------------------------------------------------------
readers= comma separated list of principals allowed to read from this wiki
--------------------------------------------------------------------------------------------------------------------
writers= comma separated list of principals allowed to write to this wiki
--------------------------------------------------------------------------------------------------------------------
csrf-disable= set to "yes" to disable CSRF checks (defaults to "no")
--------------------------------------------------------------------------------------------------------------------
root-tiddler= the tiddler to serve at the root (defaults to "$:/core/save/all")
--------------------------------------------------------------------------------------------------------------------
root-render-type= the content type to which the root tiddler should be rendered (defaults to "text/plain")
--------------------------------------------------------------------------------------------------------------------
root-serve-type= the content type with which the root tiddler should be served (defaults to "text/html")
--------------------------------------------------------------------------------------------------------------------
tls-cert= pathname of TLS certificate file (relative to wiki folder)
--------------------------------------------------------------------------------------------------------------------
tls-key= pathname of TLS key file (relative to wiki folder)
--------------------------------------------------------------------------------------------------------------------
debug-level= optional debug level; set to "debug" to view request details (defaults to "none")
--------------------------------------------------------------------------------------------------------------------

BUT :( still I can't get it to work

When I run:

$ tiddlywiki MYWIKIFOLDER --listen host=MYIPADDRESS

I get the following:

Serving on http://MYIPADDRESS:8080
(press ctrl-C to exit)
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRNOTAVAIL 3.94.127.18:8080
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at Server.setupListenHandle [as _listen2] (net.js:1350:19)
    at listenInCluster (net.js:1408:12)
    at doListen (net.js:1517:7)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

Message has been deleted

Duncan Brown

unread,
May 20, 2019, 7:23:00 PM5/20/19
to TiddlyWiki
OK This is how I got this to work...


It mentioned making sure you had the latest version of Node:
Make sure that you install the latest version. Sometimes ubuntu will install an older version, which you do NOT want.


this worked...

So

2 things

1) I upgrade node to the latest version 10+

2) and kept the custom TCP rule on port 3000 from the tutorial...

then I ran

$ tiddlywiki MYWIKIFOLDER --listen host=MY.PRIVATE.AWS.IP.ADRESS port=3000



AND IT WORKED!!!

:)
Reply all
Reply to author
Forward
0 new messages