Starting sshd:PRNG is not seeded

March 23, 2009 on 4:51 am | In Centos, Linux | 2 Comments

You might have received this error when restarting SSHD.

#/etc/rc.d/init.d/sshd restart

Stopping sshd: [ OK ]

Starting sshd:PRNG is not seeded

[FAILED]

Here is the fix.

cd /dev/

./MAKEDEV generic

Now try starting SSH. :)

Error : tty device not owned by group ‘tty’

March 20, 2009 on 2:07 am | In Centos, Cpanel, Linux | No Comments

You might receive this error when your try to restart services in CPanel.

This is because the group of the tty devices are not “tty”

Change it to tty.

chgrp tty /dev/ttyp* /dev/ptyp* /dev/vcs* /dev/ptmx /dev/pts/0

as simple as that.:)

535 Incorrect authentication data + EXIM + cPanel

March 20, 2009 on 1:47 am | In Cpanel, exim | 4 Comments

Every 5 minutes this e-mail report Exim has restarted:

================================================== =====

exim failed @ A restart was attempted automagically.
Service Check Method: [tcp connect]

Failure Reason: TCP Transaction Log:
<< 220-serverX.xxx-xxxxxxxx.net ESMTP Exim 4.69 #12008 14:58:20 +0000
<<
<<
>> EHLO localhost
<< 250-serverx.xxx-xxxxxxxxxxx.net Hello localhost [127.0.0.1]
<<
<<
<<
<<
<<
>> AUTH PLAIN AF9fY3BhbmVsX19zZXJ2aWNlX19hdXRoX19leGltX19IY3VsTE dXcFpDNU1XM1c2OVU4dmdGSUlyQllwcHpuSVJwQVllYXhlVlh5 VU1FRmx5Slg0YVlVV2JEbkJYcmpVAHBFTlh0eGtMdkNsRkJvZ3 ROd0xZVVhTNlNWRlBHMUR6VEZBTG1naUFzQTc4Y0FlMW5HaHI4 VXBoa1R0N1FJa0U=
<< 535 Incorrect authentication data
exim: ** [535 Incorrect authentication data != 2]

Cmd Service Check Raw Output:

Here is the fix.

go to /var/cpanel/serviceauth/

remove the directory exim

cd /var/cpanel/serviceauth/
rm -rf exim

Restart Cpanel.
/etc/rc.d/init.d/cpanel restart

The folder exim will be recreated…

that should fix the issue.

Failed to add site to database. DBERR: error ‘ERROR: duplicate key violates unique constraint “domain_key” ‘ in ‘ INSERT INTO siteinfo ENSIM

March 6, 2009 on 9:30 am | In Pgsql, ensim | 3 Comments

Hello guys, You might have come accross the following error

Failed to add site to database. DBERR: error ‘ERROR: duplicate key violates unique constraint “domain_key” ‘ in ‘ INSERT INTO siteinfo (site_id, domain, admin_user, email) VALUES (8, ‘domain.com’, ‘xxxx’, ‘xxx@domain.com’)’

=========================

Here is the fix.

Login to server via backend.

su postgres

Take a backup of the database…

pg_dump appldb > appldb.dump.out

Now lets edit

psql

postgres=# \l

this will list all the databases. The Ensim database is “appldb”

postgres=# \c appldb
You are now connected to database “appldb”.
appldb=# \d

This will list all the tables in the database.

You can find the database siteinfo

appldb=# SELECT * FROM siteinfo WHERE domain=’domain.com’;

site_id | domain | email | admin_user
———+——————–+———————+————
35 |domain.com | test@yahoo.com | dommn
(1 row)
it will list the entry. Now to fix the issue, you need to delete that entry. Find the site_id for the domain. Here it is 35

DELETE FROM siteinfo WHERE site_id=35;

Now quit the database

appldb=# \q

bash-3.00$ exit

Restart services

/etc/rc.d/init.d/virtualhosting restart

/etc/rc.d/init.d/epld restart

Now try to add the domain from Control panel. :)

Tomcat CPanel/Enable for a domain

March 1, 2009 on 2:24 pm | In Cpanel | 1 Comment

To enable .jsp pages for a domain.

/scripts/addservlets –domain=domain.com

To disable

/scripts/remservelets –domain=domain.com

In some cases, these scripts won’t work.

Manually check the setting for the domain. Open up the Apache conf /usr/local/apache/conf/httpd.conf

check if the directive given below in the virtual host entry of domain, if not add it.

Include “/usr/local/apache/conf/userdata/std/2/username/domainname/*.conf”

Now navigate to the directory

cd /usr/local/apache/conf/userdata/std/2/
check whether the folder named username(replace username with appropriate username) exist if not, create it.
mkdir username
cd username
cd domainname

If the directory “domainname” is not present, create it

Check for the file cp_jkmount.conf here, if it is not present, create it with the following contents

 <IfModule mod_jk.c>
  	JkMount /*.jsp ajp13
  	JkMount /servlet/* ajp13
	JkMount /servlets/* ajp13
	JkMount /*.do ajp13
 </IfModule>

Check the file /usr/local/jakarta/tomcat/conf/server.xml Add the entry for host
www.domainname.com

 <Host name="domainname" appBase="/home/username/public_html">
    <Alias>www.domainname</Alias>
      <Context path="" reloadable="true"
               docBase="/home/username/public_html" debug="1"/>
      <Context path="/manager" debug="0" privileged="true"
        docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
      </Context>
     </Host>

Restart the services

/usr/local/jakarta/tomcat/bin/shutdown.sh
/usr/local/jakarta/tomcat/bin/startup.sh
/scripts/restartsrv_tomcat

Restart Apache

Parkdomain on Addon domain in cPanel And create mail accounts for that Parkdomain

March 1, 2009 on 12:57 pm | In Cpanel | No Comments

Hello guys,

You might have come across the requirement of parking a domain on an addon domain.

Please note this can be done only via backend and you need root access to the server.

Suppose.

main domain : maindomain.com
addondomain: addondomain.com
the domain needed to be Parked on “addondomain.com” : parkdomain.com

Case One.
You need the domain “parkdomain.com” to be parked on addon domain “addondomain.com”.

Case Two.
You need the domain “parkdomain.com” to be parked on addon domain “addondomain.com”. Also, you need to create mail account for the domain “parkdomain.com” via cPanel interface.

Steps for Case One.

For parking a domain on to an Addon domain. Assuming the case of parkdomain.com” to be parked on addon domain “addondomain.com”.

Take a backup of Apache conf fine.

cp -pr /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.confback

Open the file /usr/local/apache/conf/httpd.conf in vi editor or pico

fine the Virtual host entry for the “ServerAlias addondomain.com”
The entry looks like

ServerAlias addondomain.com www.addondomain.com

Edit this line as

ServerAlias addondomain.com www.addondomain.com parkdomain.com www.parkdomain.com

Restart Apache
/etc/rc.d/init.d/httpd restart

Now add the zone entries via WHM.

DNS Functions > Add a new DNS zone
domain name : parkdomain.com
IP: The IP should be the IP entry in the Vitualhost where “ServerAlias addondomain.com www.addondomain.com parkdomain.com www.parkdomain.com” resides.

Once it has propagated you park domain will start working. Please note that your parkdomain.com will be shown under the Addondomains section in Cpanel.

Steps for Case Two

You need the domain “parkdomain.com” to be parked on addon domain “addondomain.com”. Also, you need to create mail account for the domain “parkdomain.com” via cPanel interface.

Perform the Case one.
Now what is left is the need for creating mail accounts with the “parkdomain.com” via cPanel interface.

Please take the backup of all the files you edit.

find the username of the account

grep addondomain.com /etc/userdomains
It shows
addondomain.com: username

open using your text editor.

/var/cpanel/users/username
find the variable

DNS
It will be like
DNS=
DNS1=
DNS2=

If you have two entries already
DNS=
DNS1=

Add
DNS2=parkdomain.com
Save the file and exit.

Next get in to the directory /var/cpanel/userdata/username
You will find a file name addondomain.maindomain.com . Open this file

Find the directive “serveralias: addondomain.com www.addondomain.com www.addondomain.maindomain.com”
Now edit this line to

serveralias: addondomain.com www.addondomain.com www.addondomain.maindomain.com parkdomain.com www.parkdomain.com

Next
Open the file
/etc/userdomains

Add a new entry
parkdomain.com: username

Open the file
/etc/localdomains

Add a new entry
parkdomain.com

You are about to finish.
Now execute the script

/scripts/updateuserdomains.

You should be able to view the parkdomain.com in your

cPanel > Mails > Add/remove mail accounts.