Skip to content
74 changes: 62 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ apache-tools

Scripts Apache

#balancer-manager.py
##Dependency
```bash
apt-get install python-argparse
yum install python-argparse
```

Allow you to manage Worker/BalancerMember defined in your apache2 mod_proxy conf :
##manage-proxy-balancer.py

Allows you to manage Worker/BalancerMember defined in your apache2 mod_proxy conf :

```bash
<Proxy balancer://tomcatservers>
Expand All @@ -26,24 +32,68 @@ Like :
Allow from 127.0.0.1
</Location>
```
##Example of use:
### JK Balancer
```bash
./manage-jk-balancer.py -l
./manage-jk-balancer.py -w ajp://10.152.45.1:8001 -a enable
```
##manage-jk-balancer.py
Allows you to manage Worker/BalancerMember defined in your apache2 mod_proxy conf :

Fix if necessary :
```bash
#vhostname
headers = {"Host": '127.0.0.1' }
#ip to reach apache
url="http://127.0.0.1/balancer-manager"
JkWorkersFile /etc/httpd/conf.d/workers.properties
JkLogFile "| /usr/sbin/rotatelogs -l /var/log/httpd/mod_jk-%Y-%m-%d.%H.log 3600"
JkLogLevel error
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize -ForwardDirectories +ForwardURICompatUnparsed
JkShmFile [PATH]../jk.shm
JkMount /jkstatus/* status
JkMount /* [BALANCER NAME]
```

```bash
worker.status.type=status

##Dependency
worker.template.type=ajp13
worker.template.socket_timeout=180
worker.template.socket_connect_timeout=5000
worker.template.retries=2
worker.template.recovery_options=3
worker.template.distance=0

worker.appsrv00.reference=worker.template
worker.appsrv00.host=app01.example.com
worker.appsrv00.port=8080
worker.appsrv01.reference=worker.template
worker.appsrv01.host=app01.example.com
worker.appsrv01.port=9080
worker.appsrv10.reference=worker.template
worker.appsrv10.host=app02.example.com
worker.appsrv10.port=8080
worker.appsrv11.reference=worker.template
worker.appsrv11.host=app02.example.com
worker.appsrv11.port=9080

worker.appsrv.type=lb
worker.appsrv.method=B
worker.appsrv.recover_time=30
worker.appsrv.balance_workers=appsrv00 appsrv01 appsrv10 appsrv11

worker.list=status appsrv
```
You have to allow /jkstatus
```bash
apt-get install python-argparse
<Location /jkstatus>
Order deny,allow
Deny from all
Allow from localhost 127.0.0.1
</Location>
```

##Example of use:

### Proxy Balancer
```bash
./balancer-manager.py -l
./balancer-manager.py -w ajp://10.152.45.1:8001 -a enable
./manage-proxy-balancer.py -l
./manage-proxy-balancer.py -w ajp://10.152.45.1:8001 -a enable
```
112 changes: 0 additions & 112 deletions balancer-manage.py

This file was deleted.

Loading