Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Apache Server passwording  (Read 4766 times)

0 Members and 1 Guest are viewing this topic.

Xeratul

    Topic Starter
  • 100,000th poster


  • Hopeful
  • Experience: Familiar
  • OS: Windows 7
Apache Server passwording
« 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...
« Last Edit: February 25, 2006, 06:17:58 PM by Wraith112 »

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: Apache Server passwording
« Reply #1 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.
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos

Xeratul

    Topic Starter
  • 100,000th poster


  • Hopeful
  • Experience: Familiar
  • OS: Windows 7
Re: Apache Server passwording
« Reply #2 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.
« Last Edit: February 27, 2006, 07:56:14 AM by Wraith112 »

Saint_Jude

  • Guest
Re: Apache Server passwording
« Reply #3 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
« Last Edit: February 26, 2006, 01:52:19 PM by Saint_Jude »

Xeratul

    Topic Starter
  • 100,000th poster


  • Hopeful
  • Experience: Familiar
  • OS: Windows 7
Re: Apache Server passwording
« Reply #4 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?  :-?




« Last Edit: March 02, 2006, 08:01:48 AM by Wraith112 »

Xeratul

    Topic Starter
  • 100,000th poster


  • Hopeful
  • Experience: Familiar
  • OS: Windows 7
Re: Apache Server passwording
« Reply #5 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?
« Last Edit: March 02, 2006, 08:11:42 AM by Wraith112 »

Saint_Jude

  • Guest
Re: Apache Server passwording
« Reply #6 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


« Last Edit: March 02, 2006, 04:21:31 PM by Saint_Jude »

Xeratul

    Topic Starter
  • 100,000th poster


  • Hopeful
  • Experience: Familiar
  • OS: Windows 7
Re: Apache Server passwording
« Reply #7 on: March 12, 2006, 08:49:35 PM »
Ugh, it's still not working.  :-?