migrate .htaccess conent to httpd.conf

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

migrate .htaccess conent to httpd.conf

Markus Rosjat
Hi there,

I was wondering if there is some guidence out there for this sort of
thing? I know it's possible to simply block directories or put basic
auth in front of it but what's about some more fine grained stuff for a
file in a directory? Like this

<IfModule !authz_core_module>
     order deny,allow
     <Files "template.htm">
         deny from all
     </Files>
</IfModule>
<IfModule authz_core_module>
     <Files "template.htm">
         Require all denied
     </Files>
</IfModule>

Is there a way to rewrite this for the httpd.conf ?

And 2nd question would be how to give the user a way to implement
something like it on there own? I was thinking of a simply standard
include in the server definition but this might mess things up

regards

--
Markus Rosjat    fon: +49 351 8107223    mail: [hidden email]

G+H Webservice GbR Gorzolla, Herrmann
Königsbrücker Str. 70, 01099 Dresden

http://www.ghweb.de
fon: +49 351 8107220   fax: +49 351 8107227

Bitte prüfen Sie, ob diese Mail wirklich ausgedruckt werden muss! Before
you print it, think about your responsibility and commitment to the
ENVIRONMENT

Reply | Threaded
Open this post in threaded view
|

Re: migrate .htaccess conent to httpd.conf

Gregory Edigarov-5
On 03.10.17 15:10, rosjat wrote:

> Hi there,
>
> I was wondering if there is some guidence out there for this sort of
> thing? I know it's possible to simply block directories or put basic
> auth in front of it but what's about some more fine grained stuff for
> a file in a directory? Like this
>
> <IfModule !authz_core_module>
>     order deny,allow
>     <Files "template.htm">
>         deny from all
>     </Files>
> </IfModule>
> <IfModule authz_core_module>
>     <Files "template.htm">
>         Require all denied
>     </Files>
> </IfModule>
>
> Is there a way to rewrite this for the httpd.conf ?
>
try this:
location template.* {
     block;
}
untested, but should work.

> And 2nd question would be how to give the user a way to implement
> something like it on there own? I was thinking of a simply standard
> include in the server definition but this might mess things up
>
there is no such thing as .htaccess in httpd.
> regards
>

Reply | Threaded
Open this post in threaded view
|

Re: migrate .htaccess conent to httpd.conf

Michael Hekeler
In reply to this post by Markus Rosjat
> And 2nd question would be how to give the user a way to implement
> something like it on there own? I was thinking of a simply standard
> include in the server definition but this might mess things up

if you need directory specific and user define-able override files like
those .htaccess then why not use Apache?

Don´t get me wrong: I don´t want to vote for Apache but I think it´s
better to use "Tool X" when you need the features of "Tool X"
than to bend "Tool Y" that it acts like "Tool X" ;-)


To your 1st question:
   location "/filename" { block }

Reply | Threaded
Open this post in threaded view
|

Re: migrate .htaccess conent to httpd.conf

Markus Rosjat
Hi,

Am 05.10.2017 um 10:11 schrieb Michael Hekeler:
>> And 2nd question would be how to give the user a way to implement
>> something like it on there own? I was thinking of a simply standard
>> include in the server definition but this might mess things up
>
> if you need directory specific and user define-able override files like
> those .htaccess then why not use Apache?
>

I don't need them I have them on a older system were apache 1.3 was the
standard webserver for openbsd still. So I simply want to migrate the
content to a system with a new standard webserver httpd.

> Don´t get me wrong: I don´t want to vote for Apache but I think it´s
> better to use "Tool X" when you need the features of "Tool X"
> than to bend "Tool Y" that it acts like "Tool X" ;-)
>

I understand :)

>
> To your 1st question:
>     location "/filename" { block }
>

so this would mean if I have 20 files spread over 10 directories I need
for all of them a location statement to block or otherwise auth befor
someone could access it?

Regards


--
Markus Rosjat    fon: +49 351 8107223    mail: [hidden email]

G+H Webservice GbR Gorzolla, Herrmann
Königsbrücker Str. 70, 01099 Dresden

http://www.ghweb.de
fon: +49 351 8107220   fax: +49 351 8107227

Bitte prüfen Sie, ob diese Mail wirklich ausgedruckt werden muss! Before
you print it, think about your responsibility and commitment to the
ENVIRONMENT

Reply | Threaded
Open this post in threaded view
|

Re: migrate .htaccess conent to httpd.conf

Michael Hekeler
> I don't need them I have them on a older system were apache 1.3 was
> the standard webserver for openbsd still. So I simply want to
> migrate the content to a system with a new standard webserver httpd.

Okay
But keep in mind that httpd is not Apache and converting complicated
htaccess stuff is not always possible... ;-)
 


> so this would mean if I have 20 files spread over 10 directories I
> need for all of them a location statement to block or otherwise auth
> befor someone could access it?

:-)
No, of course not

You can do thinks like: location "/.ht*" { block }
and with Lua's pattern matching you can do really cool things.
See patterns(7) and httpd.conf(5)

Reply | Threaded
Open this post in threaded view
|

Re: migrate .htaccess conent to httpd.conf

Markus Rosjat
Hi,

Am 05.10.2017 um 12:53 schrieb Michael Hekeler:
>> I don't need them I have them on a older system were apache 1.3 was
>> the standard webserver for openbsd still. So I simply want to
>> migrate the content to a system with a new standard webserver httpd.
>
> Okay
> But keep in mind that httpd is not Apache and converting complicated
> htaccess stuff is not always possible... ;-)
>  
>

sure no problem

>
>> so this would mean if I have 20 files spread over 10 directories I
>> need for all of them a location statement to block or otherwise auth
>> befor someone could access it?
>
> :-)
> No, of course not
>
> You can do thinks like: location "/.ht*" { block }
> and with Lua's pattern matching you can do really cool things.
> See patterns(7) and httpd.conf(5)
>

I'll check it out

Thank you

--
Markus Rosjat    fon: +49 351 8107223    mail: [hidden email]

G+H Webservice GbR Gorzolla, Herrmann
Königsbrücker Str. 70, 01099 Dresden

http://www.ghweb.de
fon: +49 351 8107220   fax: +49 351 8107227

Bitte prüfen Sie, ob diese Mail wirklich ausgedruckt werden muss! Before
you print it, think about your responsibility and commitment to the
ENVIRONMENT