Categories

Tuesday, 17 February 2015

sasl login authentication failed authentication failure postfix webmin

Hi,

I faced one of the strange issue in which postfix was unable to send email from the domain users. There was a php mailer script that is sending emails by providing the smtp details(username, password and hostname of smtp server) to the phpmailer configuration file. But unfortunately the authentication was not working and so emails are not going from the code. Below is the steps to fix the issue.

1)First Check the log /var/log/maillog. I found the error as


postfix/smtpd[13573]: warning: localhost[127.0.0.1]: SASL LOGIN authentication failed: authentication failure


2)The postfix is using the saslauth authentication method. Theconfiguration options for starting saslauth with postfix is configured on the file

/etc/sysconfig/saslauthd

Open the configuration file and in the option field there will be a variable "r" is given

OPTIONS="-r"
Remove that option and set it as OPTIONS=""
 
There is no need for r in that .Below is the description for r.
 
 
 -r      Combine the realm with the login (with an '@' sign in between).
             e.g.  login: "foo" realm: "bar" will get passed as login:
             "foo@bar".  Note that the realm will still be passed, which may
             lead to unexpected behavior. 






Thanks and Regards

Syamkumar.M


Sunday, 16 November 2014

Steps to migrate Ubuntu Server to another Machine

Hi,

I have  a requirement in my organisation to replicate the  server environment running in  operating system ubuntu in kvm to another machine in vmware. The current machine contains applications like apache, trac, postgresql, svn etc. One solution for migration is to shutdown kvm machine. Then convert the kvm disk images of the machines to the vmware disks using vmware tools as mentioned in the post

http://syamkumar-linux.blogspot.in/2014/08/how-to-install-vmware-tools-and-convert.html

This process will take many hours to complete and the system will be down on that time. As it is a critical system, we cannot afford that much downtime. So I decided to use an alternative method. That is migration of ubuntu server to another one. Below are the steps for that.

1)First We need to find out the version of ubuntu running on the current machineu. This can be get using the command.

cat /etc/issue

Ubuntu 12.04.2 LTS \n \l

2)Then we need to create a machine in vmware with the same version of ubuntu as in the current machine and install the ubuntu on it.

3)Now on the source machine we need find out the list of packages installed on the source.

sudo dpkg --get-selections | sed "s/.*deinstall//" | sed "s/install$//g" > ~/pkglist


The above command will list all the installed packages on the source machine and will store it in the file pkglist

4)Now on the destination machine install the packages same as in the source machine. That can be done by copying the file pkglist to the destination machine using scp or rsync. The use the below command to install the packages .

sudo aptitude update && cat pkglist | xargs sudo aptitude install -y


Now we have same packages and services running on the destination machine as in the source machine.


5)Now we need to transfer the config file and data from the source machine to the destination machine using scp or rsync.

That is you need to rsync the apache directory, document roots, postgresql data directory, trac configuration file, and trac modules etc. Make sure that you need to shutdown the services before copying it.

Once it is done. All the services will run on the destination machine like in source machine. That is it will behave like the source machine.

If you have done this steps correctly your migration will be succesfull.


Thanks and Regards
Syamkumar.M

Friday, 14 November 2014

Command to reset the cpanel account password

Hi,

We can  reset the account password for the cpanel account by using commands. We usually do it by login to WHM interface and then use the modify account section. But this can be done simply using command line.
This post is usefull for some one who doesn't have a cpanel license on the server.


Below is the commands to reset the cpanel account password

1)First we need to change an environment variable in the current shell we are using export command

export ALLOW_PASSWORD_CHANGE=1

2)Then use the command

/scripts/chpass  username password 

This will change the account password

3)But the ftp password won't sync with the new update. So you need to run the below command to update it

/scripts/ftpupdate

Cheers
Syamkumar.M


Wednesday, 15 October 2014

How to Fix "replication access was denied" Error in Active Directory

Hi,

Recently I faced an issue in which the Replication process on one of the Active directory server failed with the secondary giving error as "replication access was denied". Below is the steps to fix the issue.

1. Open the Active Directory Users and Computers snap-in
2. On the View menu, click Advanced Features.
3. Right-click the domain object, such as "mydomain.com", and then click Properties.
4. On the Security tab, select the account of the user whose credentials are used to run the sensor. (or add it if it does not exist here)
5. Click to select the Monitor Active Directory Replication check box from the list.
6. Click Apply, and then click OK.



Thanks and Regards
Syamkumar.M

Tuesday, 12 August 2014

How to install VMware tools and convert kvm disk images to vmware .vmdk disks

Hi,

We had a requirement to move the kvm systems to vmware and for that at first we need to convert existing kvm machine disk images which is either in qemu/raw type to .vmdk images.

First we need to install vmware-tools on the machine where we are going to convert the disk images. Below are the steps to install the vmware tools.

Import the vmware gpg keys using the command
--------------------------------------------
rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub
rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub

Add vmware tools repository using the below command
---------------------------------------------
   echo -e "[vmware-tools]\nname=VMware Tools\nbaseurl=http://packages.vmware.com\
   /tools/esx/4.1latest/rhel6/\$basearch\nenabled=1\ngpgcheck=1" > /etc/yum.repos.d/vmware-tools.repo



Update yum and install it using the command
------------------------------------------ 
yum update
yum install vmware-open-vm-tools
yum install vmware-open-vm-dkms

It will install the necessary tools on the machine.

Now use the below command to convert the kvm disk image to vmware one

qemu-img convert machine.img -O vmdk machine.vmdk

It will take some time to convert based on the size of the disk.

Once it is finished. You can scp the converted disk file to the new vmware. Then create a new vmware machine using existing disk image as the convreted file.

That's it

Cheers
Syamkumar.M

Thursday, 24 July 2014

"Cannot start session without errors, "

Hi,

I faced an issue after installing phpmyadmin on one of the server. I am unable to load the phpmyadmin url giving error as "Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. "

The issue was with some permission with session path of php

For fixing the issue. First note the php settings path in php.ini using the command

php -i | grep -i session

For me the session path is /var/lib/php

I just gave is 777 permission using the command

chmod 777 /var/lib/php

Then the issue was resolved and I was able to login to phpmyadmin now.

Thanks and Regards
Syamkumar.M

Friday, 11 July 2014

How to Restore a table into a new table in the same database

HI,

Please use the commands to restore a table into another table in a database. Below are the commands for that .

Login to mysql database using the credentials and then run these commands in the prompt

CREATE TABLE chillar_card_recharge_new LIKE chillar_card_recharge;
INSERT chillar_card_recharge_new SELECT * FROM chillar_card_recharge;

In the first command it will create a table chillar_card_recharge_new like chillar_card_recharge.

In the second command it will copy the table data into the new table we had created.

Thanks and Regards
Syamkumar.M

Ad