Category Archives: Linux

FIXED: Varnish Caching Proxy Expected an action, ‘if’, ‘{‘ or ‘}’

So it seems Varnish 4.0 and 4.1 (more may be affected this is the limit of my testing presently) has a bug where some whitespace can through it from recognising valid configuration such as below
# ACLs to control who can access this caching proxy server
acl local {
"127.0.0.0"/8; /* loopback range */
"192.168.1.0"/29; /* local network range 192.168.1.0-192.168.1.7 */
"10.0.0.0"/8; /* For testing on own hown network - REMOVE FOR PRODUCTION */
}

######################
# Urls to cache
# /api/3.0/artists/
# /api/3.0/venues/
#####################

sub vcl_recv {
# Happens before we check if we have this in cache already.
#
# Typically you clean up the request here, removing cookies you don’t need,
# rewriting the request, etc.

if (client.ip !~ local ) {
{error 403 “Access denied”;}
}
return (lookup);

# We only want to cache GET request
if (req.request == “GET”) {
return(hash);
}
}

 

This was due to a bad code merge cited here https://github.com/nexcess/magento-turpentine/pull/1311

You can resolve this by manually removing the whitespace by using the command below

cat default-withWhiteSpace.vcl | tr -d " \t\n\r" > default.vcl

Solution: libpam-radius-auth: Sends out 127.0.0.1 as NAS-IP-Address

Symptom

When authentication linux to radius using libpam-radius-auth: Sends out 127.0.0.1 as NAS-IP-Address

Cause

/etc/hosts file contains the local machine’s hostname with 127.0.0.1

Solution

Either remove the offending line, or before this line place the correct ip address with the hostname (note that order is important).
10.0.0.5 computerName
127.0.0.1 computerName

[FIXED] Errors were encountered while processing: /var/cache/apt/archives/vim-runtime_2%3a7.4.052-1ubuntu3_all.deb

Problem: vim install fails during dist-upgrade and running sudo apt-get -f install gives the error below
syslog:/var/syslog-ng/wcs$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
vim-runtime
The following packages will be upgraded:
vim-runtime
1 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
44 not fully installed or removed.
Need to get 0 B/4,888 kB of archives.
After this operation, 412 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 64153 files and directories currently installed.)
Preparing to unpack .../vim-runtime_2%3a7.4.052-1ubuntu3_all.deb ...
Leaving 'diversion of /usr/share/vim/vim74/doc/help.txt to /usr/share/vim/vim74/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim74/doc/tags to /usr/share/vim/vim74/doc/tags.vim-tiny by vim-runtime'
dpkg-divert: error: rename involves overwriting `/usr/share/vim/vim74/doc/tags.vim-tiny' with
different file `/usr/share/vim/vim74/doc/tags', not allowed
dpkg: error processing archive /var/cache/apt/archives/vim-runtime_2%3a7.4.052-1ubuntu3_all.deb (--unpack):
subprocess new pre-installation script returned error exit status 2
Processing /usr/share/vim/addons/doc
Errors were encountered while processing:
/var/cache/apt/archives/vim-runtime_2%3a7.4.052-1ubuntu3_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Fix

All of the issues seemed to be down to the doc folder, nuking it meant that the install completed successfully
sudo rm -fR /usr/share/vim/vim74/doc/