Apache forward proxy and reverse proxy for Ubuntu (proxypass \ proxypassreverse)

Source: Internet
Author: User

Apache forward proxy and reverse proxy for Ubuntu (proxypass \ proxypassreverse)

The environment is the latest version of ubuntu. The directory structure installed in apache2 has changed. Many articles on the Internet do not apply.

Preparation

If your originalProgramIf you have any problems, clear them first.

 
Apt-Get -- purge removal apache2apt-get -- purge remove apache2.2-commonapt-Get autoremoveapt-Get -- purge remove APACHE-commonapt-Get -- purge remove apachesudo find/etc-name "* Apache *" -exec Rm-RF {}/; sudo Rm-RF/var/WWW
Install
 
Apt-Get install apache2service apache2 stop

Configuration

(1)

 
A2enmod proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http

(2)
Modify sudo Vim/etc/apache2/mod-enabled/Proxy. conf

If any content is set, the settings are as follows:

<Ifmodule mod_proxy.c> # Turning proxyrequests on and allowing proxying from all may allow # spammers to use your proxy to send email. proxyrequests off <proxy *> order deny, allow deny from all # Allow from. your_domain.com </Proxy>

(3)
Modify Vim/etc/apache2/sites-enabled/Default

 
<Virtualhost *: 80> servername niuyufu.iokokok.cn serveralias niuyufu.iokok.cn proxypass/http://www.baidu.com/proxypassreverse/http://www.baidu.com/</virtualhost>

Service apache2 restart
Test it. You are now acting for Baidu !!!

Apache forward proxy and reverse proxy for Ubuntu (proxypass \ proxypassreverse)

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.