httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk.vanGulik" <Dirk.vanGu...@jrc.it>
Subject one for the FAQ
Date Tue, 22 Jul 1997 08:13:59 GMT
I am getting a wee bit fed up by this. Sat down for
a few hours going through all apache/msql related mail
which I left from thursday. About 28 where in related
to answer 50, 17 went for 51. And I had 2 whining that
their htpasswd files stopped working when they upgraded
to a machine with a different crypt(). 

So here are three for the FAQ.

Dw.

*** FAQ.org	Tue Jul 22 10:05:09 1997
--- FAQ	Tue Jul 22 10:09:30 1997
***************
*** 223,228 ****
--- 223,238 ----
     </LI>
     <LI><A HREF="#msql-slow">Why is my mSQL authentification terribly slow?</A>
     </LI>
+  <LI><A href="#msql-compile">Why do I get errors about msql when compiling?
+      </A>
+    </LI>
+  <LI><A href="#htpasswd-how">How do I make htpasswd/dbm/gdb/msql password entries?
+      </A>
+    </LI>
+  <LI><A href="#htpasswd-help">I've switched/upgraded machines; and now my htpasswd's
have stopped working?
+    </LI>
    </OL>
   </LI>
  </UL>
***************
*** 1754,1759 ****
--- 1764,1853 ----
    documentation warn you about this.  If you have to use different
    hosts, check out the <SAMP>mod_auth_msql</SAMP> code for
    some compile time flags which might - or might not - suit you.
+   </P>
+   <HR>
+  </LI>
+  <LI><A NAME="msql-compile">
+       <STRONG>Why do I get errors compiling?</STRONG>
+      </A>
+   <P>
+   When you get errors like <samp>msql.h</samp> not found or something
+ along the line of:
+ <blockquote><pre>
+ mod_auth_msql.o: In function `do_msql_query':
+ mod_auth_msql.o(.text+0x17c): undefined reference to `msqlConnect'
+ ...
+ mod_auth_msql.o(.text+0x418): undefined reference to `msqlClose'
+ make: *** [httpd] Error 1
+ </pre></blockquote>
+ 
+ You propably did not add something along the lines of 
+ <code>'-lmsql -L/usr/local/lib -L/usr/local/Minerva/lib'</code> 
+ to your <code>EXTRA_LIBS</code> line. See the comments the 
+ <samp>src/Configuration</samp> file just above the msql line 
+ you uncommented.
+ 
+   </P>
+   <HR>
+  </LI>
+  <LI><A NAME="htpasswd-how">
+       <STRONG>How do I make htpasswd/dbm/gdb/msql password entries?</STRONG>
+      </A>
+   <P>
+   The various authenfication modules, such as mod_auth, mod_auth_gdb, 
+ mod_auth_dbm, mod_auth_msql and quite a few contributed modules with
+ oracle, postgress and sybase connections rely on a <emp>crypted</emp> 
+ password field. This is a one-way crypt, as are the entries in your
+ normal passwd file on most unix systems. One needs a tool or a bit of
+ perl to create these entries.</p>
+   <p>
+   In the <samp>support</samp> directory of the source distribution you
+ will find (or can compile) a binary 'htpasswd' which is a simple 
+ password file management tool which will create those crypted entries.</p>
+   <p>
+   Another option is to use the bit of perl below;
+ <blockquote><code><pre>
+ #!/usr/local/bin/perl
+ # Export 0/0a dirkx@technologist.com - Tue Jul 22 08:12:48 GMT 1997
+ #
+ if ($#ARGV != -1) {
+ 	print STDERR "usage: $0 (stdin/out only)\n";
+ 	exit -1;
+ 	};
+ 
+ while(<STDIN>) {
+ 	chomp;
+ 	print crypt_passwd($_)."\n";
+ 	};
+ exit 0;
+ 
+ sub to64 {
+         local ($v,$n)=@_; local $s,$a;
+         $a="./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+         while (--$n >=0 ) {
+                 $s.=substr($a,($v % 64),1);
+                 $v>>=6;
+                 };
+         return $s;
+         };
+  
+ sub crypt_passwd {
+         local ($passwd,$salt)=@_;
+         if (!($salt)) {
+                 srand(time);
+                 $salt=to64(rand(64*64),2);
+                 };
+         return crypt($passwd,$salt);
+         };
+ </pre></code></blockquote>
+   </P>
+   <HR>
+  </LI>
+  <LI><A NAME="htpasswd-help">
+       <STRONG>I've switched/upgraded machines; and now my htpasswd's have stopped
working?</STRONG>
+      </A>
+   <P>
+   When you upgrade or switch machines, you might find that the new platform
+ has a different crypt() function than the previous one. This means that the encrypted password
fields in the htpasswd file or in the SQL database will
+ no longer match. There is normally <b>nothing</b> you can do about this; as
you cannot get the original passwords back from the one way crypt and you might
+ have to send your customers a new password. 
+ </p>
+ <p>If you are on one of the BSDs, you might want to read the man pages on 
+ crypt, md5 and export limitations; as it sometimes is possible to replace your systems crypt()
function by the old one. This might of course render your /etc/passwd file disfunctional.
    </P>
    <HR>
   </LI>



Mime
View raw message