0

Os : CentOS Linux release 7.7.1908 (Core)

Node Version : v12.11.1

Npm Version : 6.11.3

Hey guys

I have Apache and Nodejs on same server , i installed WikiJs on my server and its ok , its running on port 8000 .

For running apache and nodejs together i flow this answer and its running perfectly .

But the problem is its need the node server command always running on the server.

what i have to do , that its no need to run the node server command but its work on my domain?

thanks.

meti
  • 468
  • 1
  • 5
  • 27

2 Answers2

1

You can't run a program that depends on Node.js without running Node.js.

You can do that directly, you can write a startup script (e.g. with @reboot in cron or as an /etc/init.d/ script) to do it for you, you can do it via a tool like nodemon, but something needs to run the software using Node.js.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
1

You can use nohup command to run the command in the background.

nohup node server

If you want to access the server to kill the process:

ps -aux

The above command will list processes.

kill -9 <PID>

You can find more details in the link provided above.

MEDZ
  • 2,227
  • 2
  • 14
  • 18