简体   繁体   中英

LAMP and nodejs on the same server

I am having a PHP(Laravel Framework) application and a nodejs application. The nodejs application is used for sending push notification to user browser in conjunction with socket.io .Since PHP is not a better solution for long polling process I had to include node.js application in to my stack. I am using nodejs only for a single functionality (to show some real time data to a user who comes to my page ).

I can expect a concurrent connection of 1000 , so I avoided using PHP for ajax long polling and used nodejs for handling long polling along with socket.io

Now I am confused whether deploying my PHP application and nodejs application will cause any issues? My PHP application will be communicating with nodejs app through internal APIs.

Is it fine to deploy nodejs on a LAMP stack in terms of performance? Does the traffic hits (long polling) process on nodejs affects my server and there by affects my PHP application?

No Problem having them on same server. Just make sure the nodejs server isn't trying to bind on the same ports as the apache (ie. not 80/443)

Php and Nodejs application can be run at a single machine without any conflict.It will not affect your Php application performance. Your Php application apache server will run on diffrent port and Nodejs will run on different port. But there is a way to set proxy in apache config to run node and php similar kind of actions.

See this link to set proxy.

All your nodejs and Php url will look like below:

http://localhost/node/ [All NodeJs actions]
http://localhost/normalPhpActions/ [All Php Actions]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM