Run a NodeJS app with Apache

后端 未结 1 974
孤街浪徒
孤街浪徒 2021-01-01 07:47

I have a ubuntu server running a few apache websites. I want to run a nodejs app on the same server. I have the app running on the server now out of port 3000 (www.example.c

1条回答
  •  南笙
    南笙 (楼主)
    2021-01-01 08:42

    First of all, you should to install mod_proxy and mod_proxy_http.

    Then you can use something like the following configuration:

    
      ServerAdmin spam@example.com
      ServerName example.com
      ServerAlias www.example.com 
    
      ProxyRequests off
    
      
        Order deny,allow
        Allow from all
      
    
      
        ProxyPass http://localhost:3000/
        ProxyPassReverse http://localhost:3000/
      
    
    

    0 讨论(0)
提交回复
热议问题