Those settings look like they belong to an Apache 2.2 server. For your Apache 2.4 server you could instead try:
Require all granted
ProxyPass /geoserver http://127.0.0.1:8080/geoserver
ProxyPassReverse /geoserver http://127.0.0.1:8080/geoserver
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.
ProxyPass /geoserver http://localhost:8080/geoserver
ProxyPassReverse /geoserver http://localhost:8080/geoserver
ProxyPass /geoserver http://<your server ip>:8080/geoserver
ProxyPassReverse /geoserver http://<your server ip>:8080/geoserver
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:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
Answering other questions raised in the comments:
OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=..."
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).
# The Options directive is both complicated and important.
# Please see http://httpd.apache.org/docs/2.4/mod/core.html#options
#Options +FollowSymLinks +Includes
# Adding +ExecCGI allows CGI scripts to run outside of cgi-bin (and similar) script folders
Options +FollowSymLinks +Includes +ExecCGI
Require all granted
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:
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
# Enabling the below to allow python processing
AddHandler cgi-script .cgi .py
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:
fs = cgi.FieldStorage()
url = fs.getvalue('url', "http://www.openlayers.org")
For a working example of a Web page with OpenLayers using a proxy.cgi script see: