favicon error_log
-
- Posts: 99
- Joined: 2007-03-09 15:23
favicon error_log
Gibt es eine Möglichkeit im Apache Error_log, dass favicon.ico automatisch ignoriert wird, weil es füllt das Logfile "umsonst" :)
-
- Posts: 99
- Joined: 2007-03-09 15:23
Re: favicon error_log
Nunja, gibts denn keine andere Möglichkeit?
-
- Administrator
- Posts: 2641
- Joined: 2004-01-21 17:44
Re: favicon error_log
Nicht wirklich - neuere Browser fordern es per GET /favicon.ico an, und der Webserver kann diesen GET nicht von einem anderen unterscheiden. Ergo hast Du zwei Möglichkeiten:
- Du erzeugst eine Datei mit Namen favicon.ico - ob sie wirklich ein Icon enthält, ist eigentlich völlig wurscht. Damit taucht der GET aber dann im Access Log auf... los bist Du ihn immer noch nicht.
- Du schmeißt Zeilen bezüglich Favicon einfach aus dem Logfile raus:
Code: Select all
sed -i '/favicon/d' /pfad/zur/logdatei
-
- Project Manager
- Posts: 11185
- Joined: 2003-02-27 01:00
- Location: Hamburg
Re: favicon error_log
<mode nitpick=on">
</mode>
Code: Select all
sed '/favicon/d' -i /pfad/zur/logdatei
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: favicon error_log
Für das Access.log habe ich mir so geholfen.
Code: Select all
CustomLog /home/vhost/www.deine-domain/log/access.log combined env=!dontlog
SetEnvIf Request_URI "^/favicon.ico$" dontlog
-
- Posts: 99
- Joined: 2007-03-09 15:23
Re: favicon error_log
Danke für deinen Post, fürs Access_log passt das ja wunderbar, leider kann man beim Error_log ja keine solche Bedingung angeben, deshalb wird mir wohl nichts weiter übrig bleiben, als die Ausgaben an ein externes Skript weiterzuleiten und mit Hilfe von jfreund's Code zu filtern, danke :)
-
- Posts: 18
- Joined: 2006-01-04 11:58
- Location: Karlsruhe
Re: favicon error_log
Hier der Inhalt der Konfiguration, die ich in allen VHosts include:
OT: Hiermit habe ich meinen Plaintext-Traffic um 60% reduziert :-D
Code: Select all
# Send an 404, if favicon.ico is not available
Redirect 404 /favicon.ico
<location /favicon.ico>
ErrorDocument 404 "No favicon.ico available"
</location>
Code: Select all
# deflate
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
-
- Posts: 2223
- Joined: 2002-07-28 13:02
- Location: Berlin
Re: favicon error_log
Brechstange:
Code: Select all
echo ""> favicon.ico
-
- Project Manager
- Posts: 11185
- Joined: 2003-02-27 01:00
- Location: Hamburg
Re: favicon error_log
Code: Select all
touch favicon.ico
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
-
- Posts: 2223
- Joined: 2002-07-28 13:02
- Location: Berlin
Re: favicon error_log
Träger des useless-use-of-cat-award benutzen "echo" ... :-P
-
- Userprojekt
- Posts: 7066
- Joined: 2002-10-09 14:30
- Location: Dorsten
Re: favicon error_log
Warum einfach, wenn's auch kompliziert geht? ;)
Code: Select all
>favicon.ico
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
-
- Posts: 18
- Joined: 2006-01-04 11:58
- Location: Karlsruhe
Re: favicon error_log
Um es nochmal zusammenzufassen: Wer nicht in jedes DocumentRoot hampeln will und dort eine dummy favicon Datei anlegen, kann die Sache auch "sauber" lösen. Dies verhindert ausserdem, dass Apache bei jedem Besucher unnötig ins Filesystem greifen muss. (Ja, ich weiß, FS Cache)
Hierzu Folgendes in die von jedem VHost eingebundene Konfiguration oder gleich in die Hauptkonfiguration:
Dann noch bei jedem VHost die CustomLog Direktive ergänzen:
(Das Verzeichnis für die VHost Files entsprechend anpassen)
Hierzu Folgendes in die von jedem VHost eingebundene Konfiguration oder gleich in die Hauptkonfiguration:
Code: Select all
Redirect 404 /favicon.ico
<location /favicon.ico>
ErrorDocument 404 "No favicon.ico available"
</location>
SetEnvIf Request_URI "^/favicon.ico$" dontlog
Code: Select all
find /etc/apache2/sites-available -type f -exec sed 's/access.log combined$/access.log combined env=!dontlog/g' -i {} ;
-
- Posts: 2223
- Joined: 2002-07-28 13:02
- Location: Berlin
Re: favicon error_log
Ich finde es etwas sinnbefreit, per location-handler einen umfangreicheren Fehler auszugeben als eh schon passiert.
Die Nolog-Geschichte ist sinnvoll, wenn man von vornherein auf favicons verzichtet - keine Frage. Aber analog gilt das auch für die robots.txt.
flo.
Die Nolog-Geschichte ist sinnvoll, wenn man von vornherein auf favicons verzichtet - keine Frage. Aber analog gilt das auch für die robots.txt.
flo.
-
- Project Manager
- Posts: 11185
- Joined: 2003-02-27 01:00
- Location: Hamburg
Re: favicon error_log
Es ist Sinnbefreit! Es ist doch kein Problem ein Default-Favicon per Oneliner in den Docroot der vHosts zu kopieren...flo wrote:Ich finde es etwas sinnbefreit, per location-handler einen umfangreicheren Fehler auszugeben als eh schon passiert.
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
-
- Posts: 2223
- Joined: 2002-07-28 13:02
- Location: Berlin
Re: favicon error_log
Du meinst, so daß der Kunde die Datei einfach überschreiben kann und nicht stundenlang rumrätselt, warum das favicon nicht angezeigt wird? ;-)
-
- Posts: 18
- Joined: 2006-01-04 11:58
- Location: Karlsruhe
Re: favicon error_log
Der OP will verhindern, dass favicon Requests in error- und accesslog auftauchen.
Das Erstellen einer dummy favicon Datei ist somit nur die halbe Lösung.
Das Erstellen einer dummy favicon Datei ist somit nur die halbe Lösung.