By default Piwik uses the provider location to guess a visitor's country based on the language they use. This is not very accurate, so they recommend installing and using GeoIP.
- Ubuntu server
- libgeoip-dev
- Nginx
- Nginx minimal website
// Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address | |
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { | |
$http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] ); | |
$_SERVER['REMOTE_ADDR'] = $http_x_headers[0]; | |
} |
.widget_woothemes_our_team .columns-2, | |
.widget_woothemes_our_team .columns-3, | |
.widget_woothemes_our_team .columns-4, | |
.widget_woothemes_our_team .columns-5, | |
.widget_woothemes_our_team .columns-6 { | |
overflow: hidden; | |
zoom: 1; | |
} | |
.widget_woothemes_our_team .columns-2 .team-member, | |
.widget_woothemes_our_team .columns-3 .team-member, |
Pre-requisite: go to http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html download http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe and http://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe
# You may add here your | |
# server { | |
# ... | |
# } | |
# statements for each of your virtual hosts to this file | |
## | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. | |
# http://wiki.nginx.org/Pitfalls |
#!/bin/bash | |
# Make sure you are up to date | |
yum -y update && yum -y install wget | |
# Install EPEL repository | |
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
# Get us a clean working directory | |
mkdir /php |
# Automatically instal the latest nginx | |
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
#Make a backup copy of your current sources.list file | |
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak | |
#Now copy the following repositories to the end of ` /etc/apt/sources.list` | |
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list | |
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list |
# block humans.txt scans | |
# http://perishablepress.com/protect-against-humans-txt-query-string-scans/ | |
<IfModule mod_rewrite.c> | |
RewriteCond %{QUERY_STRING} http\:\/\/www\.google\.com\/humans\.txt\? [NC] | |
RewriteRule .* - [F,L] | |
</IfModule> |
upstream phpfpm { | |
server unix:/var/run/php5-fpm.sock; | |
} | |
upstream hhvm { | |
server unix:/var/run/hhvm/hhvm.sock; | |
} | |
# SSL | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |