Sunday 26 February 2012

How do I change my sites MX record to point mail to another server or domain?

An MX Record is used by a mail server to route incoming email. Changing your MX record is usually done to redirect email to a remote server. It can also be used as a temporary backup in case the local mail server goes down.

If you wish to just point it to another domain do the following:

  1. Log into your Cpanel.

  2. Click the MX Entry icon.

  3. Select the problematic domain name from the drop-down list.

  4. Here are the rules for Local, Backup, and Remote. If you do not know, choose Automatically Detect Configuration and hit the Change button.

  5. Under "Add New Record", enter mail.thedomainname.com (or whatever you were provided by the host) for the Destination value. Priority will normally stay equal to 0 [zero].

  6. Click the "Add New Record" button.


Tip: Setting the value back is just as easy. Just save the Destination value as the domain name you select from the drop-down (no http or www).

If you wish to point it to another server using the same domain:

  1. Log into your Cpanel.

  2. Click the MX Entry icon.

  3. Select the problematic domain name from the drop-down list.

  4. Here are the rules for Local, Backup, and Remote. If you do not know, choose Automatically Detect Configuration and hit the Change button.

  5. Under "Add New Record", enter mail2.thedomainname.com (or whatever you were provided by the host) for the Destination value. Priority will normally stay equal to 0 [zero].

  6. Click the "Add New Record" button.

  7. Go to the cPanel Home and click the Simple DNS Editor icon.

  8. Select the same domain from the drop-down.

  9. Under "Add an A Record", enter mail2.thedomainname.com (or whatever you put for the MX Destination) in the "Name" field.

  10. In the "Address" field, enter the other server's IP address.

  11. Click the "Add A Record" button.

  12. Done.

Monday 13 February 2012

mesg: error: tty device is not owned by group `tty’

cPanel Change Root Password You should change your server root password occasionally to maximize your site security.
if you think someone else has access to your WebHost Manager account, Please change this password


Steps

1.  To access the Server Configuration Menu, click on Server Configuration, on the main screen of your WebHost Manager interface.

2.  Click on Change Root Password.

3.  Enter the new root password in the New Password field.

4.  Click on Change Password.

Thursday 9 February 2012

FileList::init() failed: ls_dir_wrapper() failed: Unable to logon user + Logon failure: unknown user name or bad password

I have referred the following steps to sort out the error :

steps to recreate the error : Login into plesk cp >> domain's cp >> browse file manager. Here is the error :

------
---------------------- Debug Info -------------------------------
0: FileManagerUIPointer.php:709
FileManagerUIPointer->accessItem(string 'GET', NULL null)
1: client.domain.hosting.file-manager.php:86
plesk__client__domain__hosting__file_manager->accessItem(string 'GET', NULL null)
2: UIPointer.php:601
UIPointer->access(string 'GET')
3: plesk.php:43
------

Solutions :

1. RDP >> Mycomputer >>right click >> properties >>manage >>user & group >>click on users>> find the user(domain name) >>right click and click on properties >> uncheck 'password disable option'.

2. Go to run>>cmd>> and execute following query to retrieve the password of the user's admin area of the domain. For my case I executed the following query :

Example :
------
C:>"%plesk_bin%"dbclient --direct-sql --sql="select su.login, a.password from
accounts a, sys_users su where a.id=su.account_id and su.login='dhelalqamar.com
'"
login password
dhelalqamar.com domain_passwd
------

Note : Replace only login name here

3. Execute following command to be recognized the password by the system :

net user login_name password

Example :

====
C:>
net user dhelalqamar.com qwertyu

The command executed successfully
====

Now try to browse the file manager. Error will be vanished :)

Issue : date: cannot set date: Operation not permitted

To fix the issue:

# vzctl stop <veid>
# vzctl set <veid> –save –capability sys_time:on
# vzctl start <veid>

# vzctl enter <veid>
# mv /etc/localtime /etc/localtime.bk
# ln -s /usr/share/zoneinfo/Asia/Calcutta /etc/localtime
or set time by:

date -s "9 Feb 2012 12:13:31"

How to Change Time Zones on Servers

If you want to change the existing time zone of your server. Then follow the steps Below.

Note:: One must have a root user privileges for this.

On Linux Server::

1. Login as a Root.
2. The time zones are located on server in the directory /usr/share/zoneinfo, so change the directory to that one.

Code:

root@Server [~]# cd /usr/share/zoneinfo


3. Copy or move the current local time zone so that you will be able to set the time zone as per requirement.

Code:

root@Server [~]#cp -p /etc/localtime  /etc/localtime-back
Or
root@Server [~]#mv /etc/localtime /etc/localtime-back


4. Now say for example, if you want to set the BST [British Summer Time] time zone for your server then, you will need to create a symbolic link for the same. The command is as follows.

Code:

root@Server [~]#ln -s /usr/share/zoneinfo/BST  /etc/localtime


Verify the changes done by "date" command.

Code:

root@Server [~]#date

Thu Feb  9 12:26:30 GMT 2012

Changing System Time From Container

Normally it is impossible to change the system time from a Container. Otherwise, different Containers could interfere with each other and could even break applications depending on the system time accuracy.

Normally only the Hardware Node system administrator can change the system time. However, if you want to synchronize the time via Network Time Protocol (NTP), you have to run NTP software, which will connect to external NTP servers and update the system time. It is not advisable to run application software on the Hardware Node itself, since flaws in the software can lead to compromising all Containers on the Hardware Node. Thus, if you plan to use NTP, you shall create a special Container for it and configure it to have the sys_time capability. The example below illustrates configuring such a Container:
# vzctl set 101 --capability sys_time:on --save

Unable to set capability on running Container

Saved parameters for Container 101

The output of the above command warns you that vzctl cannot apply changes in the capabilities to a running Container. The Container has to be restarted before changes take effect:

# vzctl stop 101; vzctl start 101

Stopping Container ...

Container was stopped

Container is unmounted

Starting Container ...

Container is mounted

Adding IP address(es): 192.168.1.101

Hostname for Container set: Container101

Container start in progress...

# ssh root@ct101

root@ct101's password:

Last login: Mon Feb 06 23:25:58 2012  from 10.100.10.10

[root@ct101 root]# date

Thu Feb  9 12:13:33 GMT 2012

[root@ct101 root]# date 10291300

Thu Feb  9 12:13:33 GMT 2012

[root@ct101 root]# date

Thu Feb  9 12:13:33 GMT 2012

[root@ct101 root]# logout

Connection to Container101 closed.

# date

Thu Feb  9 12:13:33 GMT 2012

The command session above shows the way to change the system time from Container 101. The changes will affect all the Containers and the Hardware Node itself. It is not advisable to have more than one Container with the sys_time capability set on.

Wednesday 8 February 2012

How to enable FTP account for a suspended user on cpanel?

So you would ask that why and how to enable FTP account for a suspended user on cPanel? I’d says that there are many situations where you have to unsuspend client’s account so that he can remove offending contents, but you don’t wish to do so because he has uploaded phishing contents.  So here is the simple solution, just give access to FTP so that he can remove contents and then later after verifying his account you can unsuspend user. Here is the simplest way, I have found.

First open, file /etc/vftp/sertech [sertech is the username]

vi /etc/vftp/sertech

What you will have to do is just remove the double exclamation mark “!!” after the colon which is followed by username

sertech:!!$1$OwLDOXwc$eA9lg8.:1852:1846::/home/sertech:/bin/ftpsh

sertech_logs:!!$1$OwL$eoa9lg8.:1852:1846:highw703:/usr/local/apache/domlogs/sertech

After removing the above highlighted part i.e !!, you will have to save and exit file. There is no need to restart anything. You’re done, now you have successfully enabled account for a suspended user on cpanel. Now client can login to FTP using his default username and password of cPanel.

Wednesday 1 February 2012

How to install the mod_ruid2 cpanel

The mod_ruid2 module is a suexec module for Apache 2.0 that provides performance similar that of mod_php with the security of suphp. This module allows PHP applications to run as the user, instead of as the user nobody in a manner similar to suphp.

However, mod_ruid2 is incompatible with some EasyApache modules, such as FastCGI, mod_cache, mod_disk_cache, mod_mem_cache, and ModMono. While mod_ruid2 may be ideal for many environments, cPanel recommends testing and verification that it is appropriate for your configuration. Generally, mod_ruid2 is not considered to be production-worthy.

The latest release of EasyApache includes improvements to several third-party libraries and utilities. Updates to EasyApache 3.11.2 include support for modruid2 latest version.

You can simply follow these steps to install mod_ruid2 manually with cpanel server.

yum -y install libcap-devel


The rest is just like those other threads but using the requisite module name and location:

cd /root
wget http://downloads.sourceforge.net/project/mod-ruid/mod_ruid2/mod_ruid2-0.9.4.tar.bz2
tar xvfj mod_ruid2-0.9.4.tar.bz2
cd mod_ruid2-0.9.4
apxs -a -i -l cap -c mod_ruid2.c


After doing the above, it will then put a "LoadModule" into /usr/local/apache/conf/httpd.conf file:

LoadModule ruid2_module modules/mod_ruid2.so


The module can cause conflicts during EasyApache build, so I would suggest moving it and distilling the include. First, remove the "LoadModule" line mentioned above from /usr/local/apache/conf/httpd.conf, then run these commands:

echo "LoadModule ruid2_module modules/mod_ruid2.so" >> /usr/local/apache/conf/includes/pre_main_global.conf
cp /usr/local/apache/conf/httpd/conf /usr/local/apache/conf/httpd.conf.bak110826
/usr/local/cpanel/bin/apache_conf_distiller --update
/scripts/rebuildhttpdconf
/etc/init.d/httpd restart


Now, copy the mod_ruid2.so file to /root to save a copy of it, since future /scripts/easyapache recompiles will move the file out of /usr/local/apache/modules folder:

cp /usr/local/apache/modules/mod_ruid2.so /root


Now, before you run /scripts/easyapache in the future, create these files:

nano /scripts/preeasyapache


Place the following content into the file:

#!/bin/bash

sed -i 's/LoadModule ruid2_module/#LoadModule ruid2_module/g' /usr/local/apache/conf/includes/pre_main_global.conf


Next, create this file:

vi /scripts/posteasyapache


Place the following content into the file:

#!/bin/bash

cp /root/mod_ruid2.so /usr/local/apache/modules/
sed -i 's/#LoadModule ruid2_module/LoadModule ruid2_module/g' /usr/local/apache/conf/includes/pre_main_global.conf
/etc/init.d/httpd restart


The first script comments out the LoadModule in /usr/local/apache/conf/includes/pre_main_global.conf at the beginning of the Apache build. The second script copies mod_ruid2.so back into /usr/local/apache/modules folder, uncomments the LoadModule, and restarts Apache at the end of the build.

After saving these files, ensure they can execute:

chmod +x /scripts/preeasyapache
chmod +x /scripts/posteasyapache