php55w-common conflicts with php-common-5.* | Php issues while installing libraries

I was trying to install mongo extension with pecl.

pecl install mongo

Continue Reading →


Drupal 7: How to save a node programmatically and add an image field from a public URL

Introduction

I have a content type, which has an image field. I want to create many of these nodes programmatically.

Continue Reading →


Drupal 7: How to implement cron tasks (hook_cron and hook_cron_queue_info) that takes much time

Problem Statement

I want certain data to be updated regularly. Cron job is the best place to have such code. The real issue is that the process might take much time that normal cron job’s timeout value exceeds.

Continue Reading →


Drupal Helpful codes for database queries

Being a drupal user from last around 5 years, I used to know small codes for drupal. These codes helps in many ways, in templating, or in writing custom automation etc.

Continue Reading →


How to take Backup from MongoDB and Restore to MongoDB

Problem Statement

In this post, we will learn how to take backup from MongoDB instance, and restore that to another MongoDB instance.

Continue Reading →


Docker image for Drupal 7, and Php extension MongoDB installed.

You have drupal 7 image from docker hub, and want to connect tomongo db via php code.

Continue Reading →


How to add alt attribute of images in all of my drupal articles or other content type

I have a custom content type, and there are around 2000 number of nodes in my website. In all the nodes, there was no alt attribute in the images. And, it was one of the major SEO disaster that I was facing.

Continue Reading →


Docker Push: How to push your docker image to your organization in hub.docker.com

Introduction

I have seen the repeated solution on docker help pages which helps to push your image to your username. Example: ``` First build the image docker build -t .

Continue Reading →


How to connect Php docker container with Mongo DB docker container

Introduction

In this post, I will show:

Continue Reading →


How to get Youtube Video Thumbnail Images

Problem

You know your youtube URL. And, you want to know its thumbnail image that you can use on your website, or somewhere. Note: Video can be any video on youtube.com website.

Continue Reading →


Youtube API in NodeJs, Usage with Example

Introduction

This post is about the usage of nodejs module: youtube-api, which is to query youtube for videos. There are options to search youtube videos, list all videos from a playlist, list all videos from a channel. Also, you can fetch descriptive details about a video.

Continue Reading →


How to use Docker for Drupal 7 Dev envirnoment

I have been using drupal 7 from a long time, and setting up a dev environment always felt bit tricky. Thanks to docker, life becomes easier now.

Continue Reading →


How to install Mongo DB Driver for Php 7.x

The simplest way to install driver for php is using pecl.

Continue Reading →


Youtube Rest API response details

Here, we give exact response from youtube apis.

Continue Reading →


Jquery validate: submitHandler not getting called

Introduction

I’m using jquery to validate my form submitted, and I’ve also defined a submitHandler function on submit of form. But, the issue is that submitHandler is not being called.

Continue Reading →


Microsoft Azure Just-In-Time access control

According to Microsoft,

Login brute forcing is one of the top ways IaaS VMs are compromised in the cloud.

Continue Reading →


Lets Encrypt SSL Error: The client lacks sufficient authorization 403 Forbidden

Problem

You might encounter below error:

Failed authorization procedure. example.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://example.com/.well-known/acme-challenge/jTcgYGTDkvxnX0ocm9NKrJyyM0rAgwwflurdfUURH_Q: "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p", www.example.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.example.com/.well-known/acme-challenge/mS8eikQcFGT3_bOgvLFw84YpzcU0YZeZiBm8TZDHR5Q: "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
IMPORTANT NOTES:
 - The following errors were reported by the server:
   Domain: example.com
   Type:   unauthorized
   Detail: Invalid response from
   http://example.com/.well-known/acme-challenge/jTcgYGTDkvxnX0ocm9NKrJyyM0rAgwwflurdfUURH_Q:
   "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
   <html><head>
   <title>403 Forbidden</title>
   </head><body>
   <h1>Forbidden</h1>

Continue Reading →


Lets-Encrypt SSL Certificate Useful Commands

Checkcertificate details and Expiry of Certificates

certbot certificates

Continue Reading →


How to renew SSL certificate from Lets-encrypt when your website is using cloudflare

Introduction

This article is for website administrator or owner who has once taken certificate from letsencrypt.org, and its the time to renew your certificate. And, you are using cloudflare CDN for your website.

Lets-Encrypt Organization

Letsencrypt.org is an organization who provides free SSL certificate to anyone. I'm a great admirer of this service. And, its popularity increased when google chrome announced that it will give an advantage to SSL enabled websites.

I will write about how to get a new SSL certificate for your website from lets-encrypt. Its an amazing service, with an easy to use utility scripts.

Problem

Letsencrypt says you should run following command:

certbot renew

It may work for most of the people. But, it will not work for people who are using cloudflare.

Following error comes out:

 

Solution

There are two solutions that I could find till now:

1. Bypass cloudflare DNS proxy

You have to disable DNS proxy from cloudflare CDN. i.e. Bypassing cloudflare. If someone opens your website, he/she can see your actual IP, OR he/she will be served from your hosting, not from cloudflare.

Cloudflare website

 

You have to do this, just for the time period in which you are running command to renew your certificate.

Warning: When you disable this setting, your users might see SSL warning on browser, and that will not be good for you.

SSL warning

 

And, run command: 

certbot renew

You are done! Do not forgot switch ON DNS proxy setting from cloudflare

 

2. Via Command line

For this, you need ssh access of your web server. 

Open terminal, and type command:

certbot certonly -d example.com -d www.example.com (put your website in place of example.com)

It will ask for putting webroot path. Write down the path of your documentRoot.

 

You're done.

Share your experiences or issues if any, I will be able to help them out.

 

Update

You should test first your commands, before requesting Lets Encrypt. Read: Test your request to Lets Encrypt

Also read: Common error

Continue Reading →


Explaining issue: response to preflight request doesn't pass access control check

Problem

Continue Reading →