Categories

Saturday, 21 March 2015

Steps to Route email through another server in Exim Cpanel

Hi All,

Below is the steps to route the email for all of the domains through another server. The MTA should need to authenticate on to the the relay server inorder to send emails.

On Cpanel Go to

Main > Service Configuration > Exim Configuration Editor, click on the Advanced Editor button, and enter the following in Section:AUTH:
begin authenticators

ServerName_login:
 driver = plaintext
 public_name = LOGIN
 client_send = : ServerNameUsername : ServerNamePassword

on the section client_send provide the mail account username and password to authent
 icate to the antoher server.

Then add the following route in the Section: ROUTERSTART configuration box as shown in the following image:
send_via_ServerName:
driver = manualroute
domains = ! +local_domains
transport = ServerName_smtp
hosts_randomize = true
route_list = * ServerName.com::25 randomize byname
host_find_failed = defer

no_more

Add the following transport to the Section: TRANSPORTSTART configuration box as shown in the following image:
ServerName_smtp:
driver = smtp
hosts_require_auth = *
tls_tempfail_tryclear = true
headers_add = X-AuthUser: ${if match {$authenticated_id}{.*@.*}\
{$authenticated_id} {${if match {$authenticated_id}{.+}\
{$authenticated_id@$primary_hostname}{$authenticated_id}}}}
That's it

Now you will be able to send emails in exim accounts through another server.

Thanks and Regards
Syamkumar.M

Sunday, 8 March 2015

Ubuntu dependency issue while upgrading (linux-headers-generic (= 3.2.0.72.86) but 3.2.0.76.90 is to be installed)

Hi,

I faced an error while I ran the apt-get upgrade command on the Ubuntu 12.04 LTS server for fixing the Glibc vulnerability. The Exact error is


linux-header: depends on linux-headers-generic (= 3.2.0.72.86): but 3.2.0.76.90 is to be installed.


Below is the steps for fixing the issue. First check the header packages installed using the command

apt-get --get-selections |grep -i header


Then remove the below packages using the dpkg commands as below.


sudo dpkg -r linux-image-generic-pae
sudo dpkg -r linux-headers-generic-pae
sudo dpkg -r linux-generic-pae


Now run the below commands to upgrade


sudo apt-get -f install
sudo apt-get upgrade


This will installl the required packages and will replace the headers with new one and will resolve the dependency issues.



Thanks and Regards
Syamkumar.M

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

Ad