Re: apache requireany and htaccess

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2021-03-18 at 21:34 -0400, Alex wrote:
> I have a fedora33 system with apache 2.4.46 and trying to set up a
> web page that is only accessible to a select group of IPs defined in
> an .htaccess file in the directory where the web page resides. How
> can I do this?
> 
> I've read the apache htaccess howto and it really seems related only
> to user authentication.
> 
> How can I move the RequireAny section into an htaccess file? This
> will make it easier to make IP changes without having to reload
> apache.
> 
> Listen 192.168.1.11:443
> <VirtualHost 192.168.1.11:443>
>   ServerName noc.example.com
> 
> <Directory "/var/www/noc.example.com-443/html">
>   AllowOverride all
>   Options +ExecCGI
> 
>   <RequireAny>
>      Require ip 192.168.1.
>      Require ip 10.
>   </RequireAny>

You should be able to simply cut that RequireAny section (exactly as
you've typed it) and put it into a .htaccess file in the directory
you're concerned about.  If I do that on an Apache installation on my
CentOS machine, it works as I expected.

Check that you don't have a conflicting "AllowOverride none" in some
other configuration location for the same directory.

-- 
 
uname -rsvp
Linux 3.10.0-1160.15.2.el7.x86_64 #1 SMP Wed Feb 3 15:06:38 UTC 2021 x86_64
 
Boilerplate:  All unexpected mail to my mailbox is automatically deleted.
I will only get to see the messages that are posted to the mailing list.
 
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux