Skip to content

Commit ec6d5bf

Browse files
committed
Adding back logwatch for site.
1 parent b8f7fe1 commit ec6d5bf

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

admin-scripts/add-site.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,31 @@ maxretry = 3
172172
echo
173173
echo
174174
echo
175+
echo "Installing and configuring logwatch for log monitoring"
176+
# https://help.ubuntu.com/community/Logwatch
177+
echo "--------------------------------------------------------------"
178+
#
179+
aptitude -y install logwatch
180+
mkdir /var/cache/logwatch
181+
cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/
182+
#
183+
sed -i "s/MailTo = root/MailTo = $ADMINEMAIL/g" /etc/logwatch/conf/logwatch.conf
184+
sed -i "s/Detail = Low/Detail = High/g" /etc/logwatch/conf/logwatch.conf
185+
sed -i "s/Format = text/Format = html/g" /etc/logwatch/conf/logwatch.conf
186+
#
187+
cp /usr/share/logwatch/default.conf/logfiles/http.conf to /etc/logwatch/conf/logfiles
188+
#
189+
echo "
190+
# Log files for $DOMAIN
191+
LogFile = /home/$USER/public_html/$DOMAIN/log/access.log
192+
LogFile = /home/$USER/public_html/$DOMAIN/log/error.log
193+
LogFile = /home/$USER/public_html/$DOMAIN/log/ssl_error.log
194+
LogFile = /home/$USER/public_html/$DOMAIN/log/ssl_access.log
195+
" >> /etc/logwatch/conf/logfiles/http.conf
196+
#
197+
echo
198+
echo
199+
echo
175200
echo "Enabling site $DOMAIN, restarting apache"
176201
echo "--------------------------------------------------------------"
177202
#

0 commit comments

Comments
 (0)