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.
My docker image is httpd:2.4.
I deployed the server with the following command :
docker run -p 80:80 -dit --name file-server \
-v /sources/docker/apache-server/www/:/usr/local/apache2/htdocs/ httpd:2.4
But when I want to make the request for ajax, this is the result:
XMLHttpRequest cannot load http://server/kml/example.kml. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
So, I want to follow the next steps How to Enable CORS for Apache httpd server? (Step-By-Step Process). 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:
v /sources/docker/apache-server/my-httpd.conf:/usr/local/apache2/conf/httpd.conf
Please help me with this question.