I want to dispaly my layers on a server. I'am using geoserver 2.3.2 and apache 2.4
Till now i Create a proxy file in referring in this link : http://trac.osgeo.org/openlayers/browser/trunk/openlayers/examples/proxy.cgi and i Put it in cgi-bin folder. I Installed python and in the starting line of proxy.cgi i put the location of python. #!C:/Python27/python.exe -u
I found in some tutorials that i should configure the file httpd.conf and i have no idea how to configure it and where should i add this code :
" ProxyRequests Off
ProxyPreserveHost On
Order deny,allow
Allow from all
ProxyPass /geoserver //localhost:8080/geoserver
ProxyPassReverse /geoserver //localhost:8080/geoserver "
Best Answer
Those settings look like they belong to an Apache 2.2 server. For your Apache 2.4 server you could instead try:
Which are part of the configuration settings for Apache and added to the httpd.conf file.
You could try also using the server IP or localhost instead of 127.0.0.1 in the ProxyPass and ProxyPassReverse sections, i.e.
or
To test whether the proxying of GeoServer via Apache is working you should browse to:
If this page opens then the Apache web server is correctly proxying the the GeoServer server.
To help you debug any issues with the Apache configuration open a command window and try:
If you get an error "is not recognized as an internal or external command" then the Apache httpd.exe is not in your path, you will need to change to the directory that holds the httpd.exe file before running the command. The typical location for the httpd.exe file would be in the bin sub folder such as:
Check too that at the top of the httpd.conf file that you have uncommented (remove the #) the modules that handle proxying like:
Answering other questions raised in the comments:
The call to the proxy.cgi file (like below) needs to go into your JavaScript code called by the HTML page in which you create your map.
The proxy.cgi file itself doesn't need to be placed in the cgi-bin folder of the Apache server; it can go anywhere but you need to enable this by editing the following directive in the Apache httpd.conf file like below (where "C:/Apache24/htdocs" is taken to be the document root).
To enable the proxy.cgi file to be recognized as executable you need to uncomment the appropriate AddHandler section (within the <IfModule mime_module> section), like:
You need to restart Apache for the configuration changes to be enabled.
You can test that the proxy.cgi is working by browsing to it like (below), without any parameters.
The page should redirect you to the OpenLayers home page, or whatever url you have set in the proxy.cgi section:
For a working example of a Web page with OpenLayers using a proxy.cgi script see: GeoRSS Example