Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

load balancing

  • 10-03-2010 4:11pm
    #1
    Registered Users, Registered Users 2 Posts: 134 ✭✭


    question on apache http 2.2

    anyone know how to configure apache as a load balancer but still enable it to also act as a file server. the scenario is there are several tomcat servers sitting behind the apache, but the apache is currently in use as a file server and i can't do anything to disrupt that.

    can it be done or will a second instance is required?


Comments

  • Registered Users, Registered Users 2 Posts: 2,426 ✭✭✭ressem


    Any reason why you'd think there'd be an issue?

    There's plenty of methods to exclude a subdirectory or virtual machine from being sent by the proxy to the tomcat machines.

    If the file server is on a different virtual host, then you just add the proxypass statement only within the tomcat virtual host.
    # Tomcat servers on port 8080
    <VirtualHost *:8080>
      ServerName www.example.ie
      ProxyPass / balancer://mybalancedservers/ 
      ProxyPassReverse / balancer://mybalancedservers/
    </VirtualHost>
    
    # My file serving webdav servers on port 80
    <VirtualHost *:80>
      ServerName www.example.ie
    </VirtualHost>
    
    <Proxy balancer://mybalancedservers>
      BalancerMember http://10.0.0.1:8080  
      BalancerMember http://10.0.0.2:8080
      ProxySet lbmethod=byrequests
    </Proxy>
    
    

    Otherwise, you can use an exclamation mark to NOT / exclude a particular path or type of file etc.
    ProxyPass /myexcludedpath !
    
    
    

    www.howtoforge.com/load_balancing_apache_mod_proxy_balancer+apache+proxypass+balancing&cd=19&hl=en&ct=clnk&gl=ie


  • Registered Users, Registered Users 2 Posts: 134 ✭✭d4v1d


    thanks for the reply. i had no reason to think there would be a problem but also no reason to think it would have worked, or how easy it is. i normally don't get involved in the web-service config, i just like to be given my url and told 'there it is', but circumstances change :)

    the change looks very straight forward and simple to reverse if there are any issues.

    i'll try it later on this evening when things are quieter and let you know how i get on.

    thanks again


  • Registered Users, Registered Users 2 Posts: 134 ✭✭d4v1d


    cool. i made some tweaks to the configuration but this has worked for me.


Advertisement