# Apache + FPM Load balance problems



## Fleshdoom (May 23, 2013)

I'm having some problems with Apache virtual hosts (vhosts scripts are set in /home/vhosts/$VHOST).

```
<VirtualHost *:80>
ServerName www.site.com
ProxyPass / fcgi://192.168.56.202:9001/home/vhosts/www.site.com/
ProxyPassReverse / fcgi://192.168.56.202:9001/home/vhosts/www.site.com/
ErrorLog "logs/www.site.com-error_log"
CustomLog "logs/www.site.com-access_log" common
</VirtualHost>
```
This configuration works, when Apache receives a request for domain "www.site.com" it will forward it to 192.168.56.202 back-end server and this server finds the proper script at /home/vhosts/www.site.com. 

My problems are concerning load balancing. My configuration is:

```
<VirtualHost *:80>
ServerName www.site.com
<Proxy balancer://site>
BalancerMember fcgi://192.168.56.204:9001
BalancerMember fcgi://192.168.56.203:9001
</Proxy>
ProxyPass / balancer://site/
ErrorLog "logs/www.site.com-error_log"
CustomLog "logs/www.site.com-access_log" common
</VirtualHost>
```
But it is not working: requests will be forwarded to those back-ends, but I can't figure out how to make those BalancerMember back-ends to point at /home/vhosts/www.site.com.
How should I do that?


----------



## quintessence (May 30, 2013)

Hello,

Try adding DocumentRoot pointing to /home/vhosts/www.site.com after ServerName and before <Proxy balancer....


----------

