New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
NodeJS hosting using DirectAdmin
Hello folks,
i feel lost, i would like to host "wiki.js" on my hosting provided by MyW.pt. On their side they support it but they are not used to deal with NodeJS apps so i would like to ask LET community for some help.
I've found some documentations aroung the web but they were related to other providers and they settings, i think. I would like some tips and advices or links to help me host wiki.js on a DirectAdmin supported by CloudLinux system.
Thanks a lot!
Thanked by 1MikePT
Comments
CC @MikePT
I think you can get it working by:
server
Hope you will have better mileage than me - I am trying to get https://github.com/outline/outline working but this thing only works with Postgres and the box seems to have some restrictions for outbound target ports, disallowing 5432. Will talk to Mike offline to evaluate risks of enabling this port.
Hey guys,
Yep I don't deal with NodeJS that much, I can try to have a look at it Friday if the OP wants @o_be_one .
@cnbeining thank you for helping the OP, we really appreciate it :-)
Btw, port 5432 has been open in the DE server. If you need it open in the other servers just let us know, we'll open it
My god Outline is even a pain using Docker at this time, i really hope they will make it easier ^^. Thanks for sharing those good information regarding my request, i really appreciate and hope the time you spent to give a step by step howto could help some other users.
Thank you so much Mike! Finally i've just hosted BookStack on few VPS i use as Docker host. I had to find a solution as some people from non-profit orgs were waiting for a wiki solution ^^. I feel like NodeJS hosting under CloudLinux with DirectAdmin is not that common. Also i didn't wanted to push you as you already provide what i pay for and helping me on this is "extra work" on your side.
Oh you think the port had to be open? I was asking myself how this would work with DirectAdmin, like if it was aware of the NodeJS service to be like reverse proxied when you use the NodeJS app feature that is inside the panel.
With Cloudlinux it's easy to manage via DA:
https://www.cloudlinux.com/getting-started-with-cloudlinux-os/42-profitability-and-php-features/959-nodejs-selector/
And, if you're not using Cloudlinux;
* Let your host/ install the latest version of NPM and have your host/you have to implement some form to auto update the NPM version
* Install Supervisor or PM2 as a process manager for the webapp
* execute your NPM commands for your NodeJS app
* Expose it to localhost on a internal port, ie 127.0.0.1:58000 or 127.0.0.1:8080 or any unused for example
* Setup an proxypass to the internal application in the used webserver (LS/Apache/Nginx)
* Done
I have never hosted nodejs app on a DirectAdmin server.
I prefer to host nodejs app on a VPS without any control panel or using CloudPanel.io (recently started using this, and its free).
Not necessarily.
With my extremely limited understanding on what's happening under the hood with this DA + Node/Python/COBOL Selector is:
node
binary(of specific version) andnode_modules
folder by setting upvirtualenv
insideCageFS
of specific user. That's why you can usenode
command and can "select" versions.SO back to your question -
NO there's no port that need to be opened as Passenger will arrange Apache to reverse proxy such process. And MAYBE we can manually tweak Passenger by editing
.htaccess
to make it run with any binary.CC @MikePT .
Rant: I can totally see how shared hosting adopting Firecracker as KVM-based real jail replacing CloudLinux once quota can be setup. That's when the line between NAT VPS and Shared Hosting will diminish and OVZ/LXC will become pointless and I look forward for that day.
Why not? I run it currently, works perfectly fine.
Yes, nodejs apps should work perfectly on DA. Its just that I don't have DA with pro pack... my bad
Me either haha, I use CloudLinux + litespeed works well. Not had any user complaints either.
Woaw thank you so much for all details, it's really interesting and helpful!
I have Outline deployed in production using Docker - holler if you need any help
Interesting, selfhost Notion?
A new project for a non-profit just entered and i finally may use the NodeJS support from MyW.pt ^^. Pretty happy there is already so much resources here to achieve my goals!
Yep, from my researches one of the closest to Notion that could be self-hosted.
Thank you so much! I've worked on my Traefik knowledges and i'm getting better at it, pretty sure my issue was more related to the configuration ive put in this service. I guess you used Notion in the past? What do your think about Notion vs Outline?
I agree.
I actually never tried Notion - went straight to using Outline with Caddy and Keycloak.
I find Traefik pretty good, but I much prefer Caddy, it's easier to use and fits better into my bash scripts and Ansible playbooks.
I do have some users that have tried both Outline and Notion, and although Notion is more polished and has a larger feature set, I've had no complaints regarding Outline.
I now use it for all internal and external documentation and I really like it. I prefer it to BookStack for example, which I also had running for a while.
I find Outline much lighter. I don't really want to allocate any energy to "learn" Notion: all I want is something fast that can host Markdown docs with search function and Outline does this very well.
As for deployment - shared hosting could be hard unless you can hack Redis in.
I've got this running on Heroku - https://www.cnbeining.com/2021/12/free-personal-wiki-with-outline-on-heroku-with-personal-domain-via-cloudflare/ and https://www.cnbeining.com/2022/01/hacking-outline-wiki-making-slack-login-works-with-other-methods-like-oidc/ .
Ahah i was on Caddy before jumping on Traefik xD! I really loved Caddy but now i prefer Traefik as i feel like it's more "Docker friendly" with label configs. Probably i've missed this regarding Caddy features, i don't know. I configure my Traefik directly in it's compose (no yaml file, only env vars) so i think it's quite Ansible friendly but i may miss some requirements you had.
Yeah regarding Outline on my side it's more for the privacy side i was interested.
I usually install node on a shared account like this:
`
#!/bin/bash
# install node
add_to_path()
{
if [[ "$PATH" =~ (^|:)"${1}"(:|$) ]]
then
return 0;
fi
export PATH=${1}:$PATH;
sed -i "/export PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/root\/bin:\/home\/$USER\/bin/d" ~/.bashrc;
echo "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/home/$USER/bin" >> ~/.bashrc;
source ~/.bashrc;
}
echo "install node";
node_file="nodejs.tar.gz";
cd ~;
mkdir bin;
cd bin;
rm -f node;
rm -f npm;
rm -rf nodejs;
wget -r -nd -l1 --no-parent -e robots=off -A "linux-x64.tar.gz" https://nodejs.org/dist/latest/;
mv nodelinux-x64.tar.gz $node_file;
tar -xvf $node_file;
rm -f ./$node_file;
mv node*linux-x64 nodejs;
cp ./nodejs/bin/node ~/bin;
ln -s ./nodejs/lib/node_modules/npm/bin/npm-cli.js npm;
add_to_path $(pwd);
node --version;
npm --version;
`
Once it's installed you can do whatever.