Installing Horde in Direct Admin

You can use the following steps to install Horde in a Direct Admin server.

1. First check whether IMAP module is enabled in PHP, if not recompile PHP with IMAP support.

$ vi /usr/local/directadmin/custombuild/configure/ap2/configure.php5

Add the following entries.
–with-imap=/usr/local –with-imap-ssl

$ /usr/local/directadmin/custombuild/build php n

If you are doing the installation in a VPS, sometimes you might get the following error:

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.

To fix this error install the libc-client-devel package

$ yum -y install libc-client-devel.i386 rpm

Now download the horde install script for DirectAdmin and install it.

$ wget http://www.fusion-ict.nl/da_plugin/horde_install.tar.gz
$ tar -zxvf horde_install.tar.gz
$ sh horde_install/horde_install.sh

This will install Horde in the server. Now you can access the Horde webmail using the URL http://domain.com/horde

If you get the following error when accessing Horde through browser,

A fatal error has occured DB Error: connection failed PASSWORD:

then do the following:

$ mysql
mysql > grant all privileges on da_horde.* to da_horde@localhost identified by “PASSWORD”;
mysql > flush privileges;
mysql >\q

3. If you would like to access the Horde using the URL http://webmail.domain.com/ do the following :

First add an A record for webmail.domain.com. Then add the following VirtualHost entry in the /etc/httpd/conf/extra/httpd-vhosts.conf file and restart httpd service.

$ vi /etc/httpd/conf/extra/httpd-vhosts.conf

<VirtualHost IP1:80 \
IP2:80>
ServerName webmail
ServerAlias webmail.*
DocumentRoot /var/www/html/horde

$ service httpd restart

How to Change Hostname in a Debian Server?

Changing the Hostname in a Debian Server

Debian based systems use the file /etc/hostname to read the hostname of the system at boot time and set it up using the init script /etc/init.d/hostname.sh. So on a Debian based system we can edit the file /etc/hostname and change the name of the system and then execute the following, to make the change active.

/etc/init.d/hostname.sh start

The hostname saved in this file (/etc/hostname) will be preserved on system reboot (and will be set using the same script used hostname.sh).

Remote access to pgsql database.

In order to access the pgsql database remotely, you need to make following changes in the server.

1) Open the Port 5432 in the server.

iptables -A INPUT -p tcp –dport 5432 -j ACCEPT
service iptables restart

2) Edit the Pgsql configuration file (postgresql.conf).

vi /var/lib/pgsql/data/postgresql.conf

Make the following changes

tcpip_socket = true
port = 5432

3) Edit PostgreSQL HOST ACCESS CONTROL FILE ( pg_hba.conf)

This file controls what hosts are allowed to connect to what databases and specifies some options on how users on a particular host are identified. It is read each time a host tries to make a connection to a database.

vi /var/lib/pgsql/data/pg_hba.conf

Add the machine IP address from which database is accessing remotely.

# TYPE DATABASE IP_ADDRESS MASK AUTH_TYPE
AUTH_ARGUMENT

local all trust
host all 127.0.0.1 255.255.255.255 trust
host all 192.168.0.1 255.255.255.255 trust

Second line allows any user on the local system to connect to any # database under any username.

Here the IP address 192.168.0.1 has been added, to allow users from 192.168.0.1 host to connect to any database.

Post PostgreSQL Installation

After installation of PostgreSQL start PostgreSQL by executing the command to see if the installation worked.

/etc/init.d/postgresql start

In the file ‘/var/lib/pgsql/data/pg_hba.conf’, replace all entries of “ident sameuser” with “trust”.

In the file ‘/var/lib/pgsql/data/postgresql.conf’, change the line “max_connections=100″ to max_connections=500″.

Restart PostgreSQL.

/etc/init.d/postgresql stop
/etc/init.d/postgresql start

Pgsql query failed

Pgsql query failed

If you are getting the error as follows.

Warning: pg_query() [function.pg-query]: Query failed: ERROR: permission denied for relation cg_ref_codes in /home/user/public_html/xxx.php on line 48
Warning: pg_num_rows(): supplied argument is not a valid PostgreSQL result resource in /home/user/public_html/xxxx.php on line 50

Resolution

1. Open the pgsql configuration file.

vi /var/lib/pgsql/data/pg_hba.conf
local all all md5
host all all 127.0.0.1 255.255.255.255 md5

The file need to change as follows
local all all md5
host all all 127.0.0.1 255.255.255.255 password

2. Save the file and restart pgsql.

/etc/init.d/postgresql stop
/etc/init.d/postgresql start

« Prev - Next »