For a Chrome extension project, I am creating a bare-bones HTML + JavaScript page to test the REST API for Neo4j. I have Neo4j Community Edition 3.0.6 running at http://localhost:7474/
and can connect to the /browser page. I am developing on Ubuntu 16.04
When I connect from a page at localhost/
, I get the error:
XMLHttpRequest cannot load http://localhost:7474/db/data/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 401.
Error: 0(…)
I understand that I need to set up Apache2 on Ubuntu 16.04 to allow port 7474 to include an 'Access-Control-Allow-Origin' header of "*".
I have added the following lines to /etc/apache2/apache2.conf
and restarted the server, but I'm still seeing the error:
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
Header always set Access-Control-Allow-Origin "*"
What more or what else do I need to do?