web analytics

Category Misc

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

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

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

df showing wrong result

My mysql server suddenly started showing my disk space usage as almost full.

[root@abc /]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       550G  508G   14G  98% /
tmpfs            32G     0   32G   0% /dev/shm
/dev/sda1       2.0G  173M  1.8G   9% /tmp

But when I issued a disk usage check on / , it returned the usage to be very little.

[root@abc /]# du -sch
47G     .
47G     total

I was sure there is something wrong. Hence, I checked for deleted files. You can use either of the following commands.

[root@abc /]# lsof +L1

mysqld    23193     mysql    5u   REG    8,1          184     0       13 /tmp/ibrUf6yr (deleted)
mysqld    23193     mysql    6u   REG    8,1            0     ...

Read More

(28)No space left on device: mod_rewrite: Parent could not create RewriteLock file

Noticed this error in a cpanel server while starting apache. Apache refused to start with the following error.

(28)No space left on device: mod_rewrite: Parent could not create RewriteLock file

Seeing the error, the first thing that I checked was the disk space in the server but it looked fine.

root@abc [~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg0-root   16G  1.2G   14G   8% /
/dev/mapper/vg0-home  249G  124G  113G  53% /home
/dev/mapper/vg0-var    23G  7.0G   15G  33% /var
/dev/mapper/vg0-usr    23G  7.6G   14G  36% /usr
/dev/mapper/vg0-tmp   9.5G  151M  8.9G   2% /tmp
/dev/sda1             7.4G  184M  6.9G   3% /boot
tmpfs                 7.9G     0  7...

Read More

Accessing Gmail with Roundcube

Requirement : I want to access my gmail under my own domain with the help of webmail.

Say my domain name is abc.com , I want to access it as http://abc.com/mail

Suppose I am on a cpanel server. Download and install Roundcube as follows.

root@me [/home/abc/public_html]# wget http://downloads.sourceforge.net/project/roundcubemail/roundcubemail/1.0.0/roundcubemail-1.0.0.tar.gz

root@me [/home/abc/public_html]# tar -xzvf roundcubemail-1.0.0.tar.gz

root@me [/home/abc/public_html]# mv roundcubemail-1.0.0 mail

root@me [/home/abc/public_html]# chown -R abc:abc mail

root@me [/home/abc/public_html]# cd mail

Now login to your cpanel and create a database for roundcube installation, create a database user and assign privileges. This can all be done from cpanel.

Once done, go to the installer link as ...

Read More