The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to set cPanel to use ProxyPass for Ruby or any other backend server apps?

Discussion in 'EasyApache' started by ylluminate, Jun 28, 2013.

  1. ylluminate

    ylluminate Member

    Joined:
    Apr 12, 2013
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I have a Ruby app that needs to run on a cPanel host. I do have root access to the server.

    I would like to be able to set a subdomain to utilize ProxyPass to allow me to run unicorn or any other server I wish for this Ruby app (and later I will be running nodejs apps), however the instructions here do not seem entirely clear.

    For example, in the section "Custom Templates for Subdomains and Addon Domains", it notes that we should follow 3 steps, however to where do we copy the `vhost.default` or `ssl_vhost.default`? So for example, if I have example.tld, which runs fine normally on the default Apache cPanel setup, but I have another.example.tld that I want to pass through to a ruby backend, what precisely do I do?

    I believe that it should be as simple as inserting

    Code:
    ProxyPass / http://127.0.0.1:3001
    into this file once I figure out where it should go and then run an incantation like:

    Code:
    usr/local/cpanel/bin/apache_conf_distiller --update
    /scripts/rebuildhttpdconf
    Correct? I would very much appreciate some exact steps and configuration options that should go in the file as well if you are able to shed any additional light on the subject.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,776
    Likes Received:
    663
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    If you are editing a single VirtualHost instead of editing the default template for new VirtualHosts, then you can follow the instructions at:

    Changes Contained Within a VirtualHost Directive

    Focus on the "Using Include Files" and "For an individual VirtualHost container" section of this document. After creating the file for the appropriate domain/username and version of Apache, you can insert your custom line to that file, and then run the following commands:

    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    /scripts/rebuildhttpdconf
    No additional steps are required, and the change you made should be active.

    Thank you.
     
Loading...

Share This Page