Use Node.js and PHP on the same server (Amazon EC2)

3

My site is made "totally" in PHP and I used Node.js for the real-time chat part. I'm using the AWS services and I had a big question:

Can I install Node.js in the same instance of PHP (apache) or should I create an instance for Node separately?

    
asked by anonymous 10.11.2016 / 17:28

2 answers

4

Yes you can, Apache by default uses port 80 and you can set another port for NodeJS like 8888.

    
10.11.2016 / 18:36
2

According to Eduardo's answer, you can use APACHE together with NodeJS on separate ports. I would advise you to put APACHE or NGINX in the FRONT of NodeJS as a reverse proxy, so you just need to leave the default HTTP port (80 or 443).

Reverse proxy in NGINX

link

Reverse proxy in APACHE

link

    
14.11.2016 / 22:41