From 850aea4627cfd4f7d63b756541a4ad047aa1706f Mon Sep 17 00:00:00 2001 From: James Murray Date: Wed, 31 Jul 2019 10:59:11 -0500 Subject: [PATCH 1/2] Updated docs with my experience getting jsreport to work on amazon linux 2. --- docs/amazon-linux-2.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/amazon-linux-2.md diff --git a/docs/amazon-linux-2.md b/docs/amazon-linux-2.md new file mode 100644 index 0000000..fd1cee4 --- /dev/null +++ b/docs/amazon-linux-2.md @@ -0,0 +1,41 @@ +The installation script for Amazon Linux + +```bash +# install node.js +wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash +# reopen terminal +nvm install 8.11.3 + +mkdir jsreportapp +cd jsreportapp +npm i -g jsreport-cli +# this is less secure, but it's the only way found to get puppeteer installed on amazon linux 2. +sudo npm i -S jsreport --unsafe-perm=true +jsreport init +jsreport configure + +# change in the jsreport.config.json the following +# it makes chrome less secure but currently the only way on amazon linux 2 +"chrome": { + "launchOptions": { + "args": ["--no-sandbox"] + } +} + +# install chrome dependencies +wget -qO- https://intoli.com/install-google-chrome.sh | bash + +# start jsreport to see it running on port 5488 + +jsreport start + +# the next steps are optional to start jsreport on boot +npm install pm2 -g +pm2 start server.js +pm2 startup +# run the output of previous command + +# optionally if you want to use older phantomjs for pdf rendering +npm i jsreport-phantom-pdf --save --save-exact +``` + From 57f3c6a1c7d47fa0557ec4da0b710e04b2f84a91 Mon Sep 17 00:00:00 2001 From: James Murray Date: Wed, 31 Jul 2019 13:27:30 -0500 Subject: [PATCH 2/2] Forgot a step. Needed to install chrome also. --- docs/amazon-linux-2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/amazon-linux-2.md b/docs/amazon-linux-2.md index fd1cee4..665818b 100644 --- a/docs/amazon-linux-2.md +++ b/docs/amazon-linux-2.md @@ -9,6 +9,7 @@ nvm install 8.11.3 mkdir jsreportapp cd jsreportapp npm i -g jsreport-cli +curl https://intoli.com/install-google-chrome.sh | bash # this is less secure, but it's the only way found to get puppeteer installed on amazon linux 2. sudo npm i -S jsreport --unsafe-perm=true jsreport init