useradd --home /opt/mathjax --shell /bin/nologin mathjax install -d -m 755 -o mathjax -g mathjax /opt/mathjax sudo -u mathjax touch /opt/mathjax/.bashrc cd /opt/mathjax sudo -u mathjax npm install https://github.com/mathjax/MathJax-node/archive/0.5.2.tar.gz sudo -u mathjax npm install https://github.com/tiarno/mathjax-server/tarball/master cd node_modules ln -s mathjax-node MathJax-node cd /opt/mathjax/node_modules/mathjax-node/batik sudo -u mathjax wget https://downloads.apache.org/xmlgraphics/batik/source/batik-src-1.18.zip sudo -u mathjax unzip batik-bin-1.8.zip ln -s batik-1.8/batik-rasterizer-1.8.jar batik-rasterizer.jar ln -s batik-1.8/lib lib sudo -u mathjax touch /opt/mathjax/mathjax.js echo "var server = require('./node_modules/mathjax-server/index.js'); server.start(8003);" >> mathjax.js cd /opt/mathjax cat mathjax.js #Output must be: var server = require('./node_modules/mathjax-server/index.js'); server.start(8003); sudo -u mathjax node mathjax.js |