Skip to content

Directions ver 0.1

Mike 'mitch' Mitchel edited this page Mar 1, 2018 · 8 revisions

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 ---

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 ---

  1. unzip standalone DAT package to Appache web root
  • or -
  1. clone StandaloneDat Repo from https://github.com/CCALI/A2JDAT

  2. cd to the new directory

  3. npm install -- install main dependancies

  4. cd js

  5. npm install bootstrap -- install bootstrap styles

  6. cd back to DAT parent directory, cd ..

  7. need a config.json file in web root

  8. npm run build

  9. npm run build:server

  10. 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

Clone this wiki locally