Help - Search - Members - Calendar
Full Version: MRTG - password protecting
The Planet Forums > Control Panels > Other
buzznet
I have succesfully installed MRTG from the instructions at: http://www.hostinglife.com/cpinfo/mrtg.php but how do you password protect the mrtg directory?
Daejuan
I've never used a MRTG, but I'm sure you can protect it with .htaccess
http://www.freewebmasterhelp.com/tutorials/htaccess/3
buzznet
The MRTG is located at /usr/local/apache/htdocs/mrtg but adding .htaccess/.htpasswd to this directory via ssh does not work.
klaude
How doesn't it work?
buzznet
There is no prompt for a password when entering the mrtg directory

I have put .htaccess in /usr/local/apache/htdocs/mrtg with the following content:

AuthUserFile /usr/local/apache/htdocs/mrtg/.htpasswd
AuthGroupFile /dev/null
AuthName "Password Protected Area"
AuthType Basic

<limit GET POST>
require valid-user
</limit>

I have also put the .htpasswd in the same directory
Paul
I've just posted the very same question on another forum.

I've tried password protecting it, denying access from all etc, but none of it works.

Did you find out how to do it?
sean1121
I've never really liked using .htaccess files, why put the access control file in a web accessable directory? I always just put something like this in my httpd.conf:
CODE
<Directory /path/to/password/protect>

       AuthType Digest

       AuthName foo.com

       AuthDigestFile /path/to/password/file

       Require user mary john joe

       Options FollowSymLinks

       AllowOverride None

</Directory>

To create the password file you run htdigest located in apaches bin dir:

CODE
/usr/local/apache2/bin/htdigest -o /path/to/password/file foo.com mary

Use -o if this is a new file. Notice that this is auth_digest, not auth_basic, you might have to recompile apache with --with-auth-digest for this to work.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.