web analytics

mysqldump: Got error: 1449: The user specified as a definer (‘user’@’%’) does not exist when using LOCK TABLES

I came across this error while taking the database dump of a database. The database was originally created in another server and transferred to my server after long. When I tried to take a database dump as a part of my backup script, I came across this error.

mysqldump: Got error: 1449: The user specified as a definer (‘edulanche’@’%’) does not exist when using LOCK TABLES

Basically this error is caused by a definer which was created in the previous server but is not present in the new server. The easiest way to get past this error is to go to the original dump file and search for ‘definer’ in it.

/*!50013 DEFINER=`user`@`%` SQL SECURITY DEFINER */

If found, modify it to reflect the root user or database user in your new server.

/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINE...

Read More

Securing Solr Admin Console

The solr admin console, by default, is not secured or password protected. Anyone with the link can access all the details in the console. This post describes the steps required to secure the console. The post assumes that you followed the steps in the following two posts to

  1. Install Java and Jetty in the server
  2. Install Solr in the server

Our jetty installation is at /opt/jetty which is our java web server. Our solr installation is at /opt/solr which is our search platform.

We need to modify the following three files in order to secure the admin console.

  1. /opt/jetty/etc/jetty.xml
  2. /opt/jetty/etc/webdefault.xml
  3. /opt/jetty/etc/realm.properties

If you are not sure which files are to be edited, run the following command in the server and check for java_home variable...

Read More

Install solr with jetty in Ubuntu

Solr is a search platform which is built on Apache Lucene. It makes search easier and faster. Solr can be installed along with tomcat or jetty. This post explains the installation based on jetty.

First you should install java and jetty as mentioned in the link here.

We will install solr also in /opt. First download the latest version of solr from https://archive.apache.org/dist/lucene/solr/

I am going to download version 4.10.4. Once downloaded, uncompress it and copy the war file from dist directory to jetty webapps folder.

[root@test ~]#cd /opt

[root@test ~]# wget https://archive.apache.org/dist/lucene/solr/4.10.4/solr-4.10.4.tgz

[root@test ~]# tar -xzvf solr-4.10.4.tgz

[root@test ~]#cp  solr-4.10.4/dist/solr-4.10.4.war   /opt/jetty/webapps/solr.war

Now, a few more files need to be ...

Read More

Installing Jetty in Ubuntu 14.04

Jetty is a java web server like tomcat, and java servlet container. This post describes how to install the latest version of Jetty in Ubuntu.

Latest version of Jetty can be downloaded from http://download.eclipse.org/jetty/stable-9/dist/

Jetty requires java and hence the first step is to install java. The latest version of Jetty, as of this writing is Jetty 9.3.8. Check the link here which shows what version of Java is required for the version of Jetty you are installing. If the version of Java does not match the version in which Jetty is compiled, then it will result in version conflict and Jetty will fail to start.

I am going to install Jetty 9.3.8, hence I need JVM 1.8. Login to your ubuntu machine and switch to root. Then issue the following commands to install java in the server.

[ro...

Read More

Addon Domain

In this post we will explain how to create Addon Domains.

What is an Addon Domain?

The feature named Addon Domains in cPanel lets you create additional domains, which acts independently and have its own separate web pages, its own email accounts, its own FTP accounts etc – all in all a fully unique domain. Isn’t that interesting? Let’s follow the steps below to create an addon domain in cpanel.

  1. Login to your cpanel with your login details. The details will be present in the welcome email we sent you, when you signed up with us.
  2. If you receive any warnings that says “Your connection is not private”, do not panic, your data and all details are safe. Just click Advanced -> Add Exceptions and continue to the site. Provide your details at the login prompt and login.
  3. In your cPanel interface sc...
Read More

CSF on SolusVM Node

One of my clients wanted to secure their slave nodes with a firewall, and asked to install CSF on the servers. We setup a new slave node and installed CSF and everything was working fine. Created a new VPS, and noticed that the VPS IP Address is not responding. There was no ping to the VPS IP Address from outside. Logged into the server via console and the IP Address was up in the server. However there was no inbound and outbound network connections.


[root@vps ~]# ping google.com

Thinking it could be a resolver problem, I switched the resolver entries to use google DNS as follows.


[root@vps ~]# vi /etc/resolv.conf

Enter the following

nameserver 8.8.8.8
nameserver 8.8.4.4

Save and quit the file. Tried to ping google.com again from the server and it timed out again...

Read More

Solusvm Access Denied !

I was working on my client’s solusvm admin panel that I got kicked out suddenly. I started getting the following message, whatever way I tried to access the admin control panel.


Access Denied! Contact the system administrator for support

I tried various ways to gain access, but nothing worked. The following trick helped me.

I logged in to the server as root via ssh and whitelisted my IP Address.


[root@abc ~]# cd /usr/local/solusvm/tmp/
[root@abc ~]# touch fixwhitelist
[root@abc ~]# chown solusvm.solusvm fixwhitelist
[root@abc ~]# vi fixwhitelist

Then enter your IP Address in that file, save and restart solusvm.

[root@abc ~]# /etc/rc.d/init.d/solusvm restart
Stopping solusvm: [ OK ]
Starting solusvm: [...

Read More

Partitioning a new hard disk with parted

Fdisk is undoubtedly the most favorite disk partitioning tool for most linux savy peope. However fdisk has limitations when it comes to disk with space more than 2T. Redhat recommends parted now, starting from RHEL6. fdisk doesnt understand GUID partition table (GPT) and it is not suited for disk bigger than 2T. You will have to use a more advanced tool “parted” for that.

Let us see how a new 3T disk can be partitioned using parted command. I will be showing just 1 partition here, taking up all space rest can be done the same way. Normally, the disk will be labelled msdos, and you need to label it as GPT.

The list command will show you the current disks and their details.

[root@abc ~]# parted –list
Model: ATA ST33000650NS (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B...

Read More

Hetzner server with > 2TB disk

Recently I ordered a Hetzner server for one of our clients. The server had two 3TB disks. Hetzner provides a command line installation of the desired OS once we login to their server. As such, I logged in to the server and installed Centos6 by executing “installimage” option as suggested by Hetzner.

After installing OS and rebooting the server, I noticed that the 3T disk is not showing full space.

[root@abc ~]#df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        99G  2.5G   91G   3% /
tmpfs           463M     0  463M   0% /dev/shm
/dev/sda2       976M  126M  800M  14% /boot

/dev/sda4   2.3T     123M   2.2T  1% /home

If the disk size is greater than 2T you cannot use normal fdisk to create partition...

Read More

Fatal error: Class ‘Net_SMTP’ not found in /usr/local/lib/php/Mail/smtp.php on line 349″

I was trying to setup a php script to send mail with SMTP Authentication. The script was ready, but when executed in a browser, it displayed the following error.

Fatal error: Class ‘Net_SMTP’ not found in /usr/local/lib/php/Mail/smtp.php on line 349″

The problem appears because the php pear package Net_SMTP is not present in the server. You can install it in two way.

  1. Install the Mail package with –alldeps which will install all required dependencies like Net_SMTP

pear install –alldeps Mail

If Mail is already installed, and if it refuses to get installed then you can force the installation as follows.

pear install –alldeps -f Mail

2.  If Mail is already installed, then you can install the Net_SMTP option alone as follows.

pear install Net_SMTP

After that, execute the script again and...

Read More