The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Guide to setting up MOD_HEADERS?

Discussion in 'General Discussion' started by fog, Mar 18, 2003.

  1. fog

    fog Well-Known Member

    Joined:
    Jun 22, 2002
    Messages:
    164
    Likes Received:
    0
    Trophy Points:
    16
    I'd surely appreciate it. Thanks :)
     
  2. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    Do you still have your latest buildapache directory?
     
  3. fog

    fog Well-Known Member

    Joined:
    Jun 22, 2002
    Messages:
    164
    Likes Received:
    0
    Trophy Points:
    16
  4. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    Ok, in that case, this is what I'd do:

    # cd apache_1.3.27
    # config.layout --enable-module=headers --enable-shared=headers
    # make
    # make install

    Then edit httpd.conf and add these lines in the correct places:

    LoadModule headers_module libexec/mod_headers.so

    AddModule mod_headers.c

    If you already have mod_expires as a loaded module, then add each of those two lines below the corresponding lines for mod_expires, like this:

    LoadModule expires_module libexec/mod_expires.so
    LoadModule headers_module libexec/mod_headers.so
    .
    .
    .
    AddModule mod_expires.c
    AddModule mod_headers.c

    and restart Apache.

    Someone please confirm.
     
  5. fog

    fog Well-Known Member

    Joined:
    Jun 22, 2002
    Messages:
    164
    Likes Received:
    0
    Trophy Points:
    16
    Thanks for the info.. could someone please confirm?
     
  6. sanket

    sanket Member

    Joined:
    Dec 17, 2003
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    i found a simple way out

    Hi
    I was trying to add mod_headers to my apache but could not get any help here.
    I did a lot of reasearcha and found a simple way which does not require recompiling apache.


    $:cd /home/cpapachebuild/buildapache/apache_1.3.29/src/modules/standard
    $: /usr/local/apache/bin/apxs -c mod_headers.c
    $:/usr/local/apache/bin/apxs -i -a -n headers mod_headers.so

    this will compile and add the header to the apache along with adding the lines to httpd.conf

    check httpd.conf by running
    httpd configtest
    If everything is fine
    restart httpd by giving the command
    httpd restart
    thats it! Now mod_headers will work with your apache.

    Generic Approach to add modules
    Generic Instructions
    Build and install a third-party Apache module, say mod_foo.c, into its own DSO mod_foo.so outside of the Apache source tree:
    Build and install via apxs: $ cd /path/to/3rdparty
    $ apxs -c mod_foo.c
    $ apxs -i -a -n foo mod_foo.so
     
    #6 sanket, Feb 9, 2004
    Last edited: Feb 9, 2004
Loading...

Share This Page