0

I am running REHL 6.7 with the stock Apache httpd-2.2.

I have enabled mod_status at the Location /server-status. I would like to allow access to this single Location in the following way:

  1. Deny from all
  2. Allow from within my servers subnet with IP range unknown and deny all not within my subnet

This is what my rule currently looks like for the location I want to allow access to within my subnet only (Currently it is denying all even within subnet since that how the rule is currently written).

<Directory "/var/www/html/example">
    Order allow,deny
    Deny from all
    AllowOverride None 
</Directory>
0

Apache doesn't have a 'local subnet' feature. You might look at something like Chef or Puppet to manage this config file for you and make the necessary changes.

  • Can't do that, apache is the only server that is approved for use on the system, so sounds like will have to add to instructions to customer to find the ip addresses in their subnet – jgr208 Mar 24 '16 at 16:24
  • 2
    Then you could probably write a template configuration file and hook in to the apache startup script to 'sed' in the correct subnet before launching Apache. – Jason Martin Mar 24 '16 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.