Changes between Initial Version and Version 1 of AwStatsInstall


Ignore:
Timestamp:
06/22/13 15:39:57 (3 years ago)
Author:
chris
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AwStatsInstall

    v1 v1  
     1= AWStats = 
     2 
     3== Copying the logs to penguin == 
     4 
     5The nginx logs on wiki:PuffinServer are copied to wiki:PenguinServer using scp, in {{{/etc/logrotate.d/nginx}}} the {{{nginx-logs}}} script is run just before the logs are rotated: 
     6 
     7{{{ 
     8        prerotate 
     9                /usr/local/bin/nginx-logs 
     10                /usr/local/bin/50x-errors chris@webarchitects.co.uk 
     11                if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ 
     12                        run-parts /etc/logrotate.d/httpd-prerotate; \ 
     13                fi \ 
     14        endscript 
     15}}} 
     16 
     17This script contains: 
     18 
     19{{{ 
     20#!/bin/bash 
     21 
     22DATE=$(date "+%Y-%m-%d") 
     23LOG_FILE=/var/log/nginx/access.log 
     24REMOTE_FILE=puffin-nginx-$DATE.log 
     25 
     26scp $LOG_FILE penguin:nginx/$REMOTE_FILE 
     27}}} 
     28 
     29It depends on the {{{/root/.ssh/config}}} file on puffin containing: 
     30 
     31{{{ 
     32Host penguin 
     33  Hostname penguin.webarch.net 
     34  User puffin 
     35}}} 
     36 
     37And the puffin root users public key being on penguin. 
     38 
     39On penguin the {{{/etc/ssh/sshd_config}}} file contains: 
     40 
     41{{{ 
     42AllowGroups sudo sshaccess 
     43}}} 
     44 
     45And the puffin user on penguin was created with no password and in the sshaccess group: 
     46 
     47{{{ 
     48adduser --disabled-password --ingroup sshaccess puffin 
     49}}} 
     50 
     51Then the ssh public key was copied to {{{/home/puffin/.ssh/authorized_keys}}} on penguin and this was added at the start so it can only be used from puffin's IP address: 
     52 
     53{{{ 
     54from="puffin.webarch.net" ssh-rsa AAAA... 
     55}}} 
     56 
     57The log files that are created on penguin are in {{{/home/puffin/nginx/}}} and have a file name based on the date they are created, eg: 
     58 
     59{{{ 
     60-rw-r----- 1 puffin puffin  11M Jun 22 06:25 puffin-nginx-2013-06-22.log 
     61}}} 
     62