Skip to content

Commit

Permalink
update default log format to combined
Browse files Browse the repository at this point in the history
  • Loading branch information
licess committed Mar 22, 2016
1 parent 260d86c commit 941a4c5
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 22 deletions.
2 changes: 1 addition & 1 deletion conf/httpd-vhosts-lamp.conf
Expand Up @@ -26,7 +26,7 @@ ServerAdmin webmaster@example.com
DocumentRoot "/home/wwwroot/default"
ServerName www.lnmp.org
ErrorLog "/home/wwwlogs/IP-error_log"
CustomLog "/home/wwwlogs/IP-access_log" common
CustomLog "/home/wwwlogs/IP-access_log" combined
<Directory "/home/wwwroot/default">
SetOutputFilter DEFLATE
Options FollowSymLinks
Expand Down
2 changes: 1 addition & 1 deletion conf/httpd-vhosts-lnmpa.conf
Expand Up @@ -26,7 +26,7 @@ ServerAdmin webmaster@example.com
DocumentRoot "/home/wwwroot/default"
ServerName www.lnmp.org
ErrorLog "/home/wwwlogs/IP-error_log"
CustomLog "/home/wwwlogs/IP-access_log" common
CustomLog "/home/wwwlogs/IP-access_log" combined
<Directory "/home/wwwroot/default">
SetOutputFilter DEFLATE
Options FollowSymLinks
Expand Down
9 changes: 4 additions & 5 deletions conf/lamp
Expand Up @@ -173,9 +173,8 @@ Add_VHost()
if [ "${al_name}" = "" ]; then
al_name="${domain}"
fi
al="access_log /home/wwwlogs/${al_name}.log access;"

echo "You access log filename: ${al_name}.log"
echo "You access log filename: /home/wwwlogs/${al_name}-access_log"
fi

ServerAdmin=""
Expand Down Expand Up @@ -231,7 +230,7 @@ php_admin_value open_basedir "${vhostdir}:/tmp/:/var/tmp/:/proc/"
DocumentRoot "${vhostdir}"
ServerName ${domain}
ErrorLog "/home/wwwlogs/${al_name}-error_log"
CustomLog "/home/wwwlogs/${al_name}-access_log" common
CustomLog "/home/wwwlogs/${al_name}-access_log" combined
<Directory "${vhostdir}">
SetOutputFilter DEFLATE
Options FollowSymLinks
Expand All @@ -244,8 +243,8 @@ CustomLog "/home/wwwlogs/${al_name}-access_log" common
eof

if [ "${access_log}" == 'n' ]; then
sed -i 's/ErrorLog/#ErrorLog/g' /usr/local/apache/conf/vhost/${domain}.conf
sed -i 's/CustomLog/#CustomLog/g' /usr/local/apache/conf/vhost/${domain}.conf
sed -i 's/^ErrorLog/#ErrorLog/g' /usr/local/apache/conf/vhost/${domain}.conf
sed -i 's/^CustomLog/#CustomLog/g' /usr/local/apache/conf/vhost/${domain}.conf
fi

if [ "${add_more_domainame}" == 'y' ]; then
Expand Down
2 changes: 1 addition & 1 deletion conf/lnmp
Expand Up @@ -205,7 +205,7 @@ Add_VHost()
if [ "${al_name}" = "" ]; then
al_name="${domain}"
fi
al="access_log /home/wwwlogs/${al_name}.log access;"
al="access_log /home/wwwlogs/${al_name}.log;"

echo "You access log filename: ${al_name}.log"
fi
Expand Down
4 changes: 2 additions & 2 deletions conf/lnmpa
Expand Up @@ -178,7 +178,7 @@ Add_VHost()
if [ "${al_name}" = "" ]; then
al_name="${domain}"
fi
al="access_log /home/wwwlogs/${al_name}.log access;"
al="access_log /home/wwwlogs/${al_name}.log;"

echo "You access log filename: ${al_name}.log"
fi
Expand Down Expand Up @@ -270,7 +270,7 @@ php_admin_value open_basedir "${vhostdir}:/tmp/:/var/tmp/:/proc/"
DocumentRoot "${vhostdir}"
ServerName ${domain}
ErrorLog "/home/wwwlogs/${al_name}-error_log"
CustomLog "/home/wwwlogs/${al_name}-access_log" common
CustomLog "/home/wwwlogs/${al_name}-access_log" combined
<Directory "${vhostdir}">
SetOutputFilter DEFLATE
Options FollowSymLinks
Expand Down
8 changes: 2 additions & 6 deletions conf/nginx.conf
Expand Up @@ -55,11 +55,7 @@ http
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.

server_tokens off;
#log format
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log off;
access_log off;

server
{
Expand Down Expand Up @@ -93,7 +89,7 @@ server
deny all;
}

access_log /home/wwwlogs/access.log access;
access_log /home/wwwlogs/access.log;
}
include vhost/*.conf;
}
Expand Down
8 changes: 2 additions & 6 deletions conf/nginx_a.conf
Expand Up @@ -55,11 +55,7 @@ http
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.

server_tokens off;
#log format
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log off;
access_log off;

server
{
Expand Down Expand Up @@ -93,7 +89,7 @@ server
deny all;
}

access_log /home/wwwlogs/access.log access;
access_log /home/wwwlogs/access.log;
}
include vhost/*.conf;
}
Expand Down

0 comments on commit 941a4c5

Please sign in to comment.