如何搭建属于自己的proxy代理

这是从BHW论坛上面看到了一个帖子关于如何搭建自己的proxy 代理,关键还是能到便宜VPS和IP。

Step # 1 : Goto LowEndBox.com or Webhostingtalk.com and find a VPS provider who has good reviews and can provide additional ips in reasonable prices (1$ per ip)

Step # 2 : Buy a Liunux VPS with 1GB RAM , 1 Core with 100Mbit or above port speed and with additional ips

Usuall prices for such VPS are 5$ per month for VPS and 10$ for 10 additional IPS

So in 15$ you get 11 total IPs (10 additional and 1 VPS IP) which you can then convert into proxies – In 15$ you are getting 11 Virgin Dedicated Proxies which you cannot purchase from most sellers

To get different IP range and subnets , purchase different smaller VPS in different locations and setup proxy server on them

Now the actual Work starts to setup proxy server

Steps to follow : Install Ubuntu 14 when you purchase VPS and then run below commands in SSH terminal (Use Putty for SSH access)

  1. apt-get update
  2. apt-get -y install fail2ban software-properties-common
  3. apt-get install nano
  4. apt-get install build-essential libevent-dev libssl-dev
  5. cd /etc
  6. wget http://3proxy.ru/0.7.1.1/3proxy-0.7.1.1.tgz
  7. tar zxvf 3proxy-0.7.1.1.tgz
  8. rm 3proxy-0.7.1.1.tgz
  9. cd 3proxy
  10. nano src/proxy.h
  11. add line – #define ANONYMOUS 1 (this makes proxy anonymous)
  12. make -f Makefile.Linux
  13. make -f Makefile.Linux install
  14. mkdir log
  15. cd cfg
  16. nano 3proxy.cfg
  17. Add ips here along with Username : Password : Port in this format : proxy -p3128 -a -iYour Ip here -eYour Ip here
  18. Edit username and password in the same file in this format : users UsernameHere:CL:passwordHere
  19. Allow your username in the same file (You will see the Allow option , just add your username there)
  20. chmod 0777 3proxy.cfg
  21. cd ../
  22. nano scripts/rc.d/proxy.sh ( enter the directory where you installed 3Proxy script! )
  23. sh scripts/rc.d/proxy.sh start
  24. nano /etc/rc.local
  25. sh /etc/3proxy/scripts/rc.d/proxy.sh start

Summary of the above commands : 

  1. Update Ubuntu
  2. Install Fail2ban
  3. Install Nano editor
  4. Install libevent and libssl
  5. Download 3Proxy script
  6. Unzip it to directory
  7. And edit the Proxy.h file through Nano and add line #define ANONYMOUS1
  8. Edit 3Proxy.cfg through Nano and add your ips along with port , username and password
  9. Then edit proxy.sh and enter where you installed 3Proxy
  10. Reboot the server and thats it !

1 – You have to add port number which you want to use your proxies on . Example format : proxy -p3128 -a -123.546.78 -123.546.78
2 – It goes Additional IPs here which you buy from VPS provider

#!/usr/local/bin/3proxy
daemon
pidfile /etc/3proxy/3proxy.pid
auth strong
nserver 8.8.8.8
nscache 65536
timeouts 1 5 30 60 180 1800 15 60
users: ***** CL: ******
allow ******
proxy -n -a -p8254 -i****** -e******(first proxy)
proxy -n -a -p8254 -i******* -e******(second proxy)

 
To assign additional IP address on ubuntu 16.04:

1)exec sudo -i
2)nano /etc/network/interfaces
3) add these lines :

iface ens3 inet static
address 2.2.2.2.(your additional IP)

4)save edits and restart server

 
I had this problem:
root@j:/etc/3proxy# sh scripts/rc.d/proxy.sh start 
Starting 3Proxy 
scripts/rc.d/proxy.sh: 14: scripts/rc.d/proxy.sh: /usr/local/etc/3proxy/bin/3proxy: not found 

I found a solution for this:

  1. apt-get update
  2. apt-get -y install fail2ban software-properties-common
  3. apt-get install nano
!/usr/local/bin/3proxy
daemon
pidfile /etc/3proxy/3proxy.pid
auth strong
nserver 8.8.8.8
nscache 65536
timeouts 1 5 30 60 180 1800 15 60
users: UsernameHere CL: asswordHere
allow UsernameHere
proxy -n -a -p8254 -i0.0.0.0  -e0.0.0.0  

change 0.0.0.0 with your server IP address you can add more too , and I guess these apply to IP6 too .