Forum Moderators: phranque

Message Too Old, No Replies

P3P Compact Policy Trouble

Getting a 500 server error

         

erikcw

11:00 pm on Apr 6, 2005 (gmt 0)

10+ Year Member



Hi,

I am trying to add a P3P compact privacy policy.

The line I am adding to .htacess is
Header append P3P 'CP="CAO DSP COR ADM DEV PSA IVA OUR IND STA"'

When I have that line active, I get this error when trying to access the site:

Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator,
inform them of the time the error
occurred, and anything you might have done that may have caused the
error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.

The Error log says:
[Wed Apr 6 18:18:00 2005] [alert] [client 68.6.62.101]
/home/lybp/public_html/.htaccess: Invalid command 'Header', perhaps
mis-spelled or defined by a module not included in the server
configuration

What needs to happen for this to work?

Thanks,
Erik

sitz

1:43 am on Apr 7, 2005 (gmt 0)

10+ Year Member



[Wed Apr 6 18:18:00 2005] [alert] [client 68.6.62.101] /home/lybp/public_html/.htaccess: Invalid command 'Header', perhaps mis-spelled or defined by a module not included in the server configuration

This means that the 'Header' directive isn't available; this is generally caused by the module which supplies the directive not being loaded. You don't say which version of Apache you're using; for Apache 1.3.x, you'll need to uncomment the LoadModule and AddModule lines which reference 'mod_headers'. For Apache 2.0.x, you'll just need to uncomment the LoadModule line.

jdMorgan

2:17 am on Apr 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



And to make the browser happy, add a colon to the header name:

Header append P3[b]P:[/b] 'CP="CAO DSP COR ADM DEV PSA IVA OUR IND STA"'

Jim

sitz

2:33 am on Apr 7, 2005 (gmt 0)

10+ Year Member



Actually, according to the Apache docs; the ':' isn't needed. Adding one won't cause it to be duplicated; from mod_headers.c (apache 1.3.33 and 2.0.53):

if ((colon = strchr(hdr, ':')))
*colon = '\0';

erikcw

12:21 am on Apr 10, 2005 (gmt 0)

10+ Year Member



I am using apache 1.3.3. Do I need to recompile Apache with the mod_headers module? If so,where do I download the source module from? (I couldn't find it on the Apache site...) Or is it built in to apache?

Thanks!

Erik

sitz

1:43 am on Apr 10, 2005 (gmt 0)

10+ Year Member



for Apache 1.3.x, you'll need to uncomment the LoadModule and AddModule lines which reference 'mod_headers'.

Like I said. =)

mod_headers is a standard Apache module; documentation is available at [httpd.apache.org ]

erikcw

4:07 am on Apr 11, 2005 (gmt 0)

10+ Year Member



I checked my httpd.conf file, and there is no reference to mod_headers. What exactly should I add to the file te make it work?

Thanks for your help!

jdMorgan

3:16 pm on Apr 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's a more-or-less default LoadModule and AddModule list. Insert mod_headers into your httpd.conf file in that same positions as shown here, relative to the preceding and following modules.

LoadModule env_module modules/mod_env.so
LoadModule config_log_module modules/mod_log_config.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule status_module modules/mod_status.so
LoadModule info_module modules/mod_info.so
LoadModule includes_module modules/mod_include.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule asis_module modules/mod_asis.so
LoadModule imap_module modules/mod_imap.so
LoadModule action_module modules/mod_actions.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule proxy_module modules/libproxy.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule anon_auth_module modules/mod_auth_anon.so
LoadModule digest_module modules/mod_digest.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so

ClearModuleList
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_userdir.c
AddModule mod_proxy.c
AddModule mod_alias.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_auth_anon.c
AddModule mod_digest.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_usertrack.c
AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_vhost_alias.c

Jim

erikcw

7:50 pm on Apr 11, 2005 (gmt 0)

10+ Year Member



In my httpd.conf the LoadModule paths show libexec/module_name.so
I checked the libexec directory and mod_headers.so is not there. Can I download it from somewhere or is this absence normal?

sitz

2:51 am on Apr 12, 2005 (gmt 0)

10+ Year Member



How did you install Apache? From source or a pre-compiled binary/package? If the former, you most likely didn't include the headers module in the list of modules to build when you ran ./configure. If you installed it from a package, it's *possible* that module was broken out into seperate package, but I'm not aware of any distributions which do that.