title: How to Enable CORS for Docker Apache httpd server?
body: <p>I need to create an apache server to host my files and to get them by ajax. So, I'm using docker to deploy my server. </p>
  
  <p>My docker image is httpd:2.4.</p>
  
  <p>I deployed the server with the following command :</p>
  
  <pre><code>docker run -p 80:80 -dit --name file-server \
    -v /sources/docker/apache-server/www/:/usr/local/apache2/htdocs/ httpd:2.4
  </code></pre>
  
  <p>But when I want to make the request for ajax, this is the result:</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <a href="http://server/kml/example.kml" rel="nofollow noreferrer">http://server/kml/example.kml</a>. No
    'Access-Control-Allow-Origin' header is present on the requested
    resource. Origin 'null' is therefore not allowed access.</p>
  </blockquote>
  
  <p>So, I want to follow the next steps <a href="https://stackoverflow.com/questions/32273606/how-to-enable-cors-for-apache-httpd-server-step-by-step-process">How to Enable CORS for Apache httpd server? (Step-By-Step Process)</a>. But I do not know how to add that command in the httpd.conf of the component. And I don't have the httpd.conf template to replace it with:</p>
  
  <pre><code>v /sources/docker/apache-server/my-httpd.conf:/usr/local/apache2/conf/httpd.conf
  </code></pre>
  
  <p>Please help me with this question.</p>