So overwhelmed...node.js on a godaddy shared hosting site?

213 views
Skip to first unread message

Jennifer Pritchard

unread,
Jan 17, 2019, 12:56:27 AM1/17/19
to tiddl...@googlegroups.com
So I've gone down a rabbit hole for the past few days, and I'm going to back up first and say where I *want* to get, then maybe you all can help me see if this is even the route to take at all.

I use godaddy for webhosting and I'd like to somehow install a tiddlywiki instance there.  I want it to be public read access, but only I should be able to edit it (ideally some day, maybe I'd want a handful of authorized users edit it with me, but that's waaaaay down the road).  I've dug around and installed node.js on my account, and although I've followed the steps for installing TW there, I get lost at the "listen" command part because I'm not sure where exactly it's installed the page.  (I'm doing all the commands via putty into the godaddy account, btw).  I feel like I've greatly lost the plot.

So I've read about the "Bob" TW thing, and that seems like it would fit the bill as far as a multi-user tool using node...but by looking at the installation instructions, I'd just be twisting myself up into knots even further.

Am I just SOL using godaddy for this?

Editing to add that the reason I wanted to go with node.js was so that I could then use tiddlymap too, which I heard requires it?  I was able to set up tiddlywiki "ok-ish" using the "Saving on a PHP Server" instructions (to the point where I can at least view and edit it online.  I can't restrict who edits it, but it was at least more functional than my attempts with node)

TonyM

unread,
Jan 17, 2019, 1:36:33 AM1/17/19
to TiddlyWiki
Jenifer,

Other would be better helping you install a node version than me, but your initial requirements can be met by editing a single file wiki on your computer, perhaps using Timimi to save, then uploading it to a folder/index.html on godady. Alternativly use tw-receiver to save online and in place using PHP.

Sharing with multiple users in the future you will need other solutions.

Regards
Tony

Jack Baty

unread,
Jan 17, 2019, 5:29:15 AM1/17/19
to TiddlyWiki
Jennifer,

I'm running 5.1.19 on a server. Here's an example startup command that works for me.

/usr/local/bin/tiddlywiki /home/jbaty/apps/wiki/batywiki --listen "readers=(anon)" writers=jack username=notmyusername password=thisisnotmyrealpassword

That by default runs on port 8080 on the localhost only, so you probably want to put a "real" web server in front of it. I use nginx as a proxy, but GoDaddy may use Apache. Either way, on a shared host it might be challenging to set this all up. I have a few notes here: https://rudimentarylathe.org/#Rudimentarylathe.org%20tech%20notes

Tony's suggestion would be easier, and without all the node business....edit your wiki locally with Firefox/Timimi or TiddlyDesktop then upload a copy to a web folder on the server. This sounds like it might be a better option for you.

Jed Carty

unread,
Jan 18, 2019, 4:38:59 AM1/18/19
to TiddlyWiki
Sorry about the installation instructions for Bob. We are working on it. Now that there are people who have actually expressed interest in doing what you are talking about I will try to put more time into the install documentation. I don't think that using the secure back-end online is ever going to be simple it shouldn't be any more complex than what you have already achieved.

Jennifer Pritchard

unread,
Jan 19, 2019, 3:36:15 PM1/19/19
to tiddl...@googlegroups.com
Ok, so I'm pretty sure this on the right track, except...

(right now, I'm totally ignoring the permissions issue.  I just want to get it running, period, and I'll worry about the rest later.  I'm also not going to worry about Bob until I get this first part nailed down)

When I follow all the standard instructions to install node.js itself, it creates all the node related info in a folder called .nvm.  This means that all the tiddlywiki related files are automatically under /home/myusername/.nvm/versions/node/v10.15.0/lib/node_modules/tiddlywiki

So running (from putty) "tiddlywiki folderwhereiwanttokeepmyTW --init server" creates a folder by that name under /home/myusername/public_html (here's something I have control over, since it'll just create the folder wherever I happen to have cd'ed in at the moment) and it has just 1 file in it (tiddlywiki.info) and 1 tiddlers folder with a storylist.tid in it.  

Next, I run the "tiddlywiki folderwhereiwanttokeepmyTW --listen port=3000"  (that's another thing, I figured out that godaddy wants everything to listen on port 3000.  This requires that I put a .htaccess file in /home/myusername with a "RewriteEngine on" and "RewriteRule (.*) http://localhost:3000/$1 [P,L]" in it).  It spits out confirmation that it's serving correctly on port 3000...but then I go to view it and I just get a 404 page.  Interestingly enough, when I kill the session, the page changes to a "server is temporarily unavailable to service your request" message, so it's like something is happening somewhere.

To take a step back a bit, I installed the standard app.js test script to my public_html file, ran it using "node app.js", and it worked as expected.  BTW, this is an apache server (shared hosting on godaddy).  I've tried creating the folderwhereiwanttokeepmyTW under /home/myusername instead of down in the public_html, but no dice.  I've also tried putting everything on port 60000 (only 1 source I found said that could be the case, so I wasn't hopeful.  I'm still pretty sure it's supposed to be 3000)

What in the world am I missing?

Brian Theado

unread,
Jan 20, 2019, 11:21:07 AM1/20/19
to tiddl...@googlegroups.com
Jennifer,

On Sat, Jan 19, 2019 at 3:36 PM Jennifer Pritchard <jennyl...@gmail.com> wrote:
[...] 
Next, I run the "tiddlywiki folderwhereiwanttokeepmyTW --listen port=3000"  (that's another thing, I figured out that godaddy wants everything to listen on port 3000.  This requires that I put a .htaccess file in /home/myusername with a "RewriteEngine on" and "RewriteRule (.*) http://localhost:3000/$1 [P,L]" in it).
 
It spits out confirmation that it's serving correctly on port 3000...
That's a good sign
 
but then I go to view it and I just get a 404 page.
404 page could be coming from the apache server or from the tiddlywiki nodejs
 
  Interestingly enough, when I kill the session, the page changes to a "server is temporarily unavailable to service your request" message, so it's like something is happening somewhere.
Based on this clue it is more likely the 404 is coming from the tiddlywiki nodejs than from Apache.

If a request like http://localhost:3000/somejunkhere were to go to the tiddlywiki, then it would return a 404 not found. It could be the $1 in your apache rewrite rule is passing something unexpected.

I recommend adding debug-level=full to your tiddlywiki command line (see https://tiddlywiki.com/#WebServer%20Parameter%3A%20debug-level). From the tiddlywiki server code, it looks like that option will display (among other things) information about the requested url. See the console.log calls below:

        // Find the route that matches this path
        var route = self.findMatchingRoute(request,state);
        // Optionally output debug info
        if(self.get("debug-level") !== "none") {
                console.log("Request path:",JSON.stringify(state.urlInfo));
                console.log("Request headers:",JSON.stringify(request.headers));
                console.log("authenticatedUsername:",state.authenticatedUsername);
        }
        // Return a 404 if we didn't find a route
        if(!route) {
                response.writeHead(404);
                response.end();
                return;
        }

Then after you get the 404 in your browser, you should see the above console.log output from the tiddlywiki process (i.e. in your putty session). If you don't see output, then maybe apache is the one returning the 404 after all. If you do see output, hopefully it gives you a clue on what apache is passing in the $1 part of the rewrite url.

Brian

Jennifer Pritchard

unread,
Jan 20, 2019, 4:20:16 PM1/20/19
to TiddlyWiki
Ok, here's what it gave:

asariel1977@a2plcpnl0868 [~/public_html]$ tiddlywiki notes --listen port=3000 debug-level=full
(press ctrl-C to exit)
 syncer-server-filesystem: Dispatching 'save' task: $:/StoryList
 filesystem: Saved file /home/asariel1977/public_html/notes/tiddlers/$__StoryList.tid
Request path: {"protocol":null,"slashes":null,"auth":null,"host":null,"port":null,"hostname":null,"hash":null,"search":null,"query":null,"pathname":"/public_html/index.html.var","path":"/public_html/index.html.var","href":"/public_html/index.html.var"}
Request headers: {"host":"localhost:3000","cache-control":"max-age=0","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","accept-encoding":"gzip, deflate","accept-language":"en-US,en;q=0.9","cookie":"i3115022_mw1_mw_UserID=1; i3115022_mw1_mw_UserName=Jen; i3115022_mw1_mw_Token=eb09507694eff820f432248f7e6e696a; i3115022_mw1_mw__session=2son1isnk2tphjpa5e3qiod1kadacji3; txtMainTab=Timeline; chkBackstage=false","x-forwarded-for":"71.231.120.115","x-forwarded-host":"www.datajen.com","x-forwarded-server":"datajen.com","connection":"close"}
authenticatedUsername: undefined


So...I guess that's a clue, but I haven't yet figured out what exactly it's telling me.  I wonder why it's adding a ".var" at the end of index.html.  Where is it getting that idea?

Brian Theado

unread,
Jan 20, 2019, 9:43:34 PM1/20/19
to tiddl...@googlegroups.com
Jennifer,

The fact that the tiddlywiki server is receiving a url like "path":"/public_html/index.html.var" means the issue is likely on the you have apache configured or the way the hosting provider has apache configured. So you might find better help on some forum related to your hosting provider.

Do you have any reference to /public_html/index.html.var in your .htaccess file? I'm not sure where that would be coming from.

One thing to try just as an experiment. Add 'path-prefix=/public_html/index.html.var' to your tiddlywiki command line (https://tiddlywiki.com/#WebServer%20Parameter%3A%20path-prefix). If that prefix is always added by apache to the url, then it might help you get a non-404 response from tiddlywiki. Better would be to prevent apache from sending that prefix, but at least this would tell you if there are any additional problems once you resolve that.

Brian

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b75452dc-52a0-4eb4-bff2-8913b6ab8556%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jennifer Pritchard

unread,
Jan 21, 2019, 8:03:09 PM1/21/19
to tiddl...@googlegroups.com
Well, I got it to work...sort of...
By adding a line to the htaccess file, and setting the permissions on public_html to 755, and a couple other things I can't even remember, I got it finally to display the page.  Hurray!  Except...

I immediately get a error about xmlhttprequest, and after a lot of searching, it looks like it's related to the special characters in tiddler names.  If I set authentication to readers=(anon) and writer to be me, and then view the page as anon, I don't get the error (because it's not trying to post back to the server I guess).  If I'm logged in, though, it pops up that error.  Interestingly enough, it *will* let me create new tiddlers and I can confirm that it's saving them back to the server, and when I log off and back on, they're correctly there.  So I suppose technically, I could just ignore the error messages because only I would be seeing them, but it's probably a bigger problem down the road for things I can't even predict yet.  https://stackoverflow.com/questions/4390436/need-to-allow-encoded-slashes-on-apache  has a good discussion on the error and what I would need to do to fix it in the apache httpd.conf (add a line saying "AllowEncodedSlashes NoDecode")...but unfortunately, GoDaddy doesn't give me that option.  Doesn't look like there are any hacks to get around this in htaccess either, so looks like I'm at a dead end.  SO close, yet so far, eh?

On the bright side, this has been a good learning experience.  I've learned how to enable SSH in godaddy, how to set up putty, how to install node *without* using nvm/npm, how to use a lot of node command line features (since I couldn't call them using tiddlywiki without npm support), how to force a shared hosting site to run js code when it really doesn't want to, and finally...I've learned that I need to ditch godaddy.  People have been telling me for ages that I need to (I went with them originally just because I took them up on an offer of $3 a month hosting with a free domain to boot).  I've heard them referred to as nodaddy, and that's been the case for me.  I'd welcome any and all recommendations of other hosts to use that are affordable and won't drive me insane.

Oh, and in my travels through the bowels of stackoverflow and the like, I came across this quote and thought you all would enjoy:

2019-01-21_17h03_59.png



Thanks for your help in getting me this far!

TonyM

unread,
Jan 21, 2019, 8:25:48 PM1/21/19
to TiddlyWiki
Jenifer,

Which part of the world do you want hosting in?

Tony

Jennifer Pritchard

unread,
Jan 22, 2019, 12:03:58 AM1/22/19
to TiddlyWiki
I'm in Seattle (US)

TonyM

unread,
Jan 22, 2019, 1:22:27 AM1/22/19
to TiddlyWiki
Jennifer,

I could offer you some well priced hosting however I am in Sydney Australia, and using a CDN content delivery network may be OK, but you should find some cost effective local servers. However at the moment the Australian Dollar is not so good, so perhaps it would be cost effective in Australian Dollars. My Wholesale provider is https://ventraip.com.au/ however I have capacity under my current plan for an additional 65 control panel accounts so I could offer you something cheaper. 

Any way look around and ask if you are stuck. PS we had some family friends with the Pritchard name many years ago. 

Regards
Tony

On Tuesday, 22 January 2019 16:03:58 UTC+11, Jennifer Pritchard wrote:
I'm in Seattle (US)

Jennifer Pritchard

unread,
Jan 22, 2019, 7:22:15 PM1/22/19
to TiddlyWiki
Well, for now I think I'm going to give in and go the php route using tw-receiver (which I've now got working, except in IE, so that will be a seperate post).  Thanks for your help!

TonyM

unread,
Jan 22, 2019, 7:28:00 PM1/22/19
to TiddlyWiki
Jennifer,

Understood, I expected that would be the case from my first reply. I do feel there should be a way to allow a given user to check out and check in the edit process, so we can have serial editors if we can't have multi-user access. If this were so tw-receiver, some user management and the checking tools would be all many possible applications would require.

Regards
Tony
Reply all
Reply to author
Forward
0 new messages