Hello Open Media Vault community,
There is a thread for suggestions on what should be made in to a plugin. In this thread I have mentioned that I think Squid Proxy is a good idea, and others agreed however asked for how I set it up so it can be converted in to a plugin.
I would say I'm average skill level in linux, and absolute novice in Open Media Vault, so please excuse my steps below if they seem a bit choppy. I'm certainly happy for your feedback.
Step 1: Gain access to your server
SSH in to your Open Media Vault server. For me, my server has a local IP of 192.168.1.8, and I'm using Linux Mint on my notebook.
Type this command in to a terminal window: ssh root@192.168.1.8
Step 2: Download the Squid Proxy software
Run the following commands;
Update your repositories: apt-get update
Install Squid: apt-get install squid3
Check Squid version: squid3 -v
Output should be long bu t start with: Squid Cache: Version 3.1.20
If it says version 2.x.x.x, then you installed the wrong package. remove squid, and install squid3 as per above.
Step 3: Configure the Squid Proxy
Open the configuration: sudo nano /etc/squid3/squid.conf
Ctrl+W to search for something.
Search for 3128 until you find: http_port 3128. Change that port to a port you can remember. I used 5555
Find this line: acl CONNECT method CONNECT
If your local area network uses 192.168.1.x (if not, change the numbers but leave the last as a zero as it's wildkey), add this below: acl mylan src 192.168.1.0/255.255.255.0
Find this line: http_access allow localhost
Add below: http_access allow mylan
Find this line: http_access deny !Safe_ports
This stops any non-standard ports from working, which is a pain in the ass. Replace it with: #http_access deny !Safe_ports
Find this line: #cache_dir ufs /var/spool/squid3 100 16 256
Remove the # at the start, then replace the '100' with how big you want your cache to be in megabytes. For example, mine is quite large at 20GB: cache_dir ufs /var/spool/squid3 20480 16 256
You can tweak the other options. For example if you go down a few lines, you're able to change what files it will cache. By default it won't cache anything larger than 4mb. I have raised mine to 64mb. I also stopped mine from caching anything below 500kb.
Ctrl+x and Y to save and exit.
Step 4: Test the Squid Proxy
Run this command to restart the server so we can read the configuration changes we made: sudo service squid3 restart
Configure a your network to use your server as a proxy. In linux mint, I did this from the network settings:
Then test your web browser by navigating to a web site. Make sure the web site does not use HTTPS. Squid Proxy cannot work with SSL as it can't intercept an encrypted connection.
If it works and the web site loads, yay! If it doesn't, post below so we can troubleshoot.
The only real way of knowing if the proxy is caching, is to read the logs. Hit means it was in your cache so it was not downloaded. Miss means it was not and Get means it was not however it will be next time as it meets the criteria of caching and has now been saved.
You can configure your squid proxy to pre-fetch web sites for even faster browsing, to block pop-ups and adverts, to scan for viruses on web sites etc.
Another handy thing is to generate reports:
http://www.tecmint.com/sarg-sq…andwidth-monitoring-tool/
Let me know what you think by giving a thumbs up on the bottom right corner if this is good.