Can I run Apache and Node.js on the same Linode?

Linode Staff

I would like to run Apache and Node.js on the same Linode, but I only have a single IP address. Can this be done?

3 Replies

Yes this can be done. We do not have official documentation on this, but I was able to track down some information that should be useful.

These examples offer two separate ways to accomplish this using Apache's mod_proxy feature, which you can read more about at the following link:

As an aside, it would be nice to have http/https links automatically render as such on this site, instead of just plain text.

…but I only have a single IP address. Can this be done?

Rather than worrying about how to run Apache and Node side by side, you could consider proxying node.js through Apache. Here is a great article on how to do this. First you need to install mod_proxy

In the author's example all traffic comes to apache on port 80, but some traffic gets routed to an upstream node service using a Location directive. This is where mod_proxy comes in…

mod_proxy allows for the addition of ProxyPass and ProxyPassReverse directives. These allow you to remap requests to upstream servers.

<VirtualHost *:80>
  ErrorLog   "/var/log/httpd/com.example.local-error_log"
  CustomLog  "/var/log/httpd/com.example.local-access_log" common

  ## Here's our magic
  ProxyRequests off

  <Proxy *>
    Order deny,allow
    Allow from all

  <Location /> # no, this closing tag is not a typo
    ProxyPass        http://localhost:4567 # Our port goes here
    ProxyPassReverse http://localhost:4567

With this setup any traffic on <host>:80/ gets routed to a node server listening on http://localhost:4567


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct