sudo su
apt update && apt upgrade -y
3. 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. Check your ram by running this:
free -g
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. Skip to step 4.
dd if=/dev/zero of=/swapfile bs=1k count=1M
chmod 600 /swapfile
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
apt install -y git make automake nano build-essential
apt-get install cmake asciidoc
- git is for grabbing tinyproxy from github
- nano is an easy-to-use text editor
- build-essential is for ascii support
- automake is for compliling and installing our code
- asciidoc is for making the docs. Skip if you plan to skip step 7.
git clone https://github.com/tinyproxy/tinyproxy.git
cd tinyproxy/
./autogen.sh
./configure
Sometimes autoreconf -i
works better than ./autogen.sh
. Try if you have issues with ./autogen.sh
.
Launch Nano
nano Makefile
Find the section that starts with SUBDIRS = \
(it should be line 343), remove the line docs \
So the section should now look like this:
SUBDIRS = \
src \
data \
etc \
m4macros \
tests \
scripts
Then press Ctrl + s
then Ctrl + x
to exit nano.
make
make install
nano /usr/local/etc/tinyproxy/tinyproxy.conf
Group nobody
change toGroup nogroup
BindSame yes
change toBindSame yes
(this is only needed if you have multiple public IPs)#LogFile "/usr/local/var/log/tinyproxy/tinyproxy.log"
change toLogFile "/var/log/tinyproxy.log"
(Only if you want to save logs)#Syslog On
change toSyslog On
(Only if you want to log via Syslog. Don't use withLogFile
enabled.)Allow 127.0.0.1
change to#Allow 127.0.0.1
(Using basic auth so no need to whitelist/blacklist IP addresses)#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"
(If you don't want sites knowing you're using a proxy.)#DisableViaHeader Yes
>DisableViaHeader Yes
(If you don't want sites knowing you're using a proxy.)
tinyproxy
ss -lntup | grep tinyproxy
If you get no output, then it is either not running, or running but not binding to a port.
killall tinyproxy
crontab -e
16. That will open a file in a text editor of your choice, simply add the following line at the end:
@reboot /usr/local/bin/tinyproxy
I like to use Syslog On
because it is convenient and logs to the same place across all apt-get and Git installed packages.
To see the logs when using Syslogs just enter sudo tail -n 50 -f /var/log/syslog
and adjust the number value to see more or fewer lines.