Tutorial on LAMP and Nodejs setup?

Posted June 1, 2017 8.8k views
Node.jsLAMP Stack

Has anyone had any luck installing LAMP server then NodeJs? All my temps have fail with doing them both side by side.
Trying to get NodeJS to work on port 3000 or even load up on the URL. always gives me a url error or page wont load up.
I have tryed the apache proxypass https and still it refuses to work.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers


I think that you should try to access your NodeJS app on this url

You are running apache as a reverse proxy and behind it you have your NodeJS app running on localhost that is why your url gives connection refused error.

Hope this helps, if it does not provide me with your apache configuration and the output of netstat -ltn | grep 3000 to make sure that your NodeJS app is running and the apache proxy is setup correctly.


When using Apache as a proxy to your NodeJS application, you should be proxying to the app on the IP and Port it’s running on and then access your domain without the port attached.

The purpose of using a proxy setup is to prevent the port from being required in the URL.

If, when you access your domain without the port attached, it’s still failing, please post the output of:

tail -20 /var/log/apache2/error.log

as well as your VirtualHost configuration so that we can take a look at it and see if there’s anything that’s causing it to fail.

To keep formatting in check, you can use the </> icon in the editor. That’ll allow you to post each piece in a code block.

I started complately over and did the basic’s with this guide. Then after it was all setup I added php,mysql and phpmyadmin with .htaccess.

But my big question now is how can I upload a none nodejs project? without effect the nodejs server.

by Brennen Bearnes
Node.js is an open source JavaScript runtime environment for easily building server-side and networking applications. Node.js applications can be run at the command line but this guide focuses on running them as a service using PM2, so that they will automatically restart on reboot or failure, and can safely be used in a production environment.