Saturday, December 8, 2012

redirect all web traffic to a forward proxy server through Teamviewer VPN


Install Apache and set it as a forward proxy server

Eidt httpd.conf

### You can listen to multiple ports.
Listen 80
Listen 8080

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

Edit httpd-vhosts.conf file:

### [START] add by Jun
NameVirtualHost *:80
NameVirtualHost *:8080



ProxyRequests On
ProxyVia On



    Order Deny,Allow
    Deny from All
    Allow from 127.0.0.1 192.168.178

    AuthType Basic
    AuthName "Password Required"
    AuthUserFile password.file
    AuthGroupFile group.file
    Require group usergroup



### [END] add by Jun

Create a password.file using the htpasswd.exe utility. Place it on the Apache Root directory

cmd> htpasswd.exe -c password.file username

Create a group.file using a text editor at the same level as the password.file with the following contents

usergroup: username

Install Teamviewer on both sever side and client side


1. download the latest Teamviewer (version 8.x and above).
http://www.teamviewer.com/download/TeamViewer_Setup_en.exe

2. Make sure you do enable the VPN option.

3. connect to your partner's teamviewer:
ID: 123 456 789
select "VPN" (make sure you do select this option, default is "Remote control".

Note: another way is to use "remote control" > extra tab at top bar > VPN > start.

4. a window will pop up, and you can see the partner's IP address. Copy the ip address.

5. Set up a proxy server for your browser:
go to start > run > Inetcpl.cpl > connections > LAN settings
> check "Use a proxy server for your LAN (These settings will not apply to dial-up or VPN connections)".
> Address (the partner's IP address from Teamviewer)
> Port 8080
> Click "Okay"

6. Done.


Reference:
http://stackoverflow.com/questions/724599/setting-up-an-apache-proxy-with-authentication


No comments: