Ci-dessous, les différences entre deux révisions de la page.
linux:pound [03-12-2012 09:29] edmc73 créée |
linux:pound [04-04-2013 22:06] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Pound : reverse proxy / load ballancer ====== | ||
- | Installons maintenant **pound** qui permet le reverse-proxy et load-balancer | ||
- | aptitude install pound | ||
- | | ||
- | Voici notre 1ère règle de config de pound | ||
- | |||
- | < | ||
- | ListenHTTP | ||
- | Address 70.70.70.70 | ||
- | Port 80 | ||
- | |||
- | ## allow PUT and DELETE also (by default only GET, POST and HEAD)?: | ||
- | xHTTP 0 | ||
- | |||
- | Service | ||
- | HeadRequire "Host: .*www.p2pfr.com.*" | ||
- | BackEnd | ||
- | Address 192.168.0.2 | ||
- | Port 80 | ||
- | End | ||
- | End | ||
- | End | ||
- | </ | ||
- | |||
- | <note tips> | ||
- | HeadRequire supporte les expressions régulières, | ||
- | "Host: .*(.p2pfr|p2pfr).com.*" | ||
- | Pour tolérer 2 sites | ||
- | " | ||
- | </ | ||
- | Lancez pound | ||
- | / | ||
- | | ||
- | Mais comme le dis le message d' | ||
- | < | ||
- | pound will not start unconfigured. (warning). | ||
- | Please configure; afterwards, set startup=1 in / | ||
- | </ | ||
- | |||
- | Vous devez modifiez le fichier / | ||
- | / | ||
- | | ||
- | ===== Configurer Apache : LogFormat poundCombined ===== | ||
- | Comme le dit la page http:// | ||
- | |||
- | Si vous utilisez **awstats** ou un autre soft de statistique, | ||
- | |||
- | Pas de panique donc, le site cité ci dessus nous donne la solution. | ||
- | |||
- | Modifiez votre fichier de config de site apache, allez dans la section log et ajoutez cette ligne dans les types de log | ||
- | | ||
- | |||
- | Ensuite modifier la variable suivante | ||
- | CustomLog / | ||
- | | ||
- | | ||
- | ===== Récupérer les log de pound ===== | ||
- | source : http:// | ||
- | |||
- | |||
- | Normally, sysklogd will overtake all messages from pound and will put them into syslog as anything with the facility ' | ||
- | |||
- | Just edit your / | ||
- | |||
- | #facility local0 is needed as sysklogd will | ||
- | #seperate pound messages by this facility | ||
- | LogFacility local0 | ||
- | LogLevel 3 | ||
- | |||
- | And the change your / | ||
- | |||
- | # log all (auth and such) to / | ||
- | # except messages with the facility local0 (pound) | ||
- | # | ||
- | *.*; | ||
- | |||
- | # get the messages with the facility local0 and | ||
- | # log them into the pound logfile | ||
- | local0.* -/ | ||
- | |||
- | The next step is to make sure that there is always a pound.log present. Therefore you need to modify the start script by adding a short conditional block into the top section of / | ||
- | |||
- | # Check if the pound.log exists, if not create one | ||
- | if [ ! -e "/ | ||
- | then | ||
- | log_warning_msg "There is no pound.log, i'll create one" | ||
- | touch / | ||
- | chmod 0644 / | ||
- | chown syslog:adm / | ||
- | / | ||
- | else | ||
- | log_success_msg " | ||
- | / | ||
- | fi | ||
- | |||
- | After you reloaded the sysklogd by / | ||
- | |||
- | In my case the logfile increased to a size of more than 900 Mbyte after 24 hours, so don't forget to rotate the log. This could be done like this (/ | ||
- | |||
- | / | ||
- | daily | ||
- | missingok | ||
- | rotate 14 | ||
- | dateext | ||
- | compress | ||
- | notifempty | ||
- | create 0644 syslog adm | ||
- | postrotate | ||
- | / | ||
- | endscript | ||
- | } | ||
- | |