Apache Configure reverse proxy settings

Source: Internet
Author: User

1. Download and install

: http://httpd.apache.org/download.cgi
Installing Apache into a directory

Modify the Conf/http.conf file

Modify the configuration file port ( port number for your local project )

Modify configuration file Port 60 line: Listen 3000

Line 38th
Modify Apache directory and change to Apache installation path

Cases:
Define srvroot "D:/_tools/jee-oxygen/httpd-2.4.33-x64-vc11-r2/apache24"

Line No. 249
DocumentRoot "${srvroot}/htdocs"
<directory "${srvroot}/htdocs" >
Change the path to the code you want to test (the path to your own project)

Cases:
DocumentRoot "D:/gitpath/workspace/yangpuoa/src/main/webpage"
<directory "D:/gitpath/workspace/yangpuoa/src/main/webpage" >

Remove the # from the front of the next two lines
142 LoadModule Proxy_module modules/mod_proxy.so
LoadModule Proxy_http_module modules/mod_proxy_http.so
At the end add
<ifmodule mod_proxy.c>

#proxy setting
proxypass/examples/http://localhost:8080/examples/
proxypassreverse/examples/http://localhost:8080/examples/

</IfModule>

# Here is the configuration for the interface server you want to request

#API目录/examples/

#API地址 http://localhost:8080/examples/


Run cmd, go to the extracted Apache\bin directory, execute the following command

Installation Services
Httpd-k Install

Start stop Service

Httpd-krestart//restart

Httpd-k stop//Stop

--------------------------------------------------------

Reported 443 error, Avira related port
Netstat-ano | FINDSTR 443
tasklist | findstr ' PID '
taskkill/f/pid ' PID '

--------------------------------------------------

Use:

$ ("button"). Click (function () {            $.ajax ({                URL: "Http://localhost:3000/examples/1.json",                Type: "GET",                dataType: "JSON",                success:function (data) {                    console.log (data.name);                },                error:function (err) {                    Console.log (err);})        })

  Note Note Note: Here to write your local port + API directory is: http://localhost:3000/Examples/1.json ", automatic proxy to HTTP://LOCALHOST:8080/EXAMPLES/1. JSON



Apache Configure reverse proxy settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.