Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Confusing apache setup

    Hello. I'm having trouble figuring out how to configure apache for the following:

    www.server.com/mstar should go through passenger (the Ruby on Rails mod)

    but anything else, such as:
    www.server.com/
    www.server.com/index.hmtl
    etc
    should go through mod proxy.

    So, I would need something to check if it has /mstar as the first component of the path and if so, have it served through passenger. But anything else should go through mod_proxy.

    something like:

    <VirtualHost *:80>
    ServerName beta.server.com

    DocumentRoot /home/ruby/webapps/m-star/current/public

    <Location /mstar>
    PassengerEnabled onn
    RailsBaseURI /mstar
    # This relaxes Apache security settings.
    AllowOverride all
    # MultiViews must be turned off.
    Options -MultiViews FollowSymLinks
    Order allow,deny
    Allow from all
    </Location>

    ProxyPass / http://beta.server.com:8890
    ProxyPassReverse / http://beta.server.com:8890
    <Location />
    PassengerEnabled off
    Order allow,deny
    Allow from all
    </Location>
    </VirtualHost>

    However, this of course is not working.

    Can you give me some pointers on what to look at in the apache configurations to accomplish this?

  • #2
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I got the following to work for me:


    <VirtualHost *:80>
    ServerName beta.server.com

    ProxyRequests Off
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>

    PassengerEnabled off

    ProxyPassMatch ^/(?!mstar)(.*) http://beta.server.com:8890/$1
    ProxyPassReverse / http://beta.server.com:8890

    DocumentRoot /home/ruby/webapps/m-star/current/public
    <Directory "/home/ruby/webapps/m-star/current/public">
    PassengerEnabled on
    RailsBaseURI /mstar
    # This relaxes Apache security settings.
    AllowOverride all
    # MultiViews must be turned off.
    Options -MultiViews FollowSymLinks
    Order allow,deny
    Allow from all
    </Directory>

    </VirtualHost>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •