0

I am trying to get the hang of the reverse proxy features in Apache. I am using the Bitnami RubyStack on Windows Server 2012. The following configuration makes Apache not even to start - the error.log doesn't seem to be any helpful about what is going wrong.

<VirtualHost *:80> ServerName mydomain.nl ServerAlias mysub.mydomain.nl # this is a Rails application DocumentRoot "C:/Bitnami/rubystack-2.0.0-17/projects/dummy" RewriteEngine On <Proxy balancer://thinservers> BalancerMember http://127.0.0.1:3001 </Proxy> # Redirect all non-static requests to thin RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://thinservers%{REQUEST_URI} [P,QSA,L] # Custom log file locations ErrorLog "C:/Bitnami/rubystack-2.0.0-17/projects/dummy/log/error.log" CustomLog "C:/Bitnami/rubystack-2.0.0-17/projects/dummy/log/access.log" </VirtualHost> 

What I am trying to achieve is to forward incoming requests on port 80 to 3001. I think however there might be a problem, as the Bitnami document root is also configured.

I am not really comfortable within Apache. I have included the modules for the proxy features I needed. As long as I don't include the vhosts, Apache will start fine. Yet, I have no clue what Rewriting and BalanceMember are supposed to do.

EDIT: after some permission checking, I got Apache started, but I get an Internal Server Error when accessing port 80.

No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

4
  • See Why not use a WAMP stack? for the reasons why this setup is not a good idea. Commented Sep 7, 2014 at 14:30
  • What does a WAMP stack have to do with Reverse Proxy configuration? Besides - the P stands for PHP. I am using a Rails app. Commented Sep 7, 2014 at 17:44
  • The issues are exactly the same. Commented Sep 7, 2014 at 17:49
  • Using a stack for development reasons shouldn't be the real issue - I totally agree on such agreements not to use them in production environments. However, my question means that I've no real knowledge about Apache setup. There are tons of examples, but I have no real clue how I am supposed to achieve what I want - it wouldn't make a real difference with a regular setup. Commented Sep 7, 2014 at 21:04

1 Answer 1

4

After some digging, I found something similar that just nails it. I found obscure tutorials, even bad links on the Apache doc section. So, for everyone who really doesn't care about Apache ins-and-outs, but just wants their Rails apps to fly with reverse proxy on the Bitnami Rubystack.

Include the vhosts in the main configuration file (httpd-conf) Add your customized vhost entry in the extra/vhosts.conf

NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot "YOUR_BITNAMI_INSTALL_DIR/rubystack-2.0.0-17/projects/dummy/public" ServerName your-subdomain.domain.com ProxyPass / http://localhost:3001/ ProxyPassReverse / http://localhost:3001/ </VirtualHost> 

Does the trick perfectly!

1
  • I have tried this but get error Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details. Commented May 12, 2020 at 6:17

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.