I am trying to configure Access-Control-Allow-Origin in Apache to allow certain domains. Below is my httpd configuration
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
But the above config is not doing anything. Heard that we need to enable mod_headers to make it work. I run this httpd -M command and observed that header module is not present in my Apache. Can you anyone pls tell me how to enable?
You can simply use apachectl -M command to list all the enabled modules in Apache web server. Since the output contains a list of all installed modules in Apache, we can pass its output to grep and search for “expires” string. If the output contains “expires_module” it means mod_expires is enabled.
This module provides directives to control and modify HTTP request and response headers. Headers can be merged, replaced or removed.
Here is my solution:
httpd.conf
at "your apache folder"/conf
#LoadModule headers_module modules/mod_headers.so
#
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With