title: How to enable CORS in apache tomcat
body: <p>I am trying to consume some web services which are cross domain. When I  disable chrome's web-security it is working fine. I want it to work without this so I have tried adding cross-domain.xml and still it didnt work. When i searched more, came to know about CORS enabling in tomcat.</p>
  
  <p>from  <a href="http://www.w3.org/wiki/CORS_Enabled">http://www.w3.org/wiki/CORS_Enabled</a></p>
  
  <hr>
  
  <p>For Apache
  Apache can be configured to expose this header using mod_headers. This is enabled by default in Apache, however you may want to ensure it's enabled in your deployment by running the following command:</p>
  
  <pre><code>a2enmod headers
  </code></pre>
  
  <p>To expose the header, you can add the following line inside , , and  sections, or within an .htaccess file.</p>
  
  <pre><code>&lt;IfModule mod_headers.c&gt;
     Header set Access-Control-Allow-Origin "*"
   &lt;/IfModule&gt;
  </code></pre>
  
  <hr>
  
  <p>Can anyone please let me know where to add these configurations in TOMCAT and in <strong>which files exactly</strong>. I am using tomcat from eclipse.</p>
  
  <p>Appreciate any help.</p>