0

Installing SQUID on a Synology NAS

I’m not going to go into exactly why (it’s a minor networking niggle following on from a change in broadband provider) but I wanted a simple HTTP proxy in my lab so that my lab VMs could get out on to the internet. Mostly for installing updates etc.

Since my NAS is ideally placed in my network I thought that I’d use that. It’s only a short-term thing anyway.

Now in order to get a proxy service on to the NAS, I needed to setup IPKG first. This allowed me to install and configure SQUID as follows:

1. Open an SSH session to the NAS

2. Download and install SQUID

[text]ipkg install squid[/text]

3. Perform a couple of configuration commands

[text]squid -k parse
squid -z
ln -s /opt/etc/init.d/S80squid /usr/syno/etc/rc.d/[/text]

4. SQUID can now be started using /opt/etc/init.d/S80squid start

Now there may be some additional changes you might want to make. By default SQUID will accept connections from a standard set of internal networks as follows:

[text]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[/text]

However, you may want to tie this down for one reason or another. For me, I’m not too bothered. Any changes can be done by editing /opt/etc/squid/squid.conf.

Want to check that it works? I configured the proxy config in my VM as follows:

CapturFiles-201409248_110961

And then monitored the proxy access file using tail:

[text]tail -f /opt/var/squid/logs/access.log
1409911439.044    141 192.168.100.151 TCP_MISS/200 405 HEAD http://download.windowsupdate.com/v9/windowsupdate/redir/muv4wuredir.cab? – DIRECT/80.239.217.24 application/octet-stream
1409911439.138     80 192.168.100.151 TCP_MISS/200 24017 GET http://download.windowsupdate.com/v9/windowsupdate/redir/muv4wuredir.cab? – DIRECT/80.239.217.24 application/octet-stream
1409911445.219     46 192.168.100.151 TCP_MISS/200 405 HEAD http://ds.download.windowsupdate.com/v11/3/windowsupdate/selfupdate/WSUS3/x64/Win7SP1/wsus3setup.cab? – DIRECT/213.120.161.243 application/octet-stream
1409911445.246     16 192.168.100.151 TCP_MISS/200 34418 GET http://ds.download.windowsupdate.com/v11/3/windowsupdate/selfupdate/WSUS3/x64/Win7SP1/wsus3setup.cab? – DIRECT/213.120.161.243 application/octet-stream[/text]

0

How to install IPKG on a Synology NAS

Sometimes you want to install “community” or third party packages on your Synology NAS and they require IPKG (Itsy Package Management System) to be present. Instruction about how to go about this seem to vary and are often specific for the CPU inside your NAS. The easiest method that I’ve found for getting IPKG installed is as follows…

First job is to open an SSH session to the NAS and confirm what type of processor it has. This can be done using the following command:

[text]cat /proc/cpuinfo | grep model[/text]

For my DS1513+ it returns:

[text]model: 54
model name: Intel(R) Atom(TM) CPU D2701   @ 2.13GHz
model: 54
model name: Intel(R) Atom(TM) CPU D2701   @ 2.13GHz
model: 54
model name: Intel(R) Atom(TM) CPU D2701   @ 2.13GHz
model: 54
model name: Intel(R) Atom(TM) CPU D2701   @ 2.13GHz[/text]

Next you need to dig around the site http://ipkg.nslu2-linux.org/feeds/optware/ to find the correct bootstrap for your architecture. In my case it’s at http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh.

To install it, there are a couple of steps…

1. Within your SSH session, change to a temporary location (note that you will probably need to be logged in as root to do all this)

[text]cd /tmp[/text]

2. Download the bootstrap script

[text]wget http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh[/text]

3. Make the file executable

[text] chmod +x syno-i686-bootstrap_1.2-7_i686.xsh[/text]

4. Run the script

[text]sh syno-i686-bootstrap_1.2-7_i686.xsh[/text]

5. If it all went well, remove the script

[text]rm syno-i686-bootstrap_1.2-7_i686.xsh[/text]

6. Update the package list

[text]ipkg update[/text]

Well done, you’re now ready to install custom packages via ipkg.

0

Installing Crashplan on ARM based QNAP

The downside of living in the boonies in the UK is that the broadband speeds can be a little on the rubbish side. When I moved to my current house 4 years ago, I knew I’d be giving up good internet for for something a bit lacking. I just didn’t think it would take so long to get something better going. This is yesterday’s speedtest:

CapturFiles-201408243_200808

Since a nice man from BT is due to visit tomorrow to sort me out with that “something better”, I can finally take advantage of some of the cloud offerings that really haven’t been practical until now. Foremost amongst these offerings for me is the ability to backup all of the photos and files that my family and I have created or acquired over the years. They are all stored on a 4-year old QNAP NAS.

Super! I thought that I’d slip Crashplan on to the NAS and set it to backup overnight. Give it a few weeks and the backups would be up to date. A weight off my mind.

Except that getting it all running wasn’t totally straightforward…

JRE Needed

Crashplan has been packaged as a QNAP QPKG file and is available to download from the QNAP forum here. It has a dependency on Java however and so a supported JRE must be installed and enabled before it can even be installed. There is one available for ARM based QNAPs in the AppCenter. However, after installing it I couldn’t confirm that it was running for some reason. Connecting via SSH and executing “java -version” didn’t have the desired results.

It seems that I wasn’t the only one to hit this issue. Instead of installing the package directly through the AppCenter though it is possible to download the package and then install it manually. Simply select the package in AppCenter and click the download link.

CapturFiles-201408243_210869

 

Once downloaded, use the “Install Manually” option in AppCenter and select the unzipped file you just downloaded.

CapturFiles-201409244_210997

With that done, checking the java version again yielded the desired result:

[text][~] # java -version
java version "1.8.0" Java(TM) SE Embedded Runtime Environment (build 1.8.0-b132, headless)
Java HotSpot(TM) Embedded Client VM (build 25.0-b70, mixed mode)[/text]

Wrong JRE?

With the JRE installed, I thought that this would be fairly easy. Again using “Install Manually” in the AppCenter, I gave my NAS the Crashplan QPKG. It failed.

Just in case it would give me some more information, I copied the QPKG file to a share on the NAS and tried via the command line:

[text][/share/Public] # sh ./CrashPlan_3.6.3_30_arm-x19.qpkg
Install QNAP package on TS-NAS…
./
./qinstall.sh
./qpkg.cfg
./package_routines
917+1 records in
917+1 records out
19288+1 records in
19288+1 records out
CrashPlan 3.6.3_30 installation failed. The following QPKG must be installed and enabled: JRE >= 1.6.
Installation Abort.[/text]

Hmm. But we have a JRE. What’s up? It’s tenuous, but the error message suggests that the JRE QPKG can’t be found, it’s not complaining that Java itself isn’t present.

Tenuous but true as it turns out. I did a little experimentation. There is a file on the NAS that contains details about the packages installed. It can be found at /etc/config/qpkg.conf.

I used vi to edit the file and replaced this section:

[text][JRE_ARM]
Name = JRE_ARM
Version = 8.0.1
Author = Optimus
QPKG_File = JRE_ARM.qpkg
Date = 2014-08-30
Shell = /share/MD0_DATA/.qpkg/JRE_ARM/jre.sh
Install_Path = /share/MD0_DATA/.qpkg/JRE_ARM
RC_Number = 101
Enable = TRUE
Status = complete[/text]

With the following:

[text][JRE]
Name = JRE
Version = 8.0.1
Author = Optimus
QPKG_File = JRE_ARM.qpkg
Date = 2014-08-30
Shell = /share/MD0_DATA/.qpkg/JRE_ARM/jre.sh
Install_Path = /share/MD0_DATA/.qpkg/JRE_ARM
RC_Number = 101
Enable = TRUE
Status = complete[/text]

Bazinga!

Once the AppCenter page was refreshed, “JRE_ARM” had been replaced by “JRE”. And this time, Crashplan installed correctly:

[text][/etc/config] # sh /share/Public/CrashPlan_3.6.3_30_arm-x19.qpkg
Install QNAP package on TS-NAS…
./
./qinstall.sh
./qpkg.cfg
./package_routines
917+1 records in
917+1 records out
19288+1 records in
19288+1 records out
Starting CrashPlan once to generate config files…
CrashPlan is disabled.
Forcing startup…
Cleaning /tmp/*.jna files…
Cleaning /share/MD0_DATA/.qpkg/CrashPlan/tmp/ files…
Starting CrashPlan…
Link service start/stop script: crashplan.sh
Set QPKG information in /etc/config/qpkg.conf
CrashPlan 3.6.3_30 has been installed in /share/MD0_DATA/.qpkg/CrashPlan.[/text]

 

All that remained was to set the correct IP address on my NAS for Crashplan to listen on and then I could connect and configure it via the client software on my laptop.

CapturFiles-201408242_220865The only thing now is to wait for my broadband to be upgraded tomorrow…