alain12
Registered Member
- Feb 15, 2019
- 99
- 52
I am not affiliated with tinyproxy in any way.
Step 1: Find a good VPS provider that also offers extra IPs (if you intend on using multiple IPs). These are often called 'floating IPs'. At least 512MB of memory is needed. 1GB should be enough but it depends on how many simultaneous connections you'll use.
Step 2: Deploy your VPS with Debian 9. I recommend Debian 9 because it's often lighter than Ubuntu, and it's very stable, and easy to work with. Everything shown here should also work with Ubuntu, but you may run into minor issues. This guide will NOT work for CentOS, Fedora, etc.
Step 3: Attach your floating IPs if you bought any. You can always add IPs later.
Step 4: Login to your VPS with SSH (If you're on windows, you can use puTTY). The VPS provider will give you the username (probably root) and password.
Step 5: Install and Configure tinyproxy as follows:
Make sure you're logged in as root. If not, run sudo su
Update your system: apt update && apt upgrade -y
If you have less than 1GB of RAM, you can create a swap file which will be used as RAM if your system runs out. It's the Linux equivalent of the Windows pagefile. This is optional but generally good for performance:
First make sure your VPS does not already have a swap file or partition.
swapon
If this command outputs nothing, you do not have swap space. If it does, you already have swap space and should not need to create more.
Create a 1GB swapfile:
dd if=/dev/zero of=/swapfile bs=1k count=1M
Set correct permissions:
chmod 600 /swapfile
Activate it:
mkswap /swapfile
swapon /swapfile
Then save a line in your fstab, so when you reboot, your system will automatically use that swap space.
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
Install some packages: apt install -y git make automake nano build-essential
(git is for grabbing tinyproxy from github, nano is an easy-to-use text editor, the rest are for compiling the proxy software)
Download tinyproxy (the following command will always grab the most recent version):
https://github.com/tinyproxy/tinyproxy.git
Then
cd tinyproxy/
./autogen.sh
./configure
nano Makefile
Find the section that starts with "SUBDIRS = \" (it should be line 343)
And remove the line "docs \"
So the section should now look like this:
SUBDIRS = \
src \
data \
etc \
m4macros \
tests \
scripts
Then press Ctrl x then y then Enter.
(The reason for this edit is that building the documentation for tinyproxy would require downloading and installing 1GB+ of packages, and IMO a lighter system is more important than having these docs.)
make
make install
Configuration:
nano /usr/local/etc/tinyproxy/tinyproxy.conf
And make the following changes:
Group nobody > Group nogroup
Port 8888 > Port xxxx (Use something other than 8080, 8888, etc. You'll get less brute-force attacks. )
#BindSame yes > BindSame yes (this is only needed if you have multiple public IPs)
#LogFile "/usr/local/var/log/tinyproxy/tinyproxy.log" > LogFile "/var/log/tinyproxy.log" (Only if you want to save logs)
Allow 127.0.0.1 > #Allow 127.0.0.1
#BasicAuth user password > BasicAuth ChooseAUsername ChooseAPassword (Use a very strong and complex password, bots from all over the world will be constantly trying to guess it)
ViaProxyName "tinyproxy" > #ViaProxyName "tinyproxy"
#DisableViaHeader Yes > DisableViaHeader Yes (this is technically a wrong thing to do, but we don't want IG/etc. to know that we're using a proxy.)
Press Ctrl x then y then Enter to save and exit.
Your proxy server is now ready! Start it with:
tinyproxy
And to make sure it is running:
ss -lntup | grep tinyproxy
If you get no output, then it is either not running, or running but not binding to a port.
Finally, to make it run automatically after a reboot:
crontab -e
This will open a file in a text editor of your choice, simply add the following line at the end:
@reboot /usr/local/bin/tinyproxy
And done.
Step 1: Find a good VPS provider that also offers extra IPs (if you intend on using multiple IPs). These are often called 'floating IPs'. At least 512MB of memory is needed. 1GB should be enough but it depends on how many simultaneous connections you'll use.
Step 2: Deploy your VPS with Debian 9. I recommend Debian 9 because it's often lighter than Ubuntu, and it's very stable, and easy to work with. Everything shown here should also work with Ubuntu, but you may run into minor issues. This guide will NOT work for CentOS, Fedora, etc.
Step 3: Attach your floating IPs if you bought any. You can always add IPs later.
Step 4: Login to your VPS with SSH (If you're on windows, you can use puTTY). The VPS provider will give you the username (probably root) and password.
Step 5: Install and Configure tinyproxy as follows:
Make sure you're logged in as root. If not, run sudo su
Update your system: apt update && apt upgrade -y
If you have less than 1GB of RAM, you can create a swap file which will be used as RAM if your system runs out. It's the Linux equivalent of the Windows pagefile. This is optional but generally good for performance:
First make sure your VPS does not already have a swap file or partition.
swapon
If this command outputs nothing, you do not have swap space. If it does, you already have swap space and should not need to create more.
Create a 1GB swapfile:
dd if=/dev/zero of=/swapfile bs=1k count=1M
Set correct permissions:
chmod 600 /swapfile
Activate it:
mkswap /swapfile
swapon /swapfile
Then save a line in your fstab, so when you reboot, your system will automatically use that swap space.
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
Install some packages: apt install -y git make automake nano build-essential
(git is for grabbing tinyproxy from github, nano is an easy-to-use text editor, the rest are for compiling the proxy software)
Download tinyproxy (the following command will always grab the most recent version):
https://github.com/tinyproxy/tinyproxy.git
Then
cd tinyproxy/
./autogen.sh
./configure
nano Makefile
Find the section that starts with "SUBDIRS = \" (it should be line 343)
And remove the line "docs \"
So the section should now look like this:
SUBDIRS = \
src \
data \
etc \
m4macros \
tests \
scripts
Then press Ctrl x then y then Enter.
(The reason for this edit is that building the documentation for tinyproxy would require downloading and installing 1GB+ of packages, and IMO a lighter system is more important than having these docs.)
make
make install
Configuration:
nano /usr/local/etc/tinyproxy/tinyproxy.conf
And make the following changes:
Group nobody > Group nogroup
Port 8888 > Port xxxx (Use something other than 8080, 8888, etc. You'll get less brute-force attacks. )
#BindSame yes > BindSame yes (this is only needed if you have multiple public IPs)
#LogFile "/usr/local/var/log/tinyproxy/tinyproxy.log" > LogFile "/var/log/tinyproxy.log" (Only if you want to save logs)
Allow 127.0.0.1 > #Allow 127.0.0.1
#BasicAuth user password > BasicAuth ChooseAUsername ChooseAPassword (Use a very strong and complex password, bots from all over the world will be constantly trying to guess it)
ViaProxyName "tinyproxy" > #ViaProxyName "tinyproxy"
#DisableViaHeader Yes > DisableViaHeader Yes (this is technically a wrong thing to do, but we don't want IG/etc. to know that we're using a proxy.)
Press Ctrl x then y then Enter to save and exit.
Your proxy server is now ready! Start it with:
tinyproxy
And to make sure it is running:
ss -lntup | grep tinyproxy
If you get no output, then it is either not running, or running but not binding to a port.
Finally, to make it run automatically after a reboot:
crontab -e
This will open a file in a text editor of your choice, simply add the following line at the end:
@reboot /usr/local/bin/tinyproxy
And done.
Last edited by a moderator: