Saturday, July 25, 2015

How to limit CPU Usage in Centos 6

Hello, it's been a while since my last post, today i want to share about limiting CPU Usage, this tutorial is not to important if you have VPS with high memory and fast processeor, but how about if you only have 384 MB memory and you have plenty application running in same time???, i suggest dont do that :D, but some of you maybe has limited budget or something else, i take an example if your VPS running wine, and of course running windows application on it, but your platform still Centos, dont miss understand, this tutorial is for centos, not windows family, let's say you running some autosurf program in your VPS, like hitleap, otohits, etc, it need a lot of resource of course, for a while, the apps will running with no problem, but when CPU Load is getting higher and higher, it will kill the apps by itself.

how to limit process on centos

Installation

Auto install will include Installing EPEL for Centos 6, CPULimit, and Screen.
Type below to begin auto install line by line

wget https://raw.githubusercontent.com/zaq111/bash/master/angelimus-install-cpulimit-screen.sh

angelimus-install-cpulimit-screen.sh

Done, now you already install CPULimit.

Usage

How to use cpulimit, let assume you want to run firefox, after run firefox, now we type top, to see how much firefox using CPU, see below.

top - 08:11:55 up 33 min,  3 users,  load average: 0.49, 0.20, 0.08
Tasks:  52 total,   2 running,  50 sleeping,   0 stopped,   0 zombie
Cpu(s): 65.4%us, 34.6%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    393216k total,   381648k used,    11568k free,        0k buffers
Swap:    98304k total,    13916k used,    84388k free,   259984k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1077 root      20   0  512m  85m  33m R 23.5 22.4   0:01.50 firefox
  701 root      20   0 39464  22m 4548 S  0.7  5.8   0:00.31 Xvnc
  848 root      20   0  199m  18m  13m S  0.7  4.8   0:06.75 knotify4
  875 root       9 -11 87240 3304 2636 S  0.7  0.8   0:01.75 pulseaudio

Firefox consume 23.5% and your total CPU Usage is 65.4%
Now we running cpulimit first by type like below

cpulimit -l 10 --exe=firefox

you will see "No process found" repeated all times, it's means firefox not running, just try running firefox, you will see the diffrent

CPULimit Running

[[email protected] ~]# cpulimit -l 10 --exe=firefox
No process found
No process found
No process found
Process 1223 found

See procees on "top"

top - 08:22:00 up 43 min,  4 users,  load average: 0.00, 0.03, 0.03
Tasks:  56 total,   3 running,  52 sleeping,   0 stopped,   1 zombie
Cpu(s): 44.4%us, 19.4%sy,  0.0%ni, 36.1%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    393216k total,   332660k used,    60556k free,        0k buffers
Swap:    98304k total,    14064k used,    84240k free,   257336k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1223 root      20   0  195m  25m  15m R  9.7  6.6   0:00.13 firefox
  848 root      20   0  199m  18m  13m S  2.2  4.8   0:17.95 knotify4
  875 root       9 -11 87240 3304 2636 S  0.7  0.8   0:04.13 pulseaudio
    1 root      20   0  2900 1368 1232 S  0.0  0.3   0:00.03 init
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd/93209

Now see firefox process, it's only using 9.7% - 10%, and total CPU Usage is only 44.4%

But remember, when you close your terminal that running cpulimit, your firefox process will running like before which is 23.5% and going higher, so how to make cpulimit still running on background??

Using Screen

Using screen, you can make process running on background, here some example of use

screen cpulimit -l 10 --exe=firefox

to detach screen, press Ctrl  + A D
to resume screen type screen -r
if you have more than 1 screen, type screen -list

[[email protected] ~]# screen -list
There is a screen on:
        1291.pts-2.don19        (Detached)

to resume screen in list just type screen -x 1296.pts-2.don19

That's all, just leave comment if you find some trouble with cpulimit.
Thanks for reading my tutorial, see you in next tutorial.

Saturday, July 11, 2015

How to install VestaCP on Centos 6

VestaCP is another good web control panel for VPS, it lightweight control feature with many feature, when you installing vesta, it will automatically install a few good package, so no need to install it again, such as fail2ban, vsftp, spam assassin, apache, MySQL, roundcube mail server, etc, it's quite good, installing many package with only few single lines of code in terminal.

installing vestacp on centos 6

Installing

I will provide an easy way to installing VestaCP, you can see official install instruction here or follow my way, but remember, VestaCP require you to uninstall httpd and other installed package that may cause conflict to VestaCP, i recomend you to fresh install your VPS, or if you still want to try it, follow this step below.
Once again : if you hace website hosted on your VPS, better think twice before you install VestaCP, i never installing VestaCP on server that has hosted website on it, or maybe you find more info first on the internet about problem that maybe occur while you installing VestaCP.
While you installing, there are a few confirmation that will appear, so watch it carefully and follow the instruction, on your screen.

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

chmod +x angelimus-install-vesta.sh && sh angelimus-install-vesta.sh

now you are done installing VestaCP, login into VestaCP using information that appear on your screen.

login information vestacp

Accessing VestaCP

Open your favourite browser (Firefox, Chrome, IE, etc), and type your VPS IP Address in your browser with specified port that shown on your login information on terminal. Ex : Http://5.xxx.xxx.137:8083

Now Login, and you will see like below

vestacp panel

Now you are done installing VestaCP.

In tutorial VPS Host

In this tutorial, i using VPS that provided by Contabo.com you can see the detail here


Tutorial VestaCP

I will post link in here another tutorial related VestaCP

Wednesday, July 8, 2015

Contabo.com VPS Review - 6GB Ram - SSD 500GB - 7.99EUR

New VPS has arrived, now it comes from Contabo.com, yep... that is one of the Germany pioneer, founded by Michael Herpich and Michael Bölke, they already established more than 5000 server in Germany with customer from around the world, in 2003 they establish new data center in Munich with enough room for 4000 servers, according to their history, i'm pretty sure that they can satisfied the customer with their service, no doubt about it.

Contabo provide us VPS with Plan M, the smallest plan in it's class, BUT, don't even underestimate it, small plan with HUGE specification, their VPS (M) label it with only 7.99 EUR, equipped with Intel Xeon E5-2620V3 with 2 Core running at 2.4Ghz, 6 GB RAM guarantee, wow... that's fantastic, there's more, you need high capacity with speed??? they give you 500GB SSD, so what else did you need with that price?? Let's go test this VPS.

contabo vps review

CPU model :  Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz
Number of cores : 2
CPU frequency :  2399.994 MHz
Total amount of ram : 5851 MB
Total amount of swap : 0 MB
System uptime :   14:27,
Download speed from CacheFly: 12.0MB/s
Download speed from Coloat, Atlanta GA: 10.2MB/s
Download speed from Softlayer, Dallas, TX: 10.1MB/s
Download speed from Linode, Tokyo, JP: 7.52MB/s
Download speed from i3d.net, Rotterdam, NL: 11.5MB/s
Download speed from Leaseweb, Haarlem, NL: 11.8MB/s
Download speed from Softlayer, Singapore: 6.39MB/s
Download speed from Softlayer, Seattle, WA: 5.13MB/s
Download speed from Softlayer, San Jose, CA: 9.81MB/s
Download speed from Softlayer, Washington, DC: 10.4MB/s
I/O speed :  102 MB/s

Benchmark Result (By Geekbench.com)

Geekbench Score
Single-Core Score 3141 - Multi-Core Score 6205

Angelimus Score
169.123
(Plan M Ram 6GB)

Package

M

6GB RAM Guarantee

L

14GB RAM Guarantee

XL

30GB RAM Guarantee
EUR 7.99
/ month GO!
EUR 13.99
/ month GO!
EUR 24.99
/ month GO!
24/7 Tech Support 24/7 Tech Support 24/7 Tech Support
2 Core 4 Core 6 Core
500 GB Storage SSD 1000 GB Storage SSD 2000 GB Storage SSD
6 GB RAM 14 GB RAM 30 GB RAM
Linux & Windows Linux & Windows Linux & Windows
Root Access Root Access Root Access
VNC Access VNC Access VNC Access
TUN/TAP On TUN/TAP On TUN/TAP On
1 IPv4 1 IPv4 1 IPv4
contabo vps review contabo vps review contabo vps review


Terms of service :

You can read in here (https://contabo.com/agb.html)
I'll explain only the terms that related to VPS Usage.

§ 2 Third party rights (1) (2)
At this point, it's cleary explain related your material that you will be hosted in your VPS, you can host anything whatever you like, BUT, do not host copyright files, image, music, etc without special permission from the owner.

 § 5 Limitation regarding content (2) (5)
This is the boundary or rules about VPS Content other than copyright item, with strong statement about "The provider reserves the right to immediately suspend the webpages or servers" in point (5) the provider means "Contabo Side", but in point (2) they wrote "If no other agreement has been reached, the following content is forbidden" in other word, they will permited you host script, irc, or anything outside the copyright parameter, but with special permission from provider, which is Contabo. In this case, i will not write things that you can't do in this server, but remember the point (5).

§ 11 Applicable law, place of jurisdiction
At this point, because they are stay in Germany, so you must obey the applicable regulation in Germany, i suggest you search first in the internet, what rules related to cyber crime in Germany, so you know exactly what you must do, or consult with Contabo customer service about this matter.

Contabo VPS Control Panel:

They provide control panel like other VPS Host, but i see something special in their control panel, it's very simple and easy to understand, especially for newbie, there are not much option in their control panel, you will not see option for TUN/TAP or PPP.

Why you don't see TUN/TAP and PPP?? Contabo already turn this "ON" by default, so you don't need to worry about VPN or anything that use TUN/TAP and PPP.

Okay, let's go inside the control panel, to access control panel, click on the right top "Customer Control Panel" see image below.

how to access contabo control panel

After you click, type your username and password, if you forgot, check your email that registered in Contabo at sign up process.
When you successfully login, you will see like this.


At first screen after login process, you will see greetings, news on bottom, and navigation pane on the left. I like the simplicity of their control panel, at the left pane, you will see "VPS Control", in this tab, you can start, stop, restart, and reinstall your OS.

vps control feature from contabo

See, that's it, only that option are in contabo control panel, if you have more that 1 VPS, you can manage your other VPS from "Your Service" see left pane, first option.
The minus of this control panel is, there are no statistic about your resource usage, like RAM, Storage Disk, Processor and Bandwidth usage history, but don't worry, just continue reading, you will understand where to find that missing part.

Another Feature :

This feature must be set first when you choose plan before you buy the plan

- Service and Upgrades
feature from contabo
This is some special feature worth for upgrade it
- Full Monitoring - with additional charge of 9.99 EUR /Month you can enjoy special monitoring from contabo, like monitoring your available service that running on your VPS, get SMS about your VPS, Monitor online and offline VPS, and many more.
- You can get additional IP with only 2 EUR/Month.
- This feature i think the best Upgrade, "Instant Setupwith only 29.99 EUR (One Time Payment Only) your server can be ready to use without more configuration from user, in other words, Contabo will install all necessary package that you need and configure it, so there are no conflict in your server, just let the pros do the job, after it finish, you or your user can use VPS without problems.

- Administration Panel
administration panel contabo.com
In this feature, Contabo will offer you if you want to Install Webmin and LAMP, both feature are FREE, and Contabo will configure it for you, so you don't need to install it again.
Webmin = Webmin is a free control panel for VPS, there are a lot of configuration you can do from here, rather than manual setting from terminal, it really decrease time for configure VPS, you can install package to from here, Webmin interface is not glamour or elegant, just simple, but with many option, it makes webmin can compete with other commercial control panel.
LAMP = Linux Apache MySQL PHP, Contabo also offer FREE install for that package, a most usefull package if you running VPS, Even LAMP is free, but still need time to Install and Configure it, so better let Contabo do that for us.

- VNC Access
This feature is enabled by default, you will get the login information by email when your payment is already processed and approved.

vnc access feature from contabo
This is one of Contabo VPS Feature, you can rescue your VPS when you inaccidentally damage it, or get an external attack from "unauthorized person", it use System Recovery from (http://www.sysresccd.org/) it comes with some handy tool to recover your system, or even adjust created partition using GPARTED, you can search the tutorial there.

From this Feature, you also can reinstall your OS, so what the diffrent with reinstall feature from Control Panel??? The diffrent is, if you reinstall from VPS Control Panel, you can choose many diffrent OS from the list, but if you reinstall with VNC Access, you only can reinstall OS, with previous OS that you already install before.

Speedtest.net Result

https://www.speedtest.net/result/4491387083.png

Try Installing




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

[[email protected] ~]# service squid stop
Stopping squid: ................                           [  OK  ]

squid -v | grep Squid
[[email protected] ~]# 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

[[email protected] ~]# 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

[[email protected] ~]# 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

[[email protected] ~]# 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

[[email protected] ~]# 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