You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Michele Waldman <mm...@nyc.rr.com> on 2009/05/05 23:14:18 UTC

Using httpd.conf and htaccess

I want to get some configuration variables from httpd.conf and .htaccess for
mod_auth_digest:

 

static const command_rec digest_cmds[] =

{

    AP_INIT_TAKE1("AuthName", set_realm, NULL, OR_AUTHCFG,

     "The authentication realm (e.g. \"Members Only\")"),

    AP_INIT_ITERATE("AuthDigestProvider", add_authn_provider, NULL,
OR_AUTHCFG,

                     "specify the auth providers for a directory or
location"),

    AP_INIT_ITERATE("AuthDigestQop", set_qop, NULL, OR_AUTHCFG,

     "A list of quality-of-protection options"),

    AP_INIT_TAKE1("AuthDigestNonceLifetime", set_nonce_lifetime, NULL,
OR_AUTHCFG,

     "Maximum lifetime of the server nonce (seconds)"),

    AP_INIT_TAKE1("AuthDigestNonceFormat", set_nonce_format, NULL,
OR_AUTHCFG,

     "The format to use when generating the server nonce"),

    AP_INIT_FLAG("AuthDigestNcCheck", set_nc_check, NULL, OR_AUTHCFG,

     "Whether or not to check the nonce-count sent by the client"),

    AP_INIT_TAKE1("AuthDigestAlgorithm", set_algorithm, NULL, OR_AUTHCFG,

     "The algorithm used for the hash calculation"),

    AP_INIT_ITERATE("AuthDigestDomain", set_uri_list, NULL, OR_AUTHCFG,

     "A list of URI's which belong to the same protection space as the
current URI"),

    AP_INIT_TAKE1("AuthDigestShmemSize", set_shmem_size, NULL, RSRC_CONF,

     "The amount of shared memory to allocate for keeping track of
clients"),

    AP_INIT_TAKE1("AuthMySQLUser", ap_set_string_slot,

      (void *) APR_OFFSETOF(digest_config_rec, dbc_username),

      OR_AUTHCFG, "DB Username"),

    {NULL}

};

 

In httpd.conf

<IfModule mod_auth_digest.c>

 <Location />

  AuthMySqlUser itweenz0

</Location>

</IfModule>

 

In .htaccess:

<Files login.php> 

AuthType Digest

AuthName "account"

AuthUserFile /path/.htpasswd

Require valid-user

</Files> 

 

When I don't use AuthMySQLUser in httpd.conf, the AuthName from .htaccess is
defined fine.  But, when I specify the AuthMySQLUser in httpd.conf, the
AuthMySqlUser is specified from httpd.conf, but the AuthName is not set from
,htaccess.

 

How do I get the configuration variables to come from httpd.conf and
.htaccess at the same time?

 

Thanks,

 

Michele

 


RE: Using httpd.conf and htaccess

Posted by Michele Waldman <mm...@nyc.rr.com>.
I never could get it to pull from both httpd.conf and .htaccess at the same
time.

But, I'd rather put everything in .htaccess anyway.  My client would never
figure out how to change httpd.conf and restart apache.

Oh, well.  Good enough.

Michele

> -----Original Message-----
> From: Joe Lewis [mailto:joe@joe-lewis.com]
> Sent: Tuesday, May 05, 2009 6:41 PM
> To: modules-dev@httpd.apache.org
> Subject: Re: Using httpd.conf and htaccess
> 
> Michele Waldman wrote:
> > Looks like I need to use:
> > AllowOverride AuthConfig
> >
> > Is this right?  Where do I put this?
> >
> >
> Directory/'Location block that covers that particular directory or web
> location as defined in the httpd.conf file. Without that directive,
> commands may not be allowed in the .htaccess files.
> 
> Joe
> 
> 
> 
> --
> Joe Lewis
> Chief Nerd 	SILVERHAWK <http://www.silverhawk.net/> 	(801)
660-1900
> 
> ------------------------------------------------------------------------
> /Sure, it's going to kill a lot of people, but they may be dying of
> something else anyway.
> --Othal Brand, member of a Texas pesticide review board, on chlordane
> pesticide/


Re: Using httpd.conf and htaccess

Posted by Joe Lewis <jo...@joe-lewis.com>.
Michele Waldman wrote:
> Looks like I need to use:
> AllowOverride AuthConfig
>
> Is this right?  Where do I put this?
>   
>
Directory/'Location block that covers that particular directory or web 
location as defined in the httpd.conf file. Without that directive, 
commands may not be allowed in the .htaccess files.

Joe



-- 
Joe Lewis
Chief Nerd 	SILVERHAWK <http://www.silverhawk.net/> 	(801) 660-1900

------------------------------------------------------------------------
/Sure, it's going to kill a lot of people, but they may be dying of 
something else anyway.
--Othal Brand, member of a Texas pesticide review board, on chlordane 
pesticide/

RE: Using httpd.conf and htaccess

Posted by Michele Waldman <mm...@nyc.rr.com>.
Looks like I need to use:
AllowOverride AuthConfig

Is this right?  Where do I put this?

Margaret Michele Waldman
Sovereign Sites L.L.C.
Website Development
646-861-3375
Rule your domain ...
> -----Original Message-----
> From: Michele Waldman [mailto:mmwaldman@nyc.rr.com]
> Sent: Tuesday, May 05, 2009 5:14 PM
> To: modules-dev@httpd.apache.org
> Subject: Using httpd.conf and htaccess
> 
> I want to get some configuration variables from httpd.conf and .htaccess
> for
> mod_auth_digest:
> 
> 
> 
> static const command_rec digest_cmds[] =
> 
> {
> 
>     AP_INIT_TAKE1("AuthName", set_realm, NULL, OR_AUTHCFG,
> 
>      "The authentication realm (e.g. \"Members Only\")"),
> 
>     AP_INIT_ITERATE("AuthDigestProvider", add_authn_provider, NULL,
> OR_AUTHCFG,
> 
>                      "specify the auth providers for a directory or
> location"),
> 
>     AP_INIT_ITERATE("AuthDigestQop", set_qop, NULL, OR_AUTHCFG,
> 
>      "A list of quality-of-protection options"),
> 
>     AP_INIT_TAKE1("AuthDigestNonceLifetime", set_nonce_lifetime, NULL,
> OR_AUTHCFG,
> 
>      "Maximum lifetime of the server nonce (seconds)"),
> 
>     AP_INIT_TAKE1("AuthDigestNonceFormat", set_nonce_format, NULL,
> OR_AUTHCFG,
> 
>      "The format to use when generating the server nonce"),
> 
>     AP_INIT_FLAG("AuthDigestNcCheck", set_nc_check, NULL, OR_AUTHCFG,
> 
>      "Whether or not to check the nonce-count sent by the client"),
> 
>     AP_INIT_TAKE1("AuthDigestAlgorithm", set_algorithm, NULL, OR_AUTHCFG,
> 
>      "The algorithm used for the hash calculation"),
> 
>     AP_INIT_ITERATE("AuthDigestDomain", set_uri_list, NULL, OR_AUTHCFG,
> 
>      "A list of URI's which belong to the same protection space as the
> current URI"),
> 
>     AP_INIT_TAKE1("AuthDigestShmemSize", set_shmem_size, NULL, RSRC_CONF,
> 
>      "The amount of shared memory to allocate for keeping track of
> clients"),
> 
>     AP_INIT_TAKE1("AuthMySQLUser", ap_set_string_slot,
> 
>       (void *) APR_OFFSETOF(digest_config_rec, dbc_username),
> 
>       OR_AUTHCFG, "DB Username"),
> 
>     {NULL}
> 
> };
> 
> 
> 
> In httpd.conf
> 
> <IfModule mod_auth_digest.c>
> 
>  <Location />
> 
>   AuthMySqlUser itweenz0
> 
> </Location>
> 
> </IfModule>
> 
> 
> 
> In .htaccess:
> 
> <Files login.php>
> 
> AuthType Digest
> 
> AuthName "account"
> 
> AuthUserFile /path/.htpasswd
> 
> Require valid-user
> 
> </Files>
> 
> 
> 
> When I don't use AuthMySQLUser in httpd.conf, the AuthName from .htaccess
> is
> defined fine.  But, when I specify the AuthMySQLUser in httpd.conf, the
> AuthMySqlUser is specified from httpd.conf, but the AuthName is not set
> from
> ,htaccess.
> 
> 
> 
> How do I get the configuration variables to come from httpd.conf and
> .htaccess at the same time?
> 
> 
> 
> Thanks,
> 
> 
> 
> Michele
> 
>