Blog
How to PREVENT SPAM on your Wordpress Site
In this tutorial we will see, how to protect your WordPress blog from spam.
There are several solutions which can be completed:
1. Make sure that your WordPress script is updated to the latest stable version.
2. Install a captcha plugin. A good choice is the WordPress ReCaptcha plugin. Once activated, the plugin will prompt for the public and the private API keys. The visualized link will take you to the corresponding Google web site where you can get the API keys for free. Paste them in the corresponding fields and activate your ReCaptcha plugin for comments and users registrations.
3. WordPress comes with a many plugins, and as per we experienced with many wordpress sites, the combination of following three plugins can prevent almost 95% of SPAM:
(I) Spam Honey Pot [Spam prevention through hidden filed and prevent spam comments]
This plugin works by adding a textarea field to the comment form that's hidden using a CSS style. Since bots don't generally detect CSS like this, they proceed to fill out the field like any other field. This implies that they aren't a human (or they wouldn't even see the field with CSS hiding it) being using a browser, in which case the plugin marks the comment as spam. This seems to catch the vast majority of spam with very few false results and doesn't require contacting a third party service like most spam plugins.
Installation Steps:
- Upload spam-honeypot.php to the /wp-content/plugins/ directory
- Activate the plugin through the 'Plugins' menu in WordPress
- Be sure that your theme implements <?php do_action('comment_form'); ?> in comments.php and comments-popup.php
(II) Disable Trackbacks [Spam prevention based on IP check]
Trackback validation is done with an IP/referrer check and by checking the trackback page for your URL. The plugin has a settings page so that you may configure the plugin. It is easy include blocked trackbacks, as well allowing you to delete blocks too.
Installation Steps:
- Upload the plugin to the /wp-content/plugins/ directory
- Activate the plugin through the 'Plugins' menu in WordPress
(III) Cookies for Comments [Spam prevention based on cookie check]
This plugin adds a stylesheet or image to your blog's html source code. When a browser loads that stylesheet or image a cookie is dropped. If that user then leaves a comment the cookie is checked. If it doesn't exist the comment is marked as spam. The plugin can also check how long it took a user to enter a comment. If it's too fast it's probably a spam bot.
Installation Steps:
- Upload the plugin to the /wp-content/plugins/ directory
- Activate the plugin through the 'Plugins' menu in WordPress
- clear the cache after enabling this plugin.
Thus the Combination of these three plugins save the wordpress sites from all kind of spam activities, whether it is spam comment, a trackback or a browser cookie. It prevents almost 95% Spams in wordpress.
What Everybody Else Does When It Comes To LINK BUILDING And What You Should Do Different!
Link building is important and yes, we do not mind investing lot of time because we know it’s one of the major factors in search engine optimization. But here is one important tip that will help you spend less time on link building and yield better result. It will take you a step ahead of your competitor!
Using Nginx instead of Apache for Scalable architecture

Overview:
Both Apache and Nginx are free, open-Source, Cross platforms Web Servers.
Nginx is noted to be a good server for sites that need fast, efficient reverse proxies or fast, efficient serving of static content. It is acclaimed for having low memory usage and is recommended for sites running on a VPS.
Architecture:
Apache is a process-based server, while nginx is an event-based web server.
The main advantage of the asynchronous approach (Used by NGINX) is scalability, performance and efficiency.
In a process-based server, each simultaneous connection requires a thread which incurs significant overhead. An asynchronous server (Nginx), on the other hand, is event-driven and handles requests in a single (or at least, very few) threads.
Nginx is a non-blocking event based architecture while apache is a blocking process based architecture.
Apache Prefork Processes:
- Receive PHP request, send it to a process.
- Process receives the request and pass it to PHP.
- Receive an image request, see process is busy.
- Process finishes PHP request, returns output.
- Process gets image requests and returns the image.
Nginx Event Based Processing:
- Receive request, trigger events in a process.
- The process handles all the events and returns the output
Performance:
nginx is faster at serving static files and consumes much less memory for concurrent requests because Nginx is event-based it doesn't need to spawn new processes or threads for each request, so its memory usage is very low.
FastCGI Vs Embedding:
Apache handles the PHP part themselves, just configure apache to use PHP and start it then it will handle the PHP themselves. While in Nginx you have to spawn a number of PHP processes and tell Nginx to talk to them. This has both advantages and disadvantages.
Advantage is, In Nginx web server and PHP are completely seperate, if something changed in PHP conf, no need to restart Nginx. While disadvantag is, that you have to handle spawning and process control of PHP yourself, but now we have PHP-FPM to handle it.
Configuration Differences:
Nginx doesn't have .htaccess like Apache, effects can be simulated by using Include directives in the main nginx configuration file. And for each configuration, Nginx has to be reloaded.
In Apache for any rewrite rule, we use .htaccess , while in Nginx we can use Location directives to execute the rewrite rule
Nginx operates with multiple blocks of configuration. In nginx such a block is referred to as a context, for instance, a configuration directive placed in server context resides within a server { } block just like a directive placed in http context resides in the http { } block.
References & Helps:
http://www.wikivs.com/wiki/Apache_vs_nginx
http://blog.martinfjordvald.com/2011/02/nginx-primer-2-from-apache-to-nginx/
Install & Configure Nginx on Linux Server for running Drupal
What is NGINX?
Nginx is a free, Open-Source, High Performance HTTP Server. Unlike Apache it doesn't rely on threads to handle requests, instead it uses much more scalable architecture.
In this tutorial, we'll see, how to install and configure nginx to run with PHP-FPM, and MySQL support on Ubuntu Server.
Installation Steps
To run the Nginx with PHP-FPM and MySQL support, we have to install following packages:
Install MySQL:
# sudo apt-get install mysql-server mysql-client
Install Nginx:
# sudo apt-get install nginx
# sudo /etc/init.d/nginx start
Navigate to your browser for http://localhost and you will see a screen which shows the default welcome page for nginx, means nginx is installed and running.
Default Nginx Document Root is /usr/share/nginx/www
Install PHP5:
We can make PHP5 work in Nginx with PHP-FPM, which is FastCGI Process Manager, an alternative PHP FastCGI Implementation with some additional features useful for sites of any size.
# sudo apt-get install php5-fpm php5-cgi
# sudo apt-get install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
Configuration
Now its the time to configure Nginx:
http {
include conf/mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 128;
#log_format main '$remote_addr - $remote_user [$time_local] $request '
# '"$status" $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 20;
tcp_nodelay on;
#gzip on;
server {
listen 192.168.0.1:80; # Replace this IP and port with the right ones for your requirements
server_name example.com www.example.com; # Multiple hostnames seperated by spaces. Replace these as well.
#charset koi8-r;
#access_log logs/host.access.log main;
location = / {
root /path/to/drupal; # Again, replace this.
index index.php;
}
location / {
root /path/to/drupal;
index index.php index.html;
if (!-f $request_filename) {
rewrite ^(.*)$ /index.php?q=$1 last;
break;
}
if (!-d $request_filename) {
rewrite ^(.*)$ /index.php?q=$1 last;
break;
}
}
error_page 404 /index.php;
# serve static files directly
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {
access_log off;
expires 30d;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:8888; # By all means use a different server for the fcgi processes if you need to
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /path/to/drupal$fastcgi_script_name; # !! <--- Another path reference for you.
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
}To Enable Clen-URL in Drupal:
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last; break;
}
Tuning Nginx
Worker_Process: Make sure you use the correct amount of worker_processes in your /etc/nginx/nginx.conf. This should be equal to the amount of CPU cores in the output of "cat /proc/cpuinfo | grep processor"
vi /etc/nginx/nginx.conf
keepalive_timeout, sendfile, tcp_nopush, tcp_nodelay: Set keepalive_timeout to a sensible value like two seconds. Enable sendfile, tcp_nopush, and tcp_nodelay
vi /etc/nginx/nginx.conf
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 2;
types_hash_max_size 2048;
server_tokens off;
File Cache:
open_file_cache max=5000 inactive=20s;
open_file _ache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
Enable Gzip Compression:
gzip on;
gzip_static on;
gzip_disable "msie6";
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
gzip_buffers 16 8k;
References and Helps
http://blog.martinfjordvald.com/2011/02/nginx-primer-2-from-apache-to-nginx/
http://blog.martinfjordvald.com/2010/07/nginx-primer/
http://blog.martinfjordvald.com/2011/04/optimizing-nginx-for-high-traffic-loads/
http://klau.si/nginx-configuration-drupal
http://www.lifelinux.com/how-to-optimize-nginx-for-maximum-performance/
How to Install Blackbaud Netcommunity Single Sign On (SSO) in Drupal
Module Overview
This module will provide single sign on mechanism where in you can use Blackbaud netcommunity login as the single action of user authentication. If you have multiple platform and want to use Blackbaud netcommunity as the community as the single authentication mechanism for all the platforms, this module will provide you the option to do so.
Module Installation in Drupal
To install Blackbaud_Netcommunity_SSO in Drupal, There are few simple steps:
- Download the recommended version of the module from http://drupal.org/node/1980544
- Extract the downloaded module and remove the archived file.
- Copy this module directory to your drupal installation at /drupal-root/sites/all/modules/
- Enable this module from drupal admin (Eg:http://example.com/admin/modules)
How to Use
Before using this module, we have to provide following keys and configuration in drupal admin:
- Go to "admin/config/blackbaud". Enter the secret key provided by blackbaud netcommunity and save the configurations.
- Go to "admin/config/site". Enter the API TO get user-id provided by blackbaud netcommunity and save the configurations.
Reference
How to Install Mozilla_OpenBadges_Displayer in Drupal
Module Overview
This module has been designed to allow users on your website to display badges that they have grouped in Mozilla Backpack. If your site has users who have badges on Mozilla Backpack, you may want to provide a window to it on your website as well.
This module will create a block on user's profile 'Mozilla openbadges displayer block' to display the grouped badges from Mozilla Backpack, provided the email address of the user on the site is same as that of the Mozilla Persona account. The block displays all the groups of the logegd-in user and its badges.
There is a cache in the system which updates in every 20 minutes. New badges and groups are updated automatically on the users profile once after the cache gets updated.
To Create an account at OpenBadges.org
Navigate this URL at your browser, https://login.persona.org/signin
Sign UP with your valid Email Account. It will ask for email verification, complete the verification.
Module Installation in Drupal
To install Mozilla_OpenBadges_Displayer in drupal, steps are:
Download the recommended version of the module from http://drupal.org/node/1982172
Extract the downloaded module, it gives you a folder "mozilla_openbadges_displayer", and remove the archived file.
Copy this module directory "mozilla_openbadges_displayer" to your drupal installation at /drupal-root/sites/all/modules/
Enable this module "mozilla_openbadges_displayer" from drupal admin (Eg: http://example.com/admin/modules)
Once after enabling the module, desired block can be configured at http://example.com/admin/structure/block
References
http://drupal.org/project/mozilla_openbadges_displayer
Build an Environment for Drupal Vagrant
Overview:
Vagrant allows developers to build, manage and share virtual development environments. Vagrant uses VirtualBox for its virtual machines and you can use Puppet or Chef as a provisioning tool. The goal of Vagrant is to offer developers the ability to build and work in a consistent virtualized environment without wasting time setting up a local version of Apache, PHP and MySQL.
In this tutorial, we'll look at how to setup and run a Vagrant environment using the Vagrant Drupal project. Even though, the Vagrant project is hosted on drupal.org it is not a module. It is a combination of Chef cookbooks and a Vagrantfile.
If you want to find out more about Vagrant, check out its documentation pages.
Before you begin, make sure you have installed Vagrant. Installation is very easy just go to the download page and download the latest version. Vagrant uses VirtualBox for its virtual machines. If you haven't already, download and install VirtualBox.
How to Install Vagrant and VirtualBox:
Download vagrant from here: http://downloads.vagrantup.com/tags/v1.2.2 and Install it at your server using dpkg or yum or rpm.
To install VirtualBox for manual install, download it from here https://www.virtualbox.org/wiki/Downloads
Or you can install it by “apt-get install virtualbox” or “yum install virtualbox” (Respective to the nix flavour)
To Build An Environment of Drupal with Vagrant:
STEPS:
Go to Vagrant project page (http://drupal.org/project/vagrant) on drupal.org and download the zip or tar file and extract it somewhere onto your filesystem (Example: /Home/vagrant/vagrant-7.x/)
http://ftp.drupal.org/files/projects/vagrant-7.x-1.x-dev.tar.gz
First, we have to download a Vagrant box. Run the following command from your terminal.
$ vagrant box add base http://files.vagrantup.com/lucid32.box
Go to the Vagrant project that you just downloaded and create a public directory.
$ cd [vagrant project]
$ mkdir public
Make the ownership of downloaded ‘vagrant’ folder to www-data:www-data
The Vagrantfile is used to configure Vagrant on a per-project bases. The file can be located in the root directory of any Vagrant project.
Open up the Vagrantfile and replace:
config.vm.share_folder("v-root", "/vagrant", ".")
With:
config.vm.share_folder("public", "/vagrant/public", "./public", :owner => "www-data", :group => "www-data")
Add the line below to your host file.
33.33.33.10 drupal.vbox.local dev-site.vbox.local
Now it's time to boot up our virtual machine. Using Terminal go to the Vagrant project and run vagrant up.
$ cd [vagrant project]
$ vagrant up
Vagrant creates a default site at drupal.vbox.local. We'll use this site to test that everything is working. Go directly to http://drupal.vbox.local/install.php and install the default Drupal site. If you go tohttp://drupal.vbox.local before you install the site, you will get database errors. The Drupal code for thedrupal.vbox.local site can be found in the public folder. VirtualBox allows you to share folders between host and guest OS. Within the virtual machine, the public folder is /vagrant/public.
You can access phpMyAdmin by going to http://drupal.vbox.local/phpmyadmin/. Login with myadmin for the username and myadmin for the password.
References:
http://drupal.org/project/vagrant
http://docs-v1.vagrantup.com/v1/docs/
http://funnymonkey.com/vagrant-puppet-drupal-development
http://webwash.net/tutorials/getting-started-drupal-vagrant
How to Install Mozilla Open Badges on Linux Server
Mozilla Open Badges
Overview
It provides an open set of specifications, tools and services for generating verifiable badges that users can take with them wherever they go and use however they like. The latest open standard can be found in the new assertion specification: https://github.com/mozilla/openbadges/wiki/New-Assertion-Specification.
The assertion includes the open standard and the metadata specifications. For more information, Please check out http://openbadges.org
Installation Steps
Here are the steps to install openbadges in Ubuntu-11.10:
Get the Codebase from here: https://github.com/mozilla/openbadges/archive/development.zip
Extract the downloaded development.zip, and move into the extracted directory.
Setup a MySQL database.
Create a database and a user with full privileges on that db. For example:
mysql> CREATE DATABASE openbadges;
mysql> GRANT ALL PRIVILEGES ON openbadges.* TO badgemaker@localhost IDENTIFIED BY 'secret';
mysql> CREATE DATABASE test_openbadges;
mysql> GRANT ALL PRIVILEGES ON test_openbadges.* to badgemaker@localhost IDENTIFIED BY 'secret';
Copy the openbadges/lib/environments/local-dist.js to openbadges/lib/environments/local.js and edit the configuration
to match your local development environment. The MySQL database credentials should match step #1. For example:
database: {
driver: 'mysql',
host: '127.0.0.1',
user: 'badgemaker',
password: 'secret',
database: 'openbadges'
},
Install external tools
PhantomJS: We use PhantomJS for running unit tests. On a debian based Linux system you can run "sudo apt-get install phantomjs" and run "phantomjs --version" to check it is installed. For other systems you can try downloading and installing it or building it from source.
Install local dependencies
In the Codebase directory:
#npm install
#Install submodules: git submodule update --init
#Run the test suite: npm test
#Start your server: npm start
Quick Solutions to install Tools
Install phantomjs
# sudo apt-get update
# sudo apt-get install build-essential chrpath git-core libssl-dev libfontconfig1-dev
# git clone git://github.com/ariya/phantomjs.git
# cd phantomjs
# git checkout 1.9
# ./build.sh
Create a link for phantomjs/bin/environments/phantomjs
# ln -s phantomjs/bin/environments/phantomjs /usr/bin/phantomjs
Install nodejs version 0.8.x.
Sometimes it becomes very tidy to get its accurate version for the application. So here we have NVM to resolve this issue:
To install NVM use this script
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
OR
wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh
Usage
To download, compile, and install the latest v0.8.x release of node, do this:
# nvm install 0.8
And then in any new shell just use the installed version:
# nvm use 0.8
Or you can just run it:
# nvm run 0.8
If you want to see what versions are installed:
# nvm ls
If you want to see what versions are available to install:
# nvm ls-remote
To restore your PATH, you can deactivate it.
# nvm deactivate
To set a default Node version to be used in any new shell, use the alias 'default':
# nvm alias default 0.8
Optional: A real hostname
I like to be able to use http://openbadges.local for accessing the project. Assuming you used vagrant, you can change the hostname inlocal.js and do sudo echo "33.33.33.11 openbadges.local" >> /etc/hosts to make it happen.
Database Migrations
If you need to modify the database schema, you'll want to create a migration. You can do this as follows:
Come up with an alphanumeric name for your migration, e.g. add-issuer-column.
Run ./bin/db-migrate create add-issuer-column. This will create a new JS file prefixed with a timestamp in the migrations directory. Something like the following should be displayed: [INFO] Created migration at migrations/20130213205310-add-issuer-column.js
Edit the new JS file as per the node-db-migrate instructions.
Try out your migration using ./bin/db-migrate up.
Try rolling back your migration using ./bin/db-migrate down.
And finally, note that during development, npm start automatically runs ./bin/db-migrate up for you. For production use, you'll need to manually run this command yourself whenever you deploy changes that involve a schema change.
If you want to write tests for your migration, check out test/migration.test.js for inspiration.
Production
The codebase behaves slightly differently when run in an environment where environment variable NODE_ENV=production. These differences include:
less verbose logging using precompiled templates for client-side rendering run bin/template-precompile to generate "Test Site" banner will not show in the UI
References and Help:
https://github.com/mozilla/openbadges
http://en.wikipedia.org/wiki/Nodejs
http://phantomjs.org/build.html
https://github.com/creationix/nvm
Top 10 Reasons to choose Drupal for your Non Profit Site
1. Open for all
Drupal is an open source CMS with millions of programmers contributing to each new module and release. The Drupal Community is a pool of talent, all you need is to just dive in and you are bound to come out with an excellent Drupal website for your NPO. The talented programmers of the community will give you all the assistance in web designing and development needs.
2. Its free – This drop doesn’t cost a penny!
Even water may cost you money but getting this drop won’t cost you a penny. Drupal is all free for you to download and use. However, you may require developers to customize your drupal website with your unique requirements, write and use contributed modules, maintain your Drupal website to keep it free from bugs. All this may cost you money but Drupal is free! It has no licensing fees and results in significant savings when compared to equally equipped proprietary CMS.
3. You don’t need to be a coder to use it!
Drupal is very easy to use. You don’t need to write codes to develop your website on Drupal. It is free from coding as long as you don’t want complex and customized features for your website. Drupal solutions allow a single individual to point and click through highly intuitive menus. This makes Drupal easy to maintain and update.
4. Security will never be an issue
With Drupal, NPO’s can manage and organize their own data without ever worrying about security issues. Drupal even allows you to solicit feedback from users offering newsletter sign-ups, analyzing visitor traffic, by generating online surveys,etc.
5. Goes well with Search Engines
Drupal is out of the box search engine friendly and you can do a lot more with Drupal’s SEO modules. It is always a challenge for the NPOs to be found online. With Drupal and its modules you get the complete SEO that assures you will be indexed in search engines.
6. Provides easy integration with Social Media
You want to reach mass audience then you need to build a massive presence on social media – be it pinning on pinterest, tweeting about your latest upcoming, spreading the word on Facebook or reaching out with Google Plus, Drupal has core suits of tool to meet all your needs. Drupal has contributed modules for all major social media sites that allows your non-profit website to have all the social media interactive platform.
7. Helps you in reaching your smartphone users.
Knowing the fact that almost 40% of the users browse internet from their mobile phones, having mobile presence is a must for your not for profit website. Drupal is smart phone friendly right out of the box, giving your website immediate compatibility with the latest mobile devices.
8. Scale your website with your NPO’s growth
Scaling is never an issue with Drupal. As you grow your NPO Drupal helps in growing your website.
9. Extend with your NPO’s exapnasion
With an array of modules available for Drupal, you can always extend your website to incorporate new features as your organization’s expansion may demand.
10. Reliable!
Given that some of the largest non profit use Drupal. It is a reliable CMS for your not for profit website.
Non Profit organizations using Drupal:
http://www.entrepreneurshipinstitute.ch
Top 10 Reasons to choose Drupal for your E-commerce site.
1. Drupal is open source
Drupal is open source and saves you from expensive license fees. It powers the web presences of hundreds of thousands of businesses, governments, universities, and others around the world. Developing code for Drupal now means writing code that could be used on any of those sites.
2. Drupal development is rapid
Developing Drupal sites is really fast – Thanks to vast number of modules available!
The off-the-shelf modules not only offer shorter development time, but also higher security and less time spent on finding bugs and updating code.
3. Drupal is flexible
Drupal is very flexible and fairly easy to extend with a rapidly growing global community of contributors keeping Drupal's modules and extensions on the cutting edge of web development and the latest in social media connections.
4. Drupal is secure
Security experts from the world's governments and largest companies regularly scrutinize Drupal's codebase for themselves and have judged it secure enough for their mission-critical applications.
5. Drupal is scalable
Drupal can grow with you. It has that ability to scale hand in hand with your business. No matter how big you get Drupal gets there with you!
6. Drupal is extensible
With the modules available you can add almost any features you require for your e-commerce site. There are forums, slideshows, blogs, event calendars, e-commerce stores, picture and video galleries and surveys you can get up and running on your site in minutes with intuitive tested modules.
7. Drupal has a great community
The Drupal community is one of the best software communities around. All your queries get answered by the drupal developers spread all across the globe. You are assured to receive response in an hour two. If that’s not fast enough you can jump on IRC chat to get an answer right away.
8. Ubercart
This is a full fledged e-commerce system designed to "just work" out of the box. It offers the standard shopping cart features, integration with several payment and shipping quote services, and the ability to automate your order workflow without writing any code.
9. Get customized theme for your e-commerce site
Drupal's theme layer is incredibly good at letting you create custom templates and CSS to target specific pieces of your Drupal site. Several Drupal theme shops create themes specifically targeting e-commerce on Drupal using Ubercart. Top Notch Themes has also contributed a free theme targeting Ubercart sites called Acquia Prosper and distributes a free e-book with tips for configuring themes and contributed modules to enhance your store and increase conversions.
10. It is being used by some of the big names.
Drupal is well proven and is being used by numerous companies and organizations, such as Sony BMG, Sony Ericsson, United Nations, Disney, Nokia, Sun and the US government.

