mod_header

Discussion in 'Installation/Configuration' started by chief, Feb 21, 2017.

  1. chief

    chief Member HowtoForge Supporter

    Hi,
    I am trying to enable mod_headers, i have ispconfig 3 and have run this to install php7.1 - https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/ and now i want to enable modules such as mod_headers and more.. - how to enable please!!

    First i ran
    Code:
    a2enmod headers
    and the system ststated
    Code:
    Module headers already enabled
    . for good measure i
    Code:
    service apache2 restart
    restarted apache.
    I then ran
    Code:
    apachectl -t -D DUMP_MODULES
    and it showed
    Code:
     headers_module (shared)
    and it seems to be loaded, but when i run
    PHP:
    <?php
    phpinfo
    ()
    ?>
    cgi.rfc2616_headers states shows 0
    how do i get custom php directives to load it? as my developer is stating mod_headers is not activated or enabled from the output of php, but from what i see it is loaded and shared and is in mod-enabled. he used the php code
    PHP:
    (function_exists('apache_request_headers')) {
    echo 
    'FUNCTION EXISTS.';
    } else {
    echo 
    'FUNCTION DOES NOT EXISTS.';
    print_r(apache_request_headers());
    }
    and that states
    Code:
    FUNCTION DOES NOT EXISTS.
    please help obi-wan!!
     
    Last edited: Feb 21, 2017
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The apache header module and this PHP function are not related to each other, if the apache header module is loaded or not has no influence of the existence of that PHP function.

    When this function does not exist in PHP then either php is not compiled with that function to be enabled or the used php version does not has that function or the used php mode does not support it (see notes on that function in PHP manual about supported PHP modes and versions).
     
  3. chief

    chief Member HowtoForge Supporter

    thanks for the reply till.
    if i wanted to try adding something though ispconfig apache directives, how should it be added, can you give me an example of 1 rule please.

    thanks
     
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    This is a working example which also uses mod_headers:
    Code:
    <IfModule mod_headers.c>
        Header always set X-Frame-Options SAMEORIGIN
    </IfModule>
    
     

Share This Page