Comments on How to Install Mailtrain Newsletter Application on CentOS 7

Mailtrain is an open source self-hosted newsletter application written on Node.js. In this tutorial, we will install Mailtrain along with all the required dependencies on CentOS 7. We will also setup Nginx as a reverse proxy to serve the application on standard HTTP port.

4 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Pete

The security of all node.js webapps is suspect.  Being popular, doesn't make something secure - especially when javascript is involved.  https://www.owasp.org/index.php/OWASP_Node_js_Goat_Project

By: Lance

I'm getting "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

" when I try to use Maria DB. I'm on the "mysql_secure_installation" part of the tutorial

By: Lance

 I think I might of solved the database issue. It was just a matter of entering the database commands in the proper order. I had trouble staring Redis so I followed the turorial at https://www.linode.com/docs/databases/redis/install-and-configure-redis-on-centos-7. I hope that didn't screw anything up. It seemed to get redis working. I did install the dependancies

My new issue is when I run "NODE_ENV=production npm start" I get the following output ...........

> [email protected] start /opt/mailtrain

> node index.js

 

info Using local auth 

/opt/mailtrain/node_modules/posix/lib/posix/index.js:25

    throw new Error("unable to load the node-posix extension module");

    ^

 

Error: unable to load the node-posix extension module

    at load_extension (/opt/mailtrain/node_modules/posix/lib/posix/index.js:25:11)

    at Object.<anonymous> (/opt/mailtrain/node_modules/posix/lib/posix/index.js:28:13)

    at Module._compile (module.js:635:30)

    at Object.Module._extensions..js (module.js:646:10)

    at Module.load (module.js:554:32)

    at tryModuleLoad (module.js:497:12)

    at Function.Module._load (module.js:489:3)

    at Module.require (module.js:579:17)

    at require (internal/module.js:11:18)

    at tryRequire (/opt/mailtrain/node_modules/try-require/index.js:18:16)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! [email protected] start: `node index.js`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the [email protected] start script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

 

npm ERR! A complete log of this run can be found in:

 

npm ERR!     /root/.npm/_logs/2017-11-14T22_48_34_198Z-debug.log

 

-

here's the  "/root/.npm/_logs/2017-11-14T22_48_34_198Z-debug.log"---------------------------------------------------->

 

 

0 info it worked if it ends with ok

1 verbose cli [ '/usr/bin/node', '/bin/npm', 'start' ]

2 info using [email protected]

3 info using [email protected]

4 verbose run-script [ 'prestart', 'start', 'poststart' ]

5 info lifecycle [email protected]~prestart: [email protected]

6 info lifecycle [email protected]~start: [email protected]

7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true

8 verbose lifecycle [email protected]~start: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/opt/mailtrain/node_modules/.bin:/sbin:/bin:/usr/sbin:/usr/bin

9 verbose lifecycle [email protected]~start: CWD: /opt/mailtrain

10 silly lifecycle [email protected]~start: Args: [ '-c', 'node index.js' ]

11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null

12 info lifecycle [email protected]~start: Failed to exec start script

13 verbose stack Error: [email protected] start: `node index.js`

13 verbose stack Exit status 1

13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)

13 verbose stack     at emitTwo (events.js:126:13)

13 verbose stack     at EventEmitter.emit (events.js:214:7)

13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)

13 verbose stack     at emitTwo (events.js:126:13)

13 verbose stack     at ChildProcess.emit (events.js:214:7)

13 verbose stack     at maybeClose (internal/child_process.js:925:16)

13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

14 verbose pkgid [email protected]

15 verbose cwd /opt/mailtrain

16 verbose Linux 3.10.0-693.el7.x86_64

17 verbose argv "/usr/bin/node" "/bin/npm" "start"

18 verbose node v8.9.1

19 verbose npm  v5.5.1

20 error code ELIFECYCLE

21 error errno 1

22 error [email protected] start: `node index.js`

22 error Exit status 1

23 error Failed at the [email protected] start script.

23 error This is probably not a problem with npm. There is likely additional logging output above.

 

24 verbose exit [ 1, true ]

 

 

By: Bryan

I had the same problem running a minimal installation of centos 7.   Installing the "Base" centos package group and reinstalling everything solved the problem.