English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Im trying to follow this "HowTo" http://lifehacker.com/software/feature/geek-to-live--how-to-set-up-a-personal-home-web-server-124212.php And i got to step #2 so i can acses my music but i cant figur out step #3 i get lost trying to set up the pasword. If anyone knows anythig that might help me figur this out that would be graet. Just doing for the fun of it miht try to figur out how to host a web page on it wusing MS Word. But fist i must figur this out so its protected.

2007-02-17 14:17:30 · 2 answers · asked by Tim Sing 1 in Computers & Internet Programming & Design

2 answers

Let's make this real easy:

1. Open My Computer.

2. Double-click the C: drive icon to open it.

3. Create a new folder named ApacheDocs.

4. We will now create the user name NewUserName:

htpasswd -c "C:\ApacheDocs\passwords.txt" NewUserName

5. We will now set the path to the passwords file:

AuthType Basic
AuthName "This is a private area, please log in"

AuthUserFile "c:\ApacheDocs\passwords.txt"
AuthGroupFile /dev/null


require valid-user


Follow the rest of the instructions as provided.

2007-02-17 14:48:21 · answer #1 · answered by Anonymous · 0 0

It's pretty much as explained. In step 2 they had you set Allow Override All in the apache config. This tells apache that if there's a file named .htaccess in a directory, apache should read it and use those apache settings to override the default settings.

So they have you making this file and adding the settings that specify that the directory should be protected using HTTP security and authenticated by a password file you create.

The important thing is that the file be named right and this can be tricky using the windows editors which usually want to set a three character extension. You should probably create the file with wordpad, then go into windows explorerer and change the extension. By default windows hides extensions, so you need to look around in the options and make sure that the checkbox that allows you to see extensions is checked. They do tell you to use notepad and make sure you name the file using ".htaccess" (note the double quotes).

Once you restart apache when you access any files in the directory you should first be prompted with a popup that asks for name and password. Once you authenticate in any session you won't be prompted again until you close the browser.

As for the password file, just follow the instructions they gave. You must have the htpasswd.exe program somewhere in your apache install. You might want to copy that program to your windows/system directory, or some other directory that is in your path so that you can run it easily.

It's a command line program so you have to run it from a command or cmd window.

Pretty much follow their instructions, only changing the path to reflect your install and all should work. Without an explaination of what your problem is there's not much more I can do to help other than to say that this stuff works reliably even though it can be tricky to understand how to set it up for noobies like yourself.

2007-02-17 14:40:30 · answer #2 · answered by Gizmo L 4 · 0 1

fedest.com, questions and answers