Gossamer Forum
Home : Products : Links 2.0 : Discussions :

got a question and need help

Quote Reply
got a question and need help
hey I found the password script and I install it, but when I type my http address to admin script, I could still access it and It the password protecting screen doesnt even show up, and when it takes me to the directorey it says WARNING: ADMIN Directory is not Password Protected!! Do you know were can I get a good password script, and I got one question, were it says put the url to protect in my password script, do I put the path url or the staright http url, I put the http url, but I could still acess the admin without the password asking thing show up. Do you know were can I get a good password script that is free.

And do I put the password script files in Admin script how do I do that, how can I put the password script in admin.cgi <--- the password script says put it in your directorey, but how, thats what the hastccss. password script some script say that. Its something like hastcss. I dont know. do you know were can I get a good password script for free.

if so email me at patelrule@aol.com

Thank you
Quote Reply
Re: got a question and need help In reply to
John,

I just tried to install this script on my site, since I am having a similar problem to Bin (our resident spammer) Wink

I followed the instructions you gave but I get the following error:

Quote:
Error
Error determining directory

What step am I missing? Who wrote this scrip, is there a homepage for it with complete installation instructions and such?

TIA Smile

------------------
Warning: The dates on the calendar are closer than they appear.
Quote Reply
Re: got a question and need help In reply to
I got the script you gave me, but I still get 500 error, in the script were it says.

#!/usr/bin/perl
##########################################################################
#
# makeht.cgi
# Directions:
# Upload makeht.cgi to the directory you want to protect.
# Chmod to 755
# Run makht.cgi with your browser
# http://yoursite.com/protecteddirectory/makeht.cgi?username/password
# Your directory is now protected.
#
##########################################################################
print "Content-type:text/html\n\n";
eval '$home = (getpwuid($< ))[7];';
if (!-e "C:/") {
$pwd = `pwd`; chop $pwd;
}
if (!eval 'use Cwd;') {
eval '$cwd = cwd();';
} else {
$cwd = "";
}
($uname, $pword) = split(/\//,$ENV{'QUERY_STRING'});
if ($pwd eq "") {
$dirname = $cwd;
} else {
$dirname = $pwd;
}
if ($dirname eq "") {
&dienice("Error determining directory");
}
if ($uname eq "") {
&dienice("Error determining username");
}
if ($pword eq "") {
&dienice("Error determining password");
}
$cpass = crypt ($pword ,"Cd");
open (HTACC,">.htaccess") or &dienice("Error opening htaccess");
print HTACC qq~AuthName Links Admin
AuthType Basic
AuthUserFile $dirname/.htpasswd
require valid-user
~;
close(HTACC);
open (HTPWD,">.htpasswd") or &dienice("Error opening htpasswd");
print HTPWD "$uname:$cpass\n";
close(HTPWD);
print "Complete. Username: $uname Password: $pword Encrypted Password: $cpass";
sub dienice {
($msg) = @_;
print "<h2>Error</h2>\n";
print $msg;
exit;
}


In the top it says http://yoursite.com/protecteddirectory/makeht.cgi?username/password. So I replace that with username and password, but when I run it I get 500 internal error. What can I do?

I made up my own password, and screen name but still doesnt work what can I do
Quote Reply
Re: got a question and need help In reply to
ok it works never mind. Thank you for your help
Quote Reply
Re: got a question and need help In reply to
Do not put the script in admin.cgi!!!!

Here is how to do it

Name it makeht.cgi
Put it in your admin directory.
chmod it to 755.
Now you have to run it in your browser. To do this type,
http://yoursite.com/cgi-bin/links/admin/makeht.cgi?username/password
into your browser window.
Replace username with your username.
Replace password with your password.
Replace
yoursite.com/cgi-bin/links/admin/
with whatever you put the admin directory.

For those who don't know the script he is talking about here it is.
Code:
#!/usr/bin/perl
##########################################################################
#
# makeht.cgi
# Directions:
# Upload makeht.cgi to the directory you want to protect.
# Chmod to 755
# Run makht.cgi with your browser
# http://yoursite.com/protecteddirectory/makeht.cgi?username/password
# Your directory is now protected.
#
##########################################################################

print "Content-type:text/html\n\n";
eval '$home = (getpwuid($< ))[7];';
if (!-e "C:/") {
$pwd = `pwd`; chop $pwd;
}
if (!eval 'use Cwd;') {
eval '$cwd = cwd();';
} else {
$cwd = "";
}
($uname, $pword) = split(/\//,$ENV{'QUERY_STRING'});
if ($pwd eq "") {
$dirname = $cwd;
} else {
$dirname = $pwd;
}
if ($dirname eq "") {
&dienice("Error determining directory");
}
if ($uname eq "") {
&dienice("Error determining username");
}
if ($pword eq "") {
&dienice("Error determining password");
}
$cpass = crypt ($pword ,"Cd");
open (HTACC,">.htaccess") or &dienice("Error opening htaccess");
print HTACC qq~AuthName Links Admin
AuthType Basic
AuthUserFile $dirname/.htpasswd
require valid-user
~;
close(HTACC);
open (HTPWD,">.htpasswd") or &dienice("Error opening htpasswd");
print HTPWD "$uname:$cpass\n";
close(HTPWD);
print "Complete. Username: $uname Password: $pword Encrypted Password: $cpass";
sub dienice {
($msg) = @_;
print "<h2>Error</h2>\n";
print $msg;
exit;
}

Hope this helps.

BTW Bin, you don't have to post in more than one forum.

------------------
JRM Studios www.jrmstudios.com
The Hotrodding Network www.hotrodding.net
Web discuss Free speech newsgroups - www.webdiscuss.com



Quote Reply
Re: got a question and need help In reply to
Can anyone answer my question above?

------------------
Warning: The dates on the calendar are closer than they appear.

Quote Reply
Re: got a question and need help In reply to
Hey Steve,

I got the script here in the forum a long time ago, no homepage or anything.

Not sure what to tell you it has worked flawlessly for me everytime.

You might try changing

print HTACC qq~AuthName Links Admin

to

print HTACC qq~AuthName LinksAdmin

The newer version of Apache wont take the space.

But I don't think that's your problem, the error your getting is higher in the script.

How are you calling the script?

------------------
JRM Studios www.jrmstudios.com
The Hotrodding Network www.hotrodding.net
Web discuss Free speech newsgroups - www.webdiscuss.com