Computer Hope

Internet & Networking => Web design => Topic started by: Xeratul on February 25, 2006, 05:59:10 PM

Title: Apache Server passwording
Post by: Xeratul on February 25, 2006, 05:59:10 PM
I wan't to put a password on to access my site.

I've been looking around and have found some articles; http://httpd.apache.org/docs/2.0/howto/auth.html
and http://archives.hwg.org/hwg-servers/[email protected]

Neither of which I could understand very well...  :-/

What kind of pathname is /usr/local/apache/passwd/ ?
It doesn't look anything like my file structure for apache; C:\Program Files\Apache Group\Apache2\

EDIT 1: Is the aforementioned pathname assuming the beginning of the pathname?
Example -- C:\Program Files\Apache Group\Apache2\<insert>\<insert>\<insert> ?  :-?

If so I can't find folders like /usr/local/apache/passwd/ anywhere...
Title: Re: Apache Server passwording
Post by: Rob Pomeroy on February 26, 2006, 07:31:14 AM
That's a Unix/Linux path you're looking at.  I have no experience of setting Apache up on Windows, but I can recommend that you look for Windows-specific documentation when you're searching.

Access can be controlled by means of .htaccess and .htpasswd files.  Read the official documentation about those.
Title: Re: Apache Server passwording
Post by: Xeratul on February 26, 2006, 10:50:15 AM
Thanks.  :)

No wonder I couldn't understand those paths. I'll go find for some Windows articles.
Title: Re: Apache Server passwording
Post by: Saint_Jude on February 26, 2006, 01:45:58 PM
I'm running Apache on Windows (though I haven't done much with the server itself for a while).

Here are a couple of typical paths:

AuthUserFile  "C:/Program Files/Apache Group/Apache2/passwd/passwords"
AuthGroupFile "C:/Program Files/Apache Group/Apache2/passwd/groups"


passwords and groups are files that have no file extension.

Note that forward slashes are still used in htaccess, even on Windows.

However, I believe the paths and filenames are all conventional. Ultimately, you could specify other paths or filenames.

PS The password utility is here:

C:\Program Files\Apache Group\Apache2\bin\htpasswd.exe
Title: Re: Apache Server passwording
Post by: Xeratul on March 02, 2006, 08:00:51 AM
Quote
are files that have no file extension.

I'm lost how can they have no filename? I can't have a file with just an extension, and no name could I?  :-?




Title: Re: Apache Server passwording
Post by: Xeratul on March 02, 2006, 08:07:06 AM
I have my files although they have a filename so thats probably why they are not working.

My "password.htaccess" is at C:/Program Files/Apache Group/Apache2/htdocs/password.htaccess, and consists of

Code: [Select]
AuthName "GNOMENET Server"
AuthType Basic
AuthUserFile "C:/Program Files/Apache Group/Apache2/bin/greengnome.htpasswd"
Require valid-user

My "greengnome.htpasswd" is located at "C:/Program Files/Apache Group/Apache2/bin/greengnome.htpasswd" and has

Code: [Select]
greengnome:$apr1$um1.....$DNK4zDGnCh2KmtHhA09IO1
Even though I'm using Windows I should still have forward slashes, correct?

What am I doing wrong?  :-?

How do I eliminate the filenames?
Title: Re: Apache Server passwording
Post by: Saint_Jude on March 02, 2006, 04:20:04 PM
I can't see anything wrong with what you have.
However, it may be that you haven't configured Apache to look for the htaccess file.

I can't have a file with just an extension, and no name could I?

The idea of name+extension isn't quite accurate anyhoo. Really, a filename includes the file extension.

Remember, too, that all this comes from Unix land, where extensions aren't so heavily relied upon.  In Unix, a filename that begins with a dot means that the file is (usually) hidden.

Windows doesn't like filenames that begin with a dot -although it is possible to do. I save all confusion by calling my files: htaccess.conf

Here's the meat. You may have neglected to put the name you have chosen for your access file into the httpd.conf (the Apache config file)

AccessFileName password.htaccess

Probably best to change this name to something else anyway. I see that you understood .htaccess to be the extension (for a file with no name !). It is just a filename. For understandability, perhaps use something like mine..

AccessFileName htaccess.conf


Title: Re: Apache Server passwording
Post by: Xeratul on March 12, 2006, 08:49:35 PM
Ugh, it's still not working.  :-?