httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Girod <gi...@shire.ntc.nokia.com>
Subject [users@httpd] patch to avoid loops in htdig indexing
Date Fri, 15 Nov 2002 15:45:22 GMT
Hello!

I got into a problem for which I found a patch, originally written by
a friend of mine. I updated the patch and applied it, and it fixed my
problem. I understand that it has already been submitted in the past,
and thus must have been refused.
I'd be interested to understand why, in order to make it better, so
that I don't get the same problem again in the future (selfish
motivation, as it should be).

Opinions, instructions?

Best Regards!
Marc


The environment:
apache-1.3.22-6, Red Hat Linux release 7.2, Kernel 2.4.9-13.

The problem:
When indexing my local site with htdig, this one will loop forever.
The reason is that there are in some directories soft links the
traversal of which may result in loops, such as:

  foo -> .

This results in a problem because of Apache's autoindexing.

The fix:
We just added a meta tag i the dynamically created pages, to tell
robots to ignore them.

Discussion:
I can understand that one might be the opinion that it is a hack
instead of a clean solution, and that it may be felt in some cases as
a regression, especially when the problem is not met.
Anyway, when you meet the problem, it is better than nothing.

The patch (apache_1.3.22-autoindex-htdig.patch):

Marko Polonen's patch, dated Mar 18 2000 (repackaged by Marc Girod)
diff -aur apache_1.3.22/src/modules/standard/mod_autoindex.c /tmp
--- apache_1.3.22/src/modules/standard/mod_autoindex.c	Fri Mar  9 12:10:33 2001
+++ /tmp/mod_autoindex.c	Mon Nov  4 16:42:41 2002
@@ -199,7 +199,7 @@
 {
     ap_rvputs(r, DOCTYPE_HTML_3_2,
 	      "<HTML>\n <HEAD>\n  <TITLE>Index of ", title,
-	      "</TITLE>\n </HEAD>\n <BODY>\n", NULL);
+	      "</TITLE>\n  <META NAME=\"robots\" CONTENT=\"none\">\n </HEAD>\n
<BODY>\n", NULL);
 }
 
 static void push_item(array_header *arr, char *type, char *to, char *path,


[ I assume nobody cares about the changes to the apache.spec used to
  build the modified rpm:

Patch10: apache_1.3.22-autoindex-htdig.patch
[...]
%patch10 -p1 -b .autoindex-htdig
[...]
* Mon Nov  4 2002 Marc Girod <marc.girod@nokia.com> 1.3.22-local
- Added patch for having robots skip autoindex pages (loops in soft links)

]

-- 
Marc Girod        P.O. Box 323        Voice:  +358-71 80 25581
Nokia NBI         00045 NOKIA Group   Mobile: +358-50 38 78415
Takomo 1 / 4c27   Finland             Fax:    +358-71 80 61604



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message