Migrating Apache configuration from 2.2 to 2.4 on WordPress

0 Votes
    852 Views

I am using this Apache conf to lock down /wp-admin/ area with login/password, but I am not sure if my new Apache 2.4 conf parts are correct, can someone help me?

<Directory "/opt/bitnami/apps/wordpress/htdocs/wp-admin">
    AuthType Basic
    AuthName "Restricted files"
    AuthUserFile "/opt/bitnami/apache2/wordpress_users"
    Require valid-user

    # Apache 2.2
    <IfModule !mod_authz_core.c>
        Order Deny,Allow
        Deny from all
        <Files admin-ajax.php>
            Order allow,deny
            Allow from all
            Satisfy any
        </Files>
    </IfModule>

    # Apache 2.4
    <IfModule mod_authz_core.c>
        Require all denied
        <Files admin-ajax.php>
            Require all granted
        </Files>
    </IfModule>    
</Directory>

Please signup or login to answer this question.