Spice Posted April 24, 2004 Posted April 24, 2004 Hi I need help to protect my admin folder with .htaccess so it will ask for user/pass when I try to access it. How should I do please help.
hugo47111 Posted April 24, 2004 Posted April 24, 2004 Hello, you can create an .htaccess file in the directory.. should look like: AuthUserFile /www/shop/admin/.htpasswd AuthGroupFile /dev/null AuthName "Description" AuthType Basic <Limit GET> require user username </LIMIT> after this, create an .htpasswd file using htpasswd -c /directory/.htpasswd username after this, you should have setuped it!
Spice Posted April 24, 2004 Author Posted April 24, 2004 So I add this to the .htaccess file AuthUserFile /www/shop/admin/.htpasswd AuthGroupFile /dev/null AuthName "Description" AuthType Basic <Limit GET> require user username </LIMIT> Should I make this file manually or does that line htpasswd -c /directory/.htpasswd username create one. Someone told me to run that in a comand promt or something but I dont know how to. Or should I manually make a .htpasswd file and adding what to it? I have made a empty .htpasswd file but what should be in it. And this /directory/.htpasswd the directory must be the correct path to the admin folder right? sorry for being lost.
hugo47111 Posted April 24, 2004 Posted April 24, 2004 Hello again, -c means to create a new .htpasswd. if its once created you dont need to use the -c option again! you have to run it using the command line. otherwise use an php-script which is able to create this files... you can go to www.phpwelt.de to download a .htaccess and .htpasswd file.. just go to this page and search for .htaccess. how to create a .htpasswd file localy and upload it using ftp i dont know how... because the passwords in the .htpasswd are encrypted. > And this /directory/.htpasswd the directory must be the correct path to the admin folder right? yes... good look
hugo47111 Posted April 24, 2004 Posted April 24, 2004 ups... s.th wrong... > And this /directory/.htpasswd the directory must be the correct path to the admin folder right? the .htpasswd can be anywhere on the server. you have to define the path to this file in the .htaccess file (AuthUserFile /www/shop/admin/.htpasswd) ... for security it would be better to create it outside the www directory... the .htpasswd file has to be located in the admin folder..
Spice Posted April 24, 2004 Author Posted April 24, 2004 ok but I still cant create the .htpasswd file =/ I have the .htaccess file but seems hard to make the .htpasswd file with my current host. Im in the middle of getting a new host thats better.
SLO_Cowboy Posted April 25, 2004 Posted April 25, 2004 Can anybody explain step-by-step for us - dummy's? Where to put this two files? Thanks
bluepony Posted April 25, 2004 Posted April 25, 2004 Cowboy, Answered your question in your other post: http://www.oscommerce.com/forums/index.php?showtopic=89689 I'd rather be flying!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.