-
Notifications
You must be signed in to change notification settings - Fork 1
Directions ver 0.1
These instructions are for installing the A2J Standalone Document Assembly Tool, referred to as A2J-DAT or just DAT in the rest of this document. All steps are based on hosting in conjunction with the A2J Viewer and using:
Ubuntu Server 14 NPM 5.x Node 8.x wkhtmltopdf 0.12.1 in headless configuration
It may work with newer or different versions, but it has not been tested. Please let us know if you have any success in different environments and the steps you've taken to overcome any issues.
Follow standalone viewer install instrucitons here if you haven't already: https://github.com/CCALI/A2JViewer
--- permissions reminder ---
The owner of the web server process (www-data
on Ubuntu for example) needs to have write permission to the guides
directory.
--- wkhtmltopdf install notes ---
- wkhtmltopdf 0.12.1 on Ubuntu server 14: https://wkhtmltopdf.org/index.html
- wkhtmltopdf needs to run headless: http://askubuntu.com/a/605644
To install correct version of wkhtmltopdf (as root user).
-Install via apt-get wkhtmltopdf
-Test
root@server# wkhtmltopdf http://www.google.com test.pdf
-If the above generates a pdf with no errors you are done
-If not, do the following
root@server# apt-get install xfonts-75dpi
root@server# apt-get install xfonts-base
root@server# wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-trusty-amd64.deb
root@server# dpkg -i wkhtmltox-0.12.2_linux-trusty-amd64.deb
-- Test
root@server# wkhtmltopdf http://www.google.com test.pdf
--- Node Server install notes ---
-Install npm
via apt-get npm
-Then from command line...
root@server# npm cache clean -f
root@server# npm install -g n
root@server# n 8.9.3
root@server# node -v
-There may be a need to make a symlink from /usr/local/bin/node
to /user/bin/node
--- End Node Server ---
- unzip standalone DAT package to Appache web root
- or -
-
clone StandaloneDat Repo from https://github.com/CCALI/A2JDAT
-
cd
to the new directory -
npm install
-- install main dependancies -
cd js
-
npm install bootstrap
-- install bootstrap styles -
cd
back to DAT parent directory,cd ..
-
need a
config.json
file in web root -
npm run build
-
npm run build:server
-
npm start
default Node port is 3000, but can be updated in bin/www
or overwritten by setting
process.env.PORT
to the desired port.
Set or add the path to the standalone A2J Viewer and WkHtmlToPdf in your config.json
file:
}
"WKHTMLTOPDF_PATH": "/usr/local/bin/wkhtmltopdf",
"VIEWER_PATH": "/Users/mitchel/Sites/a2j-viewer/viewer"
}
TODO: -- PM2 setup and cheatsheet to start/stop/restart node gracefully
Dashboard to track whether Node is up and log of pdf creation, -- buttons to restart node using pm2 -- possible recreate button from failed attempt