Commit b6a10a56 authored by Falko Timme's avatar Falko Timme
Browse files

- Added support for daily nginx access logs.

parent 522ef8b7
......@@ -1008,6 +1008,11 @@ class installer_dist extends installer_base {
'* * * * * /usr/local/ispconfig/server/server.sh &> /dev/null',
'30 00 * * * /usr/local/ispconfig/server/cron_daily.sh &> /dev/null'
);
if ($conf['nginx']['installed'] == true) {
$root_cron_jobs[] = "0 0 * * * /usr/local/ispconfig/server/scripts/create_daily_nginx_access_logs.sh &> /dev/null";
}
foreach($root_cron_jobs as $cron_job) {
if(!in_array($cron_job."\n", $existing_root_cron_jobs)) {
$existing_root_cron_jobs[] = $cron_job."\n";
......
......@@ -1019,6 +1019,11 @@ class installer_dist extends installer_base {
'* * * * * /usr/local/ispconfig/server/server.sh &> /dev/null',
'30 00 * * * /usr/local/ispconfig/server/cron_daily.sh &> /dev/null'
);
if ($conf['nginx']['installed'] == true) {
$root_cron_jobs[] = "0 0 * * * /usr/local/ispconfig/server/scripts/create_daily_nginx_access_logs.sh &> /dev/null";
}
foreach($root_cron_jobs as $cron_job) {
if(!in_array($cron_job."\n", $existing_root_cron_jobs)) {
$existing_root_cron_jobs[] = $cron_job."\n";
......
......@@ -1919,6 +1919,11 @@ class installer_base {
"* * * * * ".$install_dir."/server/server.sh > /dev/null 2>> ".$conf['ispconfig_log_dir']."/cron.log",
"30 00 * * * ".$install_dir."/server/cron_daily.sh > /dev/null 2>> ".$conf['ispconfig_log_dir']."/cron.log"
);
if ($conf['nginx']['installed'] == true) {
$root_cron_jobs[] = "0 0 * * * ".$install_dir."/server/scripts/create_daily_nginx_access_logs.sh &> /dev/null";
}
foreach($root_cron_jobs as $cron_job) {
if(!in_array($cron_job."\n", $existing_root_cron_jobs)) {
$existing_root_cron_jobs[] = $cron_job."\n";
......
......@@ -46,6 +46,7 @@ server {
</tmpl_if>
error_log /var/log/ispconfig/httpd/<tmpl_var name='domain'>/error.log;
access_log /var/log/ispconfig/httpd/<tmpl_var name='domain'>/access.log combined;
## Disable .htaccess and other hidden files
location ~ /\. {
......
#!/bin/bash
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin
FILES=/var/log/ispconfig/httpd/*
for f in $FILES
do
mv $f/access.log $f/`date "+%Y%m%d"`-access.log &> /dev/null
touch $f/access.log &> /dev/null
done
/etc/init.d/nginx reload &> /dev/null
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment