0

I need to restrict access to specific location in payara application. Is it possible in apache2.4 ? I tried using

<VirtualHost *:8181>

    <Location "/dir">
        Require all denied
        Allow from 192.168.0.0/24
    </Location>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

But this does not work for some reason. It is linked to sites-enabled, so this should not be problem, but I am still able to access this directory, even from other network than 192.168.0.0.

0

You are mixing directives from 2.2 and 2.4 which won't yield good results.

Do not use Allow/Satisfy/Deny/Order any more.

<Location /dir>
    Require all denied
    Require ip 192.168.0.0/24
</Location>
2
  • Still did not help. Could there a problem if it is a SSL connection. No errors in log, nothing. – František Jeřábek Apr 26 '18 at 4:23
  • SSL communication must succed before any http communication is made yes, but you are showing a virtualhost with port 8181, are you sure you are using SSL? If in doubt try with curl "curl -v httpX://yourserver.example.com:port/path". – ezra-s Apr 27 '18 at 14:06

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.