Showing posts with label Proxy. Show all posts
Showing posts with label Proxy. Show all posts

Saturday, July 4, 2015

Tutorial Proxy Load Balancing with Proxifier

Hello again, now i want to show how to use proxy with load balancing using proxifier, what is that mean? it's mean that you can use multiple proxy at the same time to browsing on website or do something that have connection to the internet.
With load balancing, it will prevent overload on some proxy too, take some example, you load 10 website at the same time, if you only use 1 proxy, it will slowing your website to open because proxy have to request to many connection at the same time, but if you use 5-10 proxy, it will boost your request to server.

tutorial load balancing proxy using proxifier

What you need is Proxyfier and working proxy or socks5, here is the link to download

Proxifier : https://www.proxifier.com/distr/ProxifierSetup.exe (shareware, trial 31 Days, for windows only)
Working Proxy : http://angelimus.com/dailyproxy (Update proxy every minute)

After you download proxifier, install it, and open it, you will see like this :

proxifier
1. This is for add proxy to use
2. This is to add rules

Click on Profile >> Click Advanced >> Http Proxy Servers...

enable http proxy servers support on proxifier
tick on Enable HTTP proxy servers support, then click OK

Now we will add 2 proxy to use, click on add proxy icon 

naming your type

Click on create and give it names for type, ex : angelimus load balancing
And then click on type, select LOAD BALANCING, see pic below


if you done, press ok.
Now, you already create load balancing for your proxy, now click on add (number 1, pic below)

add proxy to used in proxifier

add proxy and check proxy if works
1. Type Proxy address and port here
2. Click on type of proxy, usually HTTP or HTTPS or SOCKS5 if you using socks5
3. Click on check
4. Click start testing, wait a while, to check if proxy is alive or not blocked in your country
5. If you see this, it means the proxy can be used.
6. Click OK, then Click OK again.

Now, you have 1 proxy to used, add more proxy using same step.
After that, you will see like below


Click on the IP address, Hold it and Drag it, release in text Angelimus Load Balancing, do this to all your IP in the list, see image above.
After that, click OK.
Now, we create rules for our load balancing. Click on proxifier rules

add rules for proxifier

Add Name : <type name you like, ex : test_firefox>
Application : <this is coloumn for application name>
Action : Choose Chain Angelimus Load Balancing, or the name you create before in load balancing.
There are a few option in Actions
1. Direct = The apllication listed in application box will NOT Using Proxifier, but using direct connection through the internet.
2. Block = The apllication listed in application box will NOT Using Proxifier, and NOT using your internet connection through the internet
3. Proxy xxx.xxx.xxx.xxx:xxxx = The apllication listed in application box will use only Proxy That you specified
4. Chain Angelimus Load Balancing = The apllication listed in application box will using Proxifier with Load Balancing capability.

After that, click ok, and try open Firefox and browse, you will see the Proxifier running.
In this tutorial i only give 1 example to Firefox for using Load Balancing.

Friday, July 3, 2015

How to install Squid Proxy 3.5.5 on Centos 6.6 64Bit

Hello, now we are going to install Squid 3.5.5-1 Release May 29, 2015. Before we continue, in previous i have explain in detail how to install squid proxy on Centos 6, it works on 64bit and 32bit architecture (http://www.angelimus.com/2015/07/how-to-create-elite-proxy.html).
But now i only try in Centos 6.6 with 64Bit architecture with VPS from Evoburst.com.


Case : I have run VPS With Centos 6.6 64Bit with Squid Proxy Server 3.5.0.4, and i want to upgrade it to Squid Proxy Server 3.5.5-1.

Step 1 - Installing Squid Proxy Server 3.5.0.4 
Lazy Mode Method = Install Repository, Install Squid 3.5.0.4, Configure Elite Proxy.

Now, we must add repository first, because old repository only serve Squid 3.1.10, i have create lazy mode, just type :

wget https://raw.githubusercontent.com/zaq111/bash/master/angelimus-install-squid-355.sh 

chmod +x angelimus-install-squid-355.sh && sh angelimus-install-squid-355.sh

It's done, you have Elite Squid Proxy 3.5.0.4 installed on your VPS, now let's we costumize our squid.conf a little bit, type :

vi /etc/squid/squid.conf 

Scroll down and find similar like below (i only show how to make public proxy, you can change below configuration into personal or authenthicated system, see previous tutorial about installing proxy at step 2 (How to Install Elite Proxy on Centos 6)

# And finally deny all other access to this proxy
http_access deny all

change http_access deny all into http_access allow all

Scroll down again and find

# Squid normally listens to port 3128
http_port 3128

change http_port 3128 into http_port 5678

save it by type :wq and type :

service squid restart

Now you are done, you have running squid, try it on your web browser.
Until this step you already done install squid 3.5.0.4, if you don't want to continue to next step, it's ok, you still can use your squid 3.5.0.4.

test proxy using firefox
change ip address with your VPS IP Address

Step 2 - Installing Squid Proxy Server
Manual Method = Upgrade Squid 3.5.0.4 to Squid 3.5.5-1.

Maybe there are a big question in your head, why not just install squid 3.5.5 rather than installing squid 3.5.0.4, well, i don't have a specific answer for that question, what i know is, if you start installing 3.5.0.4, it will not installed, because there are no dependancies, but maybe someone else know how to install 3.5.5-1 without install 3.5.0.4 first, i'm curious too :P

Ok, let's start. Just type :

service squid stop

[root@centos6 ~]# service squid stop
Stopping squid: ................                           [  OK  ]

squid -v | grep Squid
[root@centos6 ~]# squid -v | grep Squid
Squid Cache: Version 3.5.0.4

rpm -Uvh http://www1.ngtech.co.il/repo/centos/6/x86_64/squid-3.5.5-1.el6.x86_64.rpm

Preparing...                ########################################### [100%]
   1:squid                  ########################################### [100%]
squid.conf.documented is at /usr/share/squid-3.5.5/squid.conf.documented

It's done, now check your version again.

squid -v | grep Squid

[root@centos6 ~]# squid -v | grep Squid
Squid Cache: Version 3.5.5

Let's check our configuration, is it still same?

vi /etc/squid/squid.conf

In my VPS, there are NO CHANGES at all, it's upgraded succesfully.
Now let's start squid

service squid start

[root@centos6 ~]# service squid start
Starting squid: .                                          [  OK  ]

Let's try open angelimus.com


elite proxy
proxy not detected
checking elite proxy using gather proxy 8.5


It's done, if you have some problem, please check my previous tutorial (How to Install Elite Proxy on Centos 6
Thanks, and see you in next tutorial.

How to install Squid on Centos 6.6 as an elite proxy

Hello again, now i want to share about squid proxy, before we start let's knowing squid by definition first, Squid is a caching and forwarding web proxy. It has a wide variety of uses, from speeding up a web server by caching repeated requests; to caching web, DNS and other computer network lookups for a group of people sharing network resources; to aiding security by filtering traffic
wikipedia.com

Install squid as elite proxy on centos 6.6

Yesterday "someone" has email me about my instalation method, which is using auto install, he suggest to provide 2 installation method, first is using auto install or "lazy mode" and the second is manual install line by line.

But because squid installation no needed auto installation, because many custumize option depend on user necessary, so lazy mode will not provided this time. Let's start

Step 1 - Installing Squid (as a base and must do)


yum -y install squid

when it's done, type below

vi /etc/ squid/squid.conf

This is the master configuration file for squid, you can costumized squid here, but for minimum requirement of squid, the default setting is work, it's what everybody said, including my friend.
I can't get squid start for first time even squid is running

[root@centos6 ~]# service squid start
Starting squid: ................                           [  OK  ]

But when i check using proxyfier this what i got, if you don't know what is proxifier, click this link (http://www.angelimus.com/2015/07/proxy-load-balancing.html)

squid started but cant connect to internet

For information, i'm using VPS from Evoburst.com with centos 6.6 64Bit. By default, squid proxy run in port 3128.
So if we see error information above picture, it says

Could not connect to 104.xxx.xxx.19:3128

My guess is there are something wrong with port 3128, now try change the port by editing /etc/squid/squid.conf

vi /etc/squid/squid.conf

and find http_port 3128 and change it to http_port 5678
now let's save it by press ESC on keyboard and type :wq

service squid restart

let's go to proxifier again and check it.

squid connected but no internet

Now we are allowed to use the port, but still not pass, through the internet. If we try using browser, using this port, it will show like this

squid access denied

That's good, why i said it's good? it because squid has been detected, and we can know for sure our squid is running.
Picture above means there are something wrong in /etc/squid/squid.conf actually its not wrong but we need a little costumize in our configuration. Now open your squid.conf by type :

vi /etc/squid/squid.conf

let see at the top of your file you will see similar like below (i will copy paste it and explain it)

#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines

What is acl? acl is Access List, so all user that want to use squid proxy must be listed here.
We take example at Line 11, see below

acl localnet src 10.0.0.0/8
-- it read like this, Access List with group localnet with source 10.0.0.0/8

Still confuse? i bet you will, don't worry.
1. 10.0.0.0/8 This is CIDR (Classless Inter-Domain Routing) Identification, it present ip address within range 10.0.0.0 - 10.255.255.255
2. Localnet this is group identifier, so we can allow which group can use proxy using rule.

So, from above acl we see :
10.0.0.0/8 Range = 10.0.0.0 - 10.255.255.255
172.16.0.0/12 Range = 172.16.0.0 - 172.31.255.255
192.168.0.0/16 Range = 192.168.0.0 - 192.168.255.255

Scrool down your squid.conf you will find like this :

# And finally deny all other access to this proxy
http_access deny all

it will deny access to proxy server if you ip is other than listed above by, since my ip is 104.xxx.xxx.19, it will not allowed.

In step 2, Choose between 2.1 or 2.2 or 2.3 depend on your necessary.
Step 2.1 - How to Allowed All IP to using Proxy Server, make it Public
So, if you want to allow all user ip address in the world to use your proxy server, edit your squid-conf, and find :

http_access deny all 

change it to http_access allow all

save it, and restart your squid by type

service squid restart

Now squid allready connected and running, it accept all ip address without limitation.

check squid using proxifier

Step 2.- How to Make squid Personally (Private Use Only)
Edit your squid.conf and add below

acl angelimus src 104.xxx.xxx.19/32

Scroll down, find like below

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

and type http_access allow angelimus

and make sure it block all ip other than listed, by find

# And finally deny all other access to this proxy
http_access deny all

make sure it is http_access deny all

save squid.conf and restart squid

Step 2.- How make squid public with user authenticated system
This step will explain how to create public squid proxy with user authentication system, so user who want to use proxy must be registered first in order to use proxy service.

authenticated system using squid ncsa_auth

So before user using proxy, it required authentication, see above image.
Let's start with editing your squid.conf (/etc/squid/squid.conf)
goto at very top of file and copy paste below code :

auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/passwd
auth_param basic children 2
auth_param basic realm Angelimus Proxy Server
auth_param basic credentialsttl 24 hours
auth_param basic casesensitive off
acl proxusers proxy_auth REQUIRED
http_access deny !proxusers
http_access allow proxusers

for centos 6 64Bit auth_param basic program /usr/lib64/squid/ncsa_auth
for centos 6 32Bit auth_param basic program /usr/lib/squid/ncsa_auth

save squid.conf
Now we will create user and password file for squid

touch /etc/squid/passwd

set file owner to squid

chown root.squid /etc/squid/passwd

set permission for file

chmod 640 /etc/squid/passwd

Now lets create user for squid with name user001


htpasswd /etc/squid/passwd user001

[root@centos6 ~]# htpasswd /etc/squid/passwd user001
New password: <password is not visible, after type password, press enter>
Re-type new password: <retype password>
Adding password for user user001

now restart squid by type

service squid restart

It's done, try open Mozilla Firefox, set the proxy, and try open http://www.angelimus.com

proxy configuration for firefox

Now, try open any website, it will show login before you access it.

Step 3 - Create Elite Proxy
Now lets create elite proxy, open your squid.conf, and add below code at the bottom of file.

tcp_outgoing_address 104.xxx.xxx.19 all
104.xxx.xxx.19 >> replace it with your server ip

forwarded_for off
request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access WWW-Authenticate allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access Proxy-Connection allow all
request_header_access User-Agent allow all
request_header_access Cookie allow all
request_header_access All deny all

NOTE : It's occur to Step 1, Step 2, and Step 3 above.. IMPORTANT!!!
if you can't connect to https, like facebook.com or whatismyip.com or google.com, or another site, do this step :
1. Edit your squid.conf (vi /etc/squid/squid.conf)
2. Find acl SSL_ports port 443, add below that code >> acl SSL_ports port 80

so it will look like this (see below)
acl SSL_ports port 443
acl SSL_ports port 80
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https

Save and restart squid.
Now you already have personal proxy server with ELITE PROXY.
Try go to angelimus.com and see what is your ip? It will change into your VPS IP address.

checking proxy using gather proxy 8.5 Free edition
Test my proxy using Gather Proxy 8.5 Free Edition