Forum Moderators: phranque

Message Too Old, No Replies

How to secure folders?

         

stu2

4:38 am on Aug 5, 2005 (gmt 0)

10+ Year Member



How do I secure folders on an apache server...

1) So no-one/nothing can access them (except me, of course)

2) So they can be accessed with username and password

Dantol

4:41 am on Aug 5, 2005 (gmt 0)



doesn't your webhost provide these services for free?
I got all these specs included in my plan.

jatar_k

6:36 am on Aug 5, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



use .htaccess stu2
try this url
[httpd.apache.org...]

or
[httpd.apache.org...]

stu2

2:05 am on Aug 6, 2005 (gmt 0)

10+ Year Member



Gulp! I always seem to get a mental block when trying to read any Apache docs, although these weren't too bad :)

Ok. So I decide to use mod_auth_db method. I don't have shell access to my virtual host so presumably can't run dbmmanage there. So I install Apache on my pc but can't figure out how to run dbmmanage after I load Apache in local mode. Give up on dbmmanage.

So now I install perl on my pc. I copy the suggested perl script to a file "test.pl" and execute the command "perl test.pl". This gives me an error message "Malformed PERLLIB_PREFIX." My environment variable is set to "PERLLIB_PREFIX=G:\apps\perl5\lib". Give up on the perl script method.

So. Any other methods to create the user file? Any suggestions what I can do to complete the process with either of the above 2 methods?

encyclo

2:16 am on Aug 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds as if you're over-complicating things, stu2. ;) If the password protection is only for one user (you), then you should stick to "basic authentication" as described by the document in the first link that jatar_k gave you. It is largely sufficient for your needs. You can create the .htaccess file with Notepad, and the only thing left is to generate the password file (you say that you have Apache installed locally, so you have everything you need) and upload it to the server.

But as Dantol said: check your hosting plan's control panel - it is very likely that you can set the password there - then the control panel will create all the files automatically for you, no other actions necessary!

stu2

11:09 am on Aug 6, 2005 (gmt 0)

10+ Year Member



It sounds as if you're over-complicating things, stu2. ;)

Well it has been known to happen :)

If the password protection is only for one user (you), then you should stick to "basic authentication" as described by the document in the first link that jatar_k gave you.

Well it would only be for me initially. Actually my intention is twofold. I want to stop people with browsers as well as crawlers from accessing those directories.

The reason I went for the db file method was because I don't have shell access and so cannot run htpasswd/htdigest and they don't give any example of what the password text file looks like so I could create one with my text editor.

generate the password file (you say that you have Apache installed locally, so you have everything you need) and upload it to the server.

Could you please explain how I generate the file when apache is loaded? What program do I run? And how?

But as Dantol said: check your hosting plan's control panel - it is very likely that you can set the password there - then the control panel will create all the files automatically for you, no other actions necessary!

I didn't really understand what Dantol meant. I checked my control panel and don't see any option like that.