HowTo: configure an alternate SMTP port in Plesk

September 18, 2009    |   Posted by admin   |    Category: Plesk Management

How to configure alternate SMTP port OR change the SMTP port on a Plesk server?

Sometimes some ISPs block port 25 for security reasons in which case, you need to open an alternate SMTP port on your server for your clients. Plesk do not offer a straight forward method of configuring an alternate SMTP port, instead you have to configure it manually.

SMTP on Plesk servers runs under xinetd service and the location of the file is /etc/xinetd.d/smtp_psa.

In order to configure an alternate port say for example 2525, follow the below steps:

1. Make a copy of file “smtp_psa” under the /etc/xinetd.d/ directory

# cp -p smtp_psa smtp_psa_new

2. Edit the smtp_psa_new file and replace the line

service smtp
with
service smtp_new

3. You now need to edit the /etc/services file and make sure the lines with port 2525 should look as follows:

smtp_new      2525/tcp      #alternate SMTP port
smtp_new      2525/udp      #alternate SMTP port

4. Save the file and restart the xinetd service.

# /etc/init.d/xinetd restart

SMTP service will now listen on port 2525 as well which you can verify using the ‘telnet’ command:

# telnet yourserverip 2525
Comments Off on HowTo: configure an alternate SMTP port in Plesk

Apache: [emerg] (28)No space left on device: Couldn’t create accept lock

September 17, 2009    |   Posted by admin   |    Category: cPanel Management

semget: [emerg] (28) No space left on device OR Apache: No space left on device: Couldn’t create accept lock

You may receive “No space left on device” message while starting the Apache service, however, it has nothing to do with the disk space. The reason behind the error message is Semaphores.

You will have to kill the active semaphore processes in order to start Apache service successfully. To list the PIDs of the active semaphore processes, execute:

# ipcs -s
------ Semaphore Arrays --------
key        semid        owner      perms      nsems
0x00000000 366673220    apache    600        1
0x00000000 366706589    apache    600        1
0x00000000 366732358    apache    600        1
0x00000000 366734353    apache    600        1

It will list all the PIDs which need to be killed:

# ipcrm -s PID

If you have a long list of processes, execute the following commands:

# ipcs -s | grep apache | awk ' { print $2 } ' | xargs ipcrm sem

Replace ”apache’ in the above command with the actual “owner” of the processes returned in the “ipcs -s” command. Apache will start successfully once these processes are killed.

What is a Semaphore?
Semaphores are use to communicate between active processes. Apache write down some information of such processes before the communication actually begins and if Apache fails to write the information, it results in the “No space left on device: Couldn’t create accept lock” error message.

Comments Off on Apache: [emerg] (28)No space left on device: Couldn’t create accept lock

defer_router defer (-1): All deliveries are handled by MailScanner

September 15, 2009    |   Posted by admin   |    Category: cPanel Management

You suddenly realize that the emails on your server are not working and the mail logs shows the following messages:

1MnfEt-0007pQ-Tn == xyz@abc.com R=defer_router defer (-1): All deliveries are handled by MailScanner
1MnfBw-00037y-9h == abc@xyz.com R=defer_router defer (-1): All deliveries are handled by MailScanner

This mostly happens when Mailscanner is not working properly as all deliveries are handled by MailScanner. To fix the issue, restart your mail service first i.e.

service exim restart

then, start the Mailscanner executing the following command:

/usr/mailscanner/bin/check_mailscanner

If it displays any PIDs, kill them and execute the command again. This will start your MTA and MailScanner which will make sure your emails start working again.

Comments Off on defer_router defer (-1): All deliveries are handled by MailScanner

How to increase mail size in exim?

September 15, 2009    |   Posted by admin   |    Category: cPanel Management

You may receive a bounce back message saying “Message size exceeds maximum permitted” on sending an email greater than the size defined in the exim configuration. On a cPanel server, the message size limit is 50MB by default.

In order to raise the message size limit, you need to edit the exim configuration file either manually located at /etc/exim.conf OR from WHM >> Exim Configuration Editor > Advanced Mode and at the very start of the file, add the following line:

message_size_limit = 100

Save the file and restart the exim service.

# service exim restart

This will increase the message size to 100MB. You can verify the new size by executing the following command:

# exim -bP | grep message_size_limit

Comments Off on How to increase mail size in exim?

Howto: Disable root login on a server?

September 13, 2009    |   Posted by admin   |    Category: Linux Administration

How to disable root login and create an alternate SSH user? In order to disable root access on your server, you need to create an alternate SSH user who have privileges to gain root access else you will be locked out of the system.

First, create a user say  ‘admin’

# useradd admin

Set a password for the new user

# passwd admin

By default, this user will have privileges to su to root but in case of a cPanel server, you need to add the user in the ‘wheel’ group.

WHM >> Security Center >> “Manage Wheel Group Users”

Once the user is created, follow the steps to disable the root access:

1) Edit the SSHD configuration file ‘sshd_config’:

pico /etc/ssh/sshd_config

2) Search the line

PermitRootLogin yes
and change it to
PermitRootLogin no

Once you are complete with the above changes, save the file and exit. You will have to restart the sshd service for the changes to take effect.

service sshd restart

Now, you will have to SSH to your server as user ‘admin’ and then su to root as follows:

login as: admin
admin@xx.xx.xx.xx’s password:
<admin pass here>
[admin@server ~]$ su –
password:
<root password here>
[root@server ~]#

Comments Off on Howto: Disable root login on a server?