Blog

Insights on our Drupal experiences.

knackforge blog

Apache RewriteMap with MySQL

Apache rewritemap is a wonderful addon for Apache that can directly connect to a datastore and pull data dynamically. So you don’t have to depend on a scripting language (like PHP, Python) to do the rewriting/redirect for you.
Our use case was to setup “Reverse proxy” to redirect request into different sub domains based on a input URI’s parameter value. Our sub domain data are stored in MySQL tables. This is what we have done to do that,

Continue reading →
knackforge blog

Drupal form's #tree option

There may be a need to name the form elements in an array structure how the form is built. You can see this in Ubercart checkout pane form's input elements. This is very useful when one has a large multi-part form which can be grouped easily by their POST content's array format.

Eg: panes[delivery][delivery_first_name]

A simple flag on you $form construct array will do the trick. It's the #tree option. For whichever elements you set this #tree option, the element's children will be named with full reference to its parents.

Continue reading →
knackforge blog

How to install and configure Zabbix 3 on Debian 8 (Jessie)

Zabbix is enterprise open source monitoring software for networks and applications. It is designed to monitor and track the status of various network services, servers, and other network hardware. The zabbix server can check standard networking services like HTTP, FTP, SMTP, IMAP etc. We need to install and configure a Zabbix agent  for gathering data about CPU, disks, internal system process, RAM, etc.

Lets check the steps for installing and configuring Zabbix on a Debian 8 server:

Step 1: Install required dependencies:

Continue reading →
knackforge blog

Drupal Commerce - PayPal payment was successful but order not completed

Most of us use PayPal as a payment gateway for our eCommerce sites. Zero upfront, No maintenance fee, API availability and documentation makes anyone easy to get started. At times online references offer out-dated documentation or doesn't apply to us due to account type (Business / Individual), Country of the account holder, etc. We had this tough time when we wanted to set up Auto return to Drupal website.

Continue reading →
knackforge blog

How to create Queue woker in Drupal 8

The queue API allows placing items in a queue and processing them later. If you have a task that must be done regularly and it takes more time to complete then Cron queue might be the better solution. 

In Drupal 8, hook_cron_queue_info() has been replaced by QueueWorker Plugin. Define the queue worker by creating QueueWorker folder inside Plugin folder. In the below example, I create a form for sending the email. Emails will be added to the queue on submitting the form. On cron run emails will be dequeued.  

src/Plugin/QueueWorker:

Continue reading →
knackforge blog

Restoring removed files (rm -rf) in Linux with TestDisk

There are odd times where we would have accidentally deleted some important folders without having any actual backup. It happened to us, one of our team members on the way to remove a symbolic link, accidentally deleted a webfolder using rm -rf, though we normally maintain GIT repo, for this temporary project, we did not. So we had to restore it though initially it looked gloomy. I stumbled upon "extundelete" but that could not restore any important files. Then we tried http://www.cgsecurity.org/wiki/TestDisk. See more details below

Continue reading →
knackforge blog

How to make Apache solr search programmatically from Drupal 7

Recently I came across a situation where I needed to make Apache solr search from drupal programmatically. Basically we have Apache solr module available in drupal, which enables to connect with solr for searching. There are loads of documentation for setting solr search with drupal, so instead going into those details, lets head straight to the custom code required to make programmatic solr search from drupal:

Continue reading →
knackforge blog

How we managed to use Tripwire for detecting intrusions

We all should be aware that security is very important for our servers. Having informed about the changes to server file system is always important, as unauthorised access could very well breach security. Here comes our saviour Open Source Tripwire, which is a free security and data integrity tool useful for monitoring and alerting on specific file change(s) on a range of systems. 

Open Source Tripwire functions as a host-based intrusion detection system. It detects changes to file system objects and alerts the server administrator.

Continue reading →
SOLR 5 reading indexed data at a lightening speed

This blog is about reading SOLR data by directly accessing the Lucene index folder, if you are looking for normal query method, you should look at a different SOLR tutorial. This blog deals with little low-level details.

selvam Mon, 07/11/2016 - 13:27
knackforge blog

Review of Drupal professional themes

DropThemes.in is one among the best Drupal professional theme selling sites. With decades of free theme and quality of paid themes, DropThemes.in has got its own place in the list professional theme selling sites. All our themes are Responsive and catered specifically for Drupal sites. A good theme gives your website a distinct feel that sends out a positive impression to your visitors. In this post, we would like to review the top themes on DropThemes.in to help you select the best.

Continue reading →