Thanks André! Just one more question: if i want to retrieve from the access log the users' visiting history of my web site, what would you suggest? A main problem for me is that one user's request can have multiple entries in the access log. For instance, if a user send a request to the index.php page that includes two pictures named as pic1 and pic2, then there are three entries in the access log for this request. Would it in the access log look like : 127.0.0.1 - - [23/May/2008:00:05:11 -0400] "GET /index.php HTTP/1.1" 200 7349 "referer page" 127.0.0.1 - - [23/May/2008:00:05:11 -0400] "GET /pic1 HTTP/1.1" 200 10388 "/index.php" 127.0.0.1 - - [23/May/2008:00:05:12 -0400] "GET /pic2 HTTP/1.1" 200 51099 "/index.php" Consider that there are many requests. How should I separate these entries? Is the requested page, which is index.php in this example, always the first entry in the log event? Thanks again! Paul On Sat, Aug 2, 2008 at 5:53 AM, André Warnier <aw@xxxxxxxxxx> wrote: > Paul Li wrote: > [...] >> >> My question is that, the resource in the request line, >> /finger-pulse-oximeter-octivetech-300c-p-37.html?osCsid=ddd, is >> actually a web page, but why the referer, http://www.ddd.ddd.dd/ , is >> another page? >> > Try the following experiment : > In your browser, call up the URL "www.google.com". > Then, when that page is displayed, overwrite "www.google.com" and manually > call up a URL on your server. > Then check your access log. > You may find that the access to your own page is shown with the referrer > "http://www.google.com". > > The point is, the server does not really know from which page, a page on > your server is being called. It knows from which IP address it receives the > request, but not from which page (and it does not have to be a page). > So, in order to store the "referer" in the access log, it accepts whatever > the browser (or other program) which accesses the current page, is > specifying in the "Referer:" header that comes with the current request. If > the browser (or other program) sends a request to your server, and adds a > "Referer:" header containing "Planet Mars", then that is what your server > will put in the access log. > > Example : > 192.168.250.152 - - [02/Aug/2008:11:44:21 +0200] "GET / HTTP/1.1" 200 2355 > "Planet Mars" "lwp-request/2.08" > > The above line of access.log was obtained as follows : > Along with perl, comes a very handy command-line program named > "lwp-request", which allows one to compose a HTTP request to a HTTP server, > specify exactly which headers are being sent, and look at the exact response > sent by the server (headers and all). > The command I used was : > > lwp-request -Sed -m GET -H "Referer: Planet Mars" "http://localhost" > > (the "-H" option allows to manually add a HTTP header to the request) > > André > > > --------------------------------------------------------------------- > The official User-To-User support forum of the Apache HTTP Server Project. > See <URL:http://httpd.apache.org/userslist.html> for more info. > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx > " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx > > --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx