Postgresql issues with a cPanel server

Recently with a cPanel server, we had this issue of not being able to create postgresql database even after the postgresql package is installed and database server is running. Fixing of one issue lead to another there by needing to fix all the errors.

Cpanel::AdminBin::adminrun(postgres) set error in context postgres
[2010-01-16 12:24:18 -0500] warn [postgres::listdbs] Encountered error in postgres::listdbs: Error from postgres wrapper: PostgreSQL has not been configured by the administrator. Unable to locate pgpass file.

This was fixed by doing these,

Login to WHM => SQL Services => Postgres Config => Click on “Install Config”.
Login to WHM => SQL Services => Postgres Config => “Set a Postgresql password also”

No error in cPanel after doing above. However that followed by an issue of created DBs not being appeared in the List DB page of Postgresql databases. Went to shell. Logged in as root . Switched to postgres. “su – postgres” . Ran the command “psql” and then

-bash-3.2$ psql
Welcome to psql 8.1.18, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

postgres=# \l
List of databases
Name | Owner | Encoding
-----------+----------+----------
postgres | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8
(3 rows)

postgres=# \q

No DB was created. Checked the logs /usr/local/cpanel/logs/error_log and it had entries like ERROR: role “username” does not exist which meant, no roles to create the database.

cd /var/cpanel/users && for x in *; do su -c "createuser -S -D -R $x" postgres; done

Continue Reading

cPanel or Lxadmin – Roundcube issues – SERVICE CURRENTLY NOT AVAILABLE! Error No. [0x01F4]

SERVICE CURRENTLY NOT AVAILABLE!

Error No. [0x01F4]

That is what you will see on logging to the Roundcube. How to fix it ?

on cPanel, just update roundcube :)

/usr/local/cpanel/bin/update-roundcube --force

On Lxadmin, just re-install

rm /var/cache/lxadmin/lxwebmail*
lphp.exe ../bin/misc/installRoundCube.php
/script/upcp

Continue Reading

Adding packages from WHM or editing the reseller privileges is not working on a x86_64 architecture

As usual, start by checking the error log of cPanel at /usr/local/cpanel/logs/error_log

2009-05-23 15:44:24 info [whostmgr2] [28346] Waiting for lock on /var/cpanel/package-limits.yaml held by /usr/local/cpanel/whostmgr/bin/whostmgr2 – locking /var/cpanel/package-limits.yaml with pid 25968
2009-05-23 15:44:25 info [whostmgr2] [28346] Removing expired lock file /var/cpanel/package-limits.yaml.lock
(internal warning while parsing [stdin]) Sat May 23 23:41:28 2009 [25968] warn: Attempt to free unreferenced scalar.

While the error (internal warning while parsing [stdin]) Sat May 23 23:41:28 2009 [25968] warn: Attempt to free unreferenced scalar floods the error log

Permissions were all right, but suddenly this started happening, but only x86_64 architectures only. Reason being the cPanel is killing the process, since it exceeded the memory usage allowed by cPanel.

Solution would be to increase the memory limit of cPanel by following the instructions below.

WHM -> Server Configuration -> Tweak Settings Choose the setting for:

The maximum memory a cPanel process can use before it is killed off (in megabytes). Values less than 128 megabytes can not be specified. A value of “0″ will disable the memory limits.

The settings had 256M there, and increasing the value to 1024 M helped. Server had 8G RAM, so the value of 1024M was fine here.

Continue Reading

Howto enable access to whm, cpanel subdomains (proxy subdomains) in cPanel

With cPanel 11, this has become very easy. Assuming that you have mod_proxy and mod_rewrite installed on your apache,

Go to WHM –> Tweak Settings –> Check the following settings


Add proxy VirtualHost to httpd.conf to automatically redirect unconfigured cpanel, webmail, webdisk and whm subdomains to the correct port (requires mod_rewrite and mod_proxy)

Automatically create cpanel, webmail, webdisk and whm proxy subdomain DNS entries for new accounts. When this is initially enabled it will add appropriate proxy subdomain DNS entries to all existing accounts. (Use /scripts/proxydomains to reconfigure the DNS entries manually)

Once enabled let the /scripts/proxydomains run and it will be enabled for all existing domains and new ones to be created. For a server with DNS cluster enabled, please refrain from enabling this, as it requires reload of those many zones of domains in the shared server at your DNS server.

Continue Reading

Howto move horde specific settings especially calendar, address box, notepad settings etc when moved from one cPanel server to another

How often you, as a sysadmin or LII support had this issue where a customer complains that his horde settings were not transferred from his old server to new one ? We had this issue many times.

Ben Thomas from cPanel has a script written for it, which I am sharing here. Weird fact is that you won’t see this anywhere in a cPanel server, not even in /scripts folder. So why wait ? download the file below and help your customers next time, the easy way :)

http://www.supportsages.com/blog/wp-content/uploads/2009/05/horde_settings_transferpl.gz

Usage is as below,

./horde_sql_transfer.pl -u <username> -d <data dir> -o <archive | restore>

Continue Reading

About this blog

This blog, acts as a knowledge repository for the world and is unofficial! Anything we find interesting in the cyber world will go here. Most cases, this blog will reflect the happiness of our staff in reaching successful solution to an issue (s)he worked on. A reference for other fellow SAGEs who come across similar issues later