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)