You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Danie Qian <da...@bestningning.com> on 2008/04/25 21:32:55 UTC

Re: [users@httpd] .htaccess for script aliased directories

I just setup awstats a few weeks ago and this setting works for me in the <VirtualHost>:


        Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
        Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
        Alias /icon "/usr/local/awstats/wwwroot/icon/"
        ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
        #
        # This is to permit URL access to scripts/files in AWStats directory.
        #
        <Directory "/usr/local/awstats/wwwroot">
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
        </Directory>

        <Directory "/usr/local/awstats/wwwroot/cgi-bin">
        AuthUserFile "/usr/local/awstats/wwwroot/mypasswordfile"
        AuthName "Awstats"
        AuthType Basic
        <Limit GET POST>
                require valid-user
        </Limit>
        Options None
        AllowOverride AuthConfig
        Order deny,allow
        deny from all
        allow from 216.130.212
        allow from 216.130.209
        allow from 216.130.213
        Satisfy any
        </Directory>




  ----- Original Message ----- 
  From: Pam Astor 
  To: users@httpd.apache.org 
  Sent: Friday, April 25, 2008 3:15 PM
  Subject: RE: [users@httpd] .htaccess for script aliased directories


  > > > 1. The directory you entered above is not the correct path; or
  > > > 2. The conf file you are editting is not being read.
  > > >
  > > > Check 1 by requesting a file that you know doesn't exist and check the
  > > > error log to see what path apache is searching in. Check 2 by putting
  > > > a deliberate syntax error in the conf file, restart the server, and
  > > > make sure apache fails to start with an error.
  > > >
  > > > Joshua.
  > >
  > > The directory in question - /home/mydirectory/www/awstats
  > > is a path to a script alias. In other words,
  > > ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
  > > (appears in the virtual domain tag for this domain).
  > >
  > > Could that have anything to do with the problem?
  > 
  > Yes. <Directory> refers to the file-system directory where the content> lives. It should be <Directory /usr/local/awstats/wwwroot/cgi-bin>.
  > 
  > Joshua.
   
  Darn.  I tried that path as well and it did not work either.  I know that 
  the 2 are correct paths because I could not see the stats unless it they were.
   
  Also I know that the conf file I'm editing is being read, because I just
  updated it yesterday, and I could not see my stats until I added that
  script alias line in th evirtual domain tag.
   
  Any other idea what could be the problem?


------------------------------------------------------------------------------
  Spell a grand slam in this game where word skill meets World Series. Get in the game. 

Re: [users@httpd] .htaccess for script aliased directories

Posted by Danie Qian <da...@bestningning.com>.
----- Original Message ----- 
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>; "Danie Qian" <da...@bestningning.com>
Sent: Friday, April 25, 2008 8:10 PM
Subject: Re: [users@httpd] .htaccess for script aliased directories


> On Fri, Apr 25, 2008 at 4:32 PM, Danie Qian <da...@bestningning.com> 
> wrote:
>
>>  On second thought, I tested the setting by commentting out the 'require
>> valid-user' line completely to see what the browsor gets for other 
>> methods,
>>  it is actually a 403 forbidden error instead of a open 200. So i guess I
>> was fine with the <limit>GET POST</limit> lines - it only triggers a 
>> login
>> prompt for GET & POST while leaving the others forbidden. Am I wrong?
>
> You may or may not create an immediate security problem by using
> <Limit>. But regardless, it is a bad idea. It could easily open a
> security hole in the future if you ever change the configuration of
> the content behind the restriction. And why use a complex config, when
> the simple one is better and more secure?
>

I completely agree with you in a general sense 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess for script aliased directories

Posted by ma...@gmail.com.
Limits the require directive to those verbs - what about the others? 
Sent from my BlackBerry® wireless device

-----Original Message-----
From: "Danie Qian" <da...@bestningning.com>

Date: Fri, 25 Apr 2008 15:53:59 
To:<us...@httpd.apache.org>
Subject: Re: [users@httpd] .htaccess for script aliased directories


----- Original Message ----- 
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>; "Danie Qian" <da...@bestningning.com>
Sent: Friday, April 25, 2008 3:39 PM
Subject: Re: [users@httpd] .htaccess for script aliased directories


> On Fri, Apr 25, 2008 at 3:32 PM, Danie Qian <da...@bestningning.com> 
> wrote:
>
>>         <Limit GET POST>
>>                 require valid-user
>>         </Limit>
>
> Remove the <Limit GET POST> and </Limit> lines. They are dangerous. See:
> http://httpd.apache.org/docs/2.2/mod/core.html#limit
>
> Joshua.
>

From the above link I cant find anything dangerous except for the fact that 
it limits requests to GET,POST methods, about which my users never 
complained. Or, did I miss out anything here? 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess for script aliased directories

Posted by Joshua Slive <jo...@slive.ca>.
On Fri, Apr 25, 2008 at 4:32 PM, Danie Qian <da...@bestningning.com> wrote:

>  On second thought, I tested the setting by commentting out the 'require
> valid-user' line completely to see what the browsor gets for other methods,
>  it is actually a 403 forbidden error instead of a open 200. So i guess I
> was fine with the <limit>GET POST</limit> lines - it only triggers a login
> prompt for GET & POST while leaving the others forbidden. Am I wrong?

You may or may not create an immediate security problem by using
<Limit>. But regardless, it is a bad idea. It could easily open a
security hole in the future if you ever change the configuration of
the content behind the restriction. And why use a complex config, when
the simple one is better and more secure?

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess for script aliased directories

Posted by Danie Qian <da...@bestningning.com>.
----- Original Message ----- 
From: "Danie Qian" <da...@bestningning.com>
To: <us...@httpd.apache.org>
Sent: Friday, April 25, 2008 4:16 PM
Subject: Re: [users@httpd] .htaccess for script aliased directories


>
> ----- Original Message ----- 
> From: "Dragon" <dr...@crimson-dragon.com>
> To: <us...@httpd.apache.org>
> Sent: Friday, April 25, 2008 3:56 PM
> Subject: Re: [users@httpd] .htaccess for script aliased directories
>
>
>> Danie Qian wrote:
>>
>>>----- Original Message ----- From: "Joshua Slive" <jo...@slive.ca>
>>>To: <us...@httpd.apache.org>; "Danie Qian" <da...@bestningning.com>
>>>Sent: Friday, April 25, 2008 3:39 PM
>>>Subject: Re: [users@httpd] .htaccess for script aliased directories
>>>
>>>
>>>>On Fri, Apr 25, 2008 at 3:32 PM, Danie Qian <da...@bestningning.com> 
>>>>wrote:
>>>>
>>>>>         <Limit GET POST>
>>>>>                 require valid-user
>>>>>         </Limit>
>>>>
>>>>Remove the <Limit GET POST> and </Limit> lines. They are dangerous. See:
>>>>http://httpd.apache.org/docs/2.2/mod/core.html#limit
>>>>
>>>>Joshua.
>>>
>>> From the above link I cant find anything dangerous except for the fact 
>>> that it limits requests to GET,POST methods, about which my users never 
>>> complained. Or, did I miss out anything here?
>> ---------------- End original message. ---------------------
>>
>>
>> No, it does not do what you think.
>>
>> As you have it in your config, it requires a valid user for only the GET 
>> and POST methods. It ALLOWS all other methods without a valid user.
>>
>>
>> This opens you up to potential attacks. You want to remove the Limit 
>> directives so ALL methods will require a valid user.
>>
>>
>> Dragon
>>
>
> I copied the lines from another server and never thought about it in this 
> way :)
> Thanks everyone for pointing it out for me to eliminate a potential 
> security problem.
>

On second thought, I tested the setting by commentting out the 'require 
valid-user' line completely to see what the browsor gets for other methods,
it is actually a 403 forbidden error instead of a open 200. So i guess I was 
fine with the <limit>GET POST</limit> lines - it only triggers a login 
prompt for GET & POST while leaving the others forbidden. Am I wrong? 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess for script aliased directories

Posted by Danie Qian <da...@bestningning.com>.
----- Original Message ----- 
From: "Dragon" <dr...@crimson-dragon.com>
To: <us...@httpd.apache.org>
Sent: Friday, April 25, 2008 3:56 PM
Subject: Re: [users@httpd] .htaccess for script aliased directories


> Danie Qian wrote:
>
>>----- Original Message ----- From: "Joshua Slive" <jo...@slive.ca>
>>To: <us...@httpd.apache.org>; "Danie Qian" <da...@bestningning.com>
>>Sent: Friday, April 25, 2008 3:39 PM
>>Subject: Re: [users@httpd] .htaccess for script aliased directories
>>
>>
>>>On Fri, Apr 25, 2008 at 3:32 PM, Danie Qian <da...@bestningning.com> 
>>>wrote:
>>>
>>>>         <Limit GET POST>
>>>>                 require valid-user
>>>>         </Limit>
>>>
>>>Remove the <Limit GET POST> and </Limit> lines. They are dangerous. See:
>>>http://httpd.apache.org/docs/2.2/mod/core.html#limit
>>>
>>>Joshua.
>>
>> From the above link I cant find anything dangerous except for the fact 
>> that it limits requests to GET,POST methods, about which my users never 
>> complained. Or, did I miss out anything here?
> ---------------- End original message. ---------------------
>
>
> No, it does not do what you think.
>
> As you have it in your config, it requires a valid user for only the GET 
> and POST methods. It ALLOWS all other methods without a valid user.
>
>
> This opens you up to potential attacks. You want to remove the Limit 
> directives so ALL methods will require a valid user.
>
>
> Dragon
>

I copied the lines from another server and never thought about it in this 
way :)
Thanks everyone for pointing it out for me to eliminate a potential security 
problem. 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess for script aliased directories

Posted by Dragon <dr...@crimson-dragon.com>.
Danie Qian wrote:

>----- Original Message ----- From: "Joshua Slive" <jo...@slive.ca>
>To: <us...@httpd.apache.org>; "Danie Qian" <da...@bestningning.com>
>Sent: Friday, April 25, 2008 3:39 PM
>Subject: Re: [users@httpd] .htaccess for script aliased directories
>
>
>>On Fri, Apr 25, 2008 at 3:32 PM, Danie Qian <da...@bestningning.com> wrote:
>>
>>>         <Limit GET POST>
>>>                 require valid-user
>>>         </Limit>
>>
>>Remove the <Limit GET POST> and </Limit> lines. They are dangerous. See:
>>http://httpd.apache.org/docs/2.2/mod/core.html#limit
>>
>>Joshua.
>
> From the above link I cant find anything dangerous except for the 
> fact that it limits requests to GET,POST methods, about which my 
> users never complained. Or, did I miss out anything here?
---------------- End original message. ---------------------


No, it does not do what you think.

As you have it in your config, it requires a valid user for only the 
GET and POST methods. It ALLOWS all other methods without a valid user.


This opens you up to potential attacks. You want to remove the Limit 
directives so ALL methods will require a valid user.


Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess for script aliased directories

Posted by Danie Qian <da...@bestningning.com>.
----- Original Message ----- 
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>; "Danie Qian" <da...@bestningning.com>
Sent: Friday, April 25, 2008 3:39 PM
Subject: Re: [users@httpd] .htaccess for script aliased directories


> On Fri, Apr 25, 2008 at 3:32 PM, Danie Qian <da...@bestningning.com> 
> wrote:
>
>>         <Limit GET POST>
>>                 require valid-user
>>         </Limit>
>
> Remove the <Limit GET POST> and </Limit> lines. They are dangerous. See:
> http://httpd.apache.org/docs/2.2/mod/core.html#limit
>
> Joshua.
>

>From the above link I cant find anything dangerous except for the fact that 
it limits requests to GET,POST methods, about which my users never 
complained. Or, did I miss out anything here? 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess for script aliased directories

Posted by Joshua Slive <jo...@slive.ca>.
On Fri, Apr 25, 2008 at 3:32 PM, Danie Qian <da...@bestningning.com> wrote:

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

Remove the <Limit GET POST> and </Limit> lines. They are dangerous. See:
http://httpd.apache.org/docs/2.2/mod/core.html#limit

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess for script aliased directories SOLVED!

Posted by Danie Qian <da...@bestningning.com>.
I think the following mod_access settings is the one that makes me safe in 
this particular setup:

        Order deny,allow
        deny from all
        allow from 216.130.212
        allow from 216.130.209
        allow from 216.130.213
        Satisfy any



----- Original Message ----- 
From: <ma...@gmail.com>
To: <us...@httpd.apache.org>
Sent: Friday, April 25, 2008 5:06 PM
Subject: Re: [users@httpd] .htaccess for script aliased directories SOLVED!


> You definately need to remove the limit clause
> That clause iat best s meaningless given your previous post, and if the 
> config changes elsewhere your server or data would be at risk.
> You probably have a server wide limitexcept clause which bans the other 
> verbs or some other permissions lock down, but just to be clear the limit 
> clause is NOT what youi want ;)
> Sent from my BlackBerry?wireless device
>
> -----Original Message-----
> From: Pam Astor <pa...@hotmail.com>
>
> Date: Fri, 25 Apr 2008 17:00:35
> To:<us...@httpd.apache.org>
> Subject: RE: [users@httpd] .htaccess for script aliased directories 
> SOLVED!
>
> Thanks so much Danie!?
> ?
> I think the problem was the fact that I was not using double quotes
> for my path in the <Directory> Tag.?I saw your earlier post - noticed you 
> had them,
> added them in, and set the path again to the script aliased path and it 
> worked fine.?
> ?
> I was able to get it working with this simple tag:
> ?
> <Directory "usr/local/awstats/wwwroot/cgi-bin">
> AuthName "MembersOnly"
> AuthType Basic
> AuthUserFile "/home/userdir/htpasswd"
> Require user coder
> AllowOverride AuthConfig
> </Directory>
> ?
> I had a hunch it was something simple.?Thanks so much!
> ?
> ?
> ?
> I just setup awstats a few weeks ago and this setting works for me in the 
> <VirtualHost>:
> ?
>
> ������?Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
> ������?Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
> ������?Alias /icon "/usr/local/awstats/wwwroot/icon/"
> ������?ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
> ������?#
> ������?# This is to permit URL access to scripts/files in AWStats 
> directory.
> ������?#
> ������?<Directory "/usr/local/awstats/wwwroot">
> ������?Options None
> ������?AllowOverride None
> ������?Order allow,deny
> ������?Allow from all
> ������?</Directory>
> ?
> ������?<Directory "/usr/local/awstats/wwwroot/cgi-bin">
> ������?AuthUserFile "/usr/local/awstats/wwwroot/mypasswordfile"
> ������?AuthName "Awstats"
> ������?AuthType Basic
> ������?<Limit GET POST>
> ��������������?require valid-user
> ������?</Limit>
> ������?Options None
> ������?AllowOverride AuthConfig
> ������?Order deny,allow
> ������?deny from all
> ������?allow from 216.130.212
> ������?allow from 216.130.209
> ������?allow from 216.130.213
> ������?Satisfy any
> ������?</Directory>skill meets World Series. Get in the game. 
> <http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08>
>
> ----------------
> Express yourself wherever you are. Mobilize! 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess for script aliased directories SOLVED!

Posted by ma...@gmail.com.
You definately need to remove the limit clause
That clause iat best s meaningless given your previous post, and if the config changes elsewhere your server or data would be at risk.
You probably have a server wide limitexcept clause which bans the other verbs or some other permissions lock down, but just to be clear the limit clause is NOT what youi want ;)
Sent from my BlackBerry® wireless device

-----Original Message-----
From: Pam Astor <pa...@hotmail.com>

Date: Fri, 25 Apr 2008 17:00:35 
To:<us...@httpd.apache.org>
Subject: RE: [users@httpd] .htaccess for script aliased directories SOLVED!

Thanks so much Danie!  
  
I think the problem was the fact that I was not using double quotes 
for my path in the <Directory> Tag.  I saw your earlier post - noticed you had them, 
added them in, and set the path again to the script aliased path and it worked fine.  
  
I was able to get it working with this simple tag: 
  
<Directory "usr/local/awstats/wwwroot/cgi-bin">
AuthName "MembersOnly"
AuthType Basic
AuthUserFile "/home/userdir/htpasswd"
Require user coder
AllowOverride AuthConfig
</Directory> 
  
I had a hunch it was something simple.  Thanks so much! 
  
  
  
I just setup awstats a few weeks ago and this setting works for me in the <VirtualHost>: 
  

        Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
        Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
        Alias /icon "/usr/local/awstats/wwwroot/icon/"
        ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
        #
        # This is to permit URL access to scripts/files in AWStats directory.
        #
        <Directory "/usr/local/awstats/wwwroot">
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
        </Directory> 
  
        <Directory "/usr/local/awstats/wwwroot/cgi-bin">
        AuthUserFile "/usr/local/awstats/wwwroot/mypasswordfile"
        AuthName "Awstats"
        AuthType Basic
        <Limit GET POST>
                require valid-user
        </Limit>
        Options None
        AllowOverride AuthConfig
        Order deny,allow
        deny from all
        allow from 216.130.212
        allow from 216.130.209
        allow from 216.130.213
        Satisfy any
        </Directory>skill meets World Series. Get in the game. <http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08>  

----------------
Express yourself wherever you are. Mobilize! 

RE: [users@httpd] .htaccess for script aliased directories SOLVED!

Posted by Pam Astor <pa...@hotmail.com>.



Thanks so much Danie! 
 
I think the problem was the fact that I was not using double quotes 
for my path in the <Directory> Tag.  I saw your earlier post - noticed you had them,
added them in, and set the path again to the script aliased path and it worked fine.  
 
I was able to get it working with this simple tag:
 
<Directory "usr/local/awstats/wwwroot/cgi-bin">AuthName "MembersOnly"AuthType BasicAuthUserFile "/home/userdir/htpasswd"Require user coderAllowOverride AuthConfig</Directory>
 
I had a hunch it was something simple.  Thanks so much!
 
 
 
I just setup awstats a few weeks ago and this setting works for me in the <VirtualHost>:
 
        Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"        Alias /awstatscss "/usr/local/awstats/wwwroot/css/"        Alias /icon "/usr/local/awstats/wwwroot/icon/"        ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"        #        # This is to permit URL access to scripts/files in AWStats directory.        #        <Directory "/usr/local/awstats/wwwroot">        Options None        AllowOverride None        Order allow,deny        Allow from all        </Directory>
 
        <Directory "/usr/local/awstats/wwwroot/cgi-bin">        AuthUserFile "/usr/local/awstats/wwwroot/mypasswordfile"        AuthName "Awstats"        AuthType Basic        <Limit GET POST>                require valid-user        </Limit>        Options None        AllowOverride AuthConfig        Order deny,allow        deny from all        allow from 216.130.212        allow from 216.130.209        allow from 216.130.213        Satisfy any        </Directory>skill meets World Series. Get in the game. 
_________________________________________________________________
Express yourself wherever you are. Mobilize!
http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL