6.0.0-git
2024-04-26

Diff for CentOS5InstallationNotes between 13 and 14

[[toc]]

+ ** Installing Horde Groupware Webmail Edition on CentOS 5 **


+ Installing Horde Groupware Webmail Edition on !CentOS 5

Horde Groupware Webmail Edition is a free, enterprise ready, browser based communication suite. Users can read, send and organize email messages and manage and share calendars, contacts, tasks and notes with the standards compliant components from the Horde Project. Horde Groupware Webmail Edition **bundles the separately available applications IMP, Ingo, Kronolith, Turba, Nag and Mnemo.**



||http://www.horde.org/webmail/||[http://www.horde.org/webmail/ Horde Groupware Webmail Edition] is a free, enterprise ready, browser based communication suite. Users can read, send and organize email messages and manage and share calendars, contacts, tasks and notes with the standards compliant components from the Horde Project. Horde Groupware Webmail Edition bundles the separately available applications IMP, Ingo, Kronolith, Turba, Nag and Mnemo.





++ Versions



* CentOS!CentOS 5.0 i386 (OS)

* Horde Groupware Webmail Edition 1.0.3 (October 2 2007)

* Apache 2.2.3 (http server)

* MySQL!MySQL 5.0.22 (db server)

* Postfix 2.3.3 (mail server)

* Dovecot 1.0 (IMAP)





++ Set up your host name and address (ONLY IF YOU DIDN'T DO IT AT INSTALLATION)



* USe



//This is only necessary if you didn't do it at installation.//



Use system-config-network-tui to set up IP, Netmask and Gateway:



<code>

system-config-network-tui

</code>





* Edit



Edit /etc/sysconfig/network and set your hostname:



<code>

NETWORKING=yes

NETWORKING_IPV6=yes

HOSTNAME=yourhostname.yourdomain.com

</code>





* EditEdit /etc/resolv.conf and add your DNS servers:



<code>

nameserver 208.67.222.222

nameserver 208.67.220.220

</code>





* Edit


Edit /etc/hosts to something like this, according to your system settings:



<code>

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1         localhost.localdomain        localhost

192.168.0.100     yourhostname.yourdomain.com  yourhostname

::1               localhost6.localdomain6      localhost6

</code>





* Restart



Restart network:



<code>

service network restart

</code>





* If



If your using GUI interface (like gnome), you may need to restart it:



<code>

init 6



++ Installing prerequisites



<code>

yum install -y gettext httpd mysql mysql-server dovecot postfix system-switch-mail perl



yum install -y php php-mysql php-xml php-imap php-mbstring php-mcrypt php-pecl-Fileinfo php-pecl-memcache php-pear-DB\ 

               php-pear-DB php-pear-File php-pear-Log php-pear-Mail-Mime php-pear-Auth-SASL php-pear-Date php-pear-HTTP-Request\ 

               php-pear-HTTP-Request php-pear-Mail php-pear-Net-Sieve php-pear-Net-Socket php-pear-Net-SMTP

</code>





++ Configuring Postfix and Dovecot



* TurnTurn off sendmailsendmail:



<code>

service sendmail stop

chkconfig sendmail off



system-switch-mail

(select postfix)

</code>



* Configure postfix



Configure Postfix and dovecotDovecot:



<code>

postconf -e 'home_mailbox = Maildir/'

</code>



* Edit



Edit /etc/dovecot.conf and add the following to the end of the file:



<code>

# to allow the creation of mail subfolders

namespace private {

separator = /

prefix = ""

inbox = yes

}



# Enable IMAP protocol

protocols = imap

</code>



* ToTo configure the rest of postfix, such as domain name and secure connections, take a look at this nice tutorial: http://fedorasolved.org/server-solutions/postfix-mail-server




||http://fedorasolved.org/server-solutions/postfix-mail-server||



++++ Start services



<code>

service httpd restart

chkconfig httpd on


service postfix restart

chkconfig postfix on



service mysqld restart

chkconfig mysqld on

</code>



* Configure



Configure mysqld root password:



<code>

/usr/bin/mysqladmin -u root password 'new-password'

</code>





++ Download Horde G. W.Groupware Webmail Edition and extract it



* Get



Get the latest stable version of Horde Groupware Webmail Edition:



||http://www.horde.org/download/app/?app=webmail||



* ExtractEdition from http://www.horde.org/download/app/?app=webmail.



Extract files and rename folderfolder:



<code>

tar zxf horde-webmail-*.tar.gz -C /var/www/html/

mv /var/www/html/horde-*/ /var/www/html/horde/

</code>





++ Creating database and tables in MySQL



*!MySQL



+++ Run the setup.php script:




<code>

cd /var/www/html/horde/scripts/

./setup.php

</code>

<code>

cd /var/www/html/horde/scripts/

./setup.php

</code>



If asked, choose /horde.



Press 1; choose mysql; Persistent connection: 0; Username horde; Choose a password for mysql-user-horde; Unix sockets; Location null; DB name horde; 



Press 2; yes; root; root-mysql-password.



Press 3; specify an existing IMAP user to have horde administration permissions (i.e. your current linux user).



* Create user horde in MySQL and grant horde DB permissions



PS: Apparently, this should be done by ./setup.php script. So it's better to check out if the user and permission already exists. If not:

If asked, choose /horde.



Press 1; choose mysql; Persistent connection: 0; Username horde; Choose a password for mysql-user-horde; Unix sockets; Location null; DB name horde; 



Press 2; yes; root; root-mysql-password.



Press 3; specify an existing IMAP user to have horde administration permissions (i.e. your current linux user).



+++ Create user horde in !MySQL and grant horde DB permissions



PS: Apparently, this should be done by ./setup.php script. So it's better to check out if the user and permission already exists. If not:



Edit a text file and change the password for the same as in Step 1 above:



<code>

USE mysql;



REPLACE INTO user (host, user, password)

    VALUES (

        'localhost',

        'horde',

Edit a text file and change the password for the same as in Step 1 above:



<code>

USE mysql;



REPLACE INTO user (host, user, password)

    VALUES (

        'localhost',

        'horde',

-- IMPORTANT: Change this password!

        PASSWORD('passwordformysquserhorde')


                 delete_priv, create_priv, drop_priv, index_priv)

    VALUES (

        'localhost',


        'Y', 'Y', 'Y', 'Y',

        'Y', 'Y', 'Y'

);


-- Make sure that priviliges are reloaded.

FLUSH PRIVILEGES;

</code>



<code>

mysql --user=root --password=mysqlrootpassword < createuser.mysql

</code>





++ Configure Apache and PHP



* Add



Add a "horde.conf" file to /etc/httpd/cond.d:



<code>

#

# Horde

#



Alias /horde /var/www/html/horde



<Directory /var/www/html/horde>

	# Uncomment the following 3 lines to make Horde locally accessible only

	#Order Deny,Allow

	#Deny from all

	#Allow from 127.0.0.1



	Options +FollowSymLinks



	# horde.org's recommended PHP settings:

	php_admin_flag safe_mode off

	php_admin_flag magic_quotes_runtime off

	php_flag session.use_trans_sid off

	php_flag session.auto_start off

	php_admin_flag file_uploads on

	# Optional - required for weather block in Horde to function

	php_admin_flag allow_url_fopen on



	# If horde dies while trying to handle large email file attachments,

	#  you are probably hitting PHP's memory limit.  Raise that limit here,

	#  but use caution

	# Set to your preference - memory_limit should be at least 32M

	#  and be greater than the value set for post_max_size

	php_value memory_limit 32M

	php_value post_max_size 20M

	php_value upload_max_filesize 10M



	# /usr/share/pear is needed for PEAR. /var/www/html/horde is needed for Horde itself

	# TODO: Set an appropriate include_path, too. Might even increase speed a bit.

	php_admin_value open_basedir "/var/www/html/horde:/var/www/html/horde/config:/usr/share/pear:/tmp"

	php_admin_flag register_globals off

</Directory>



<Directory /var/www/html/horde/config>

	Order Deny,Allow

	Deny from all

</Directory>



# Deny access to files that are not served directly by the webserver

<DirectoryMatch "^/var/www/html/horde/(.*/)?(config|lib|locale|po|scripts|templates)/(.*)?">

	Order Deny,Allow

	Deny from all

</DirectoryMatch>



# Deny access to the test.php files except from localhost

<LocationMatch "^/horde/(.*/)?test.php">

	Order Deny,Allow

	Deny from all

	Allow from 127.0.0.1

</LocationMatch>

</code>



* ChangeChange horde.conf permission:



<code>

chmod 0644 -v /etc/httpd/conf.d/horde.conf 

</code>



Increase memory_limit option in /etc/php.ini to 32MB:


* Increase memory_limit option in /etc/php.ini to 32MB:

<code>

memory_limit = 32M

</code>



Restart httpd:


<code>

memory_limit = 32M

</code>





* Restart httpd:



<code>

service httpd restart

</code>


++ Check if everything is alright



* Open
Open the following address in your browser:



<code>

http://localhost.localdomain/horde/test.php

</code>





++ Security configuration



* SecureSecure config files:



<code>

chown apache:root -R /var/www/html/horde/config

chown apache:root -R /var/www/html/horde/*/config

chmod -R go-rwx /var/www/html/horde/config

chmod -R go-rwx /var/www/html/horde/*/config

</code>



* Secure



Secure scripts:



<code>

chown -R root:root /var/www/html/horde/scripts

chmod -R go-rwx /var/www/html/horde/scripts

chmod -R go-rwx /var/www/html/horde/*/scripts

</code>




Secure test.php:



<code>

chmod a-rwx /var/www/html/horde/test.php

chmod a-rwx /var/www/html/horde/*/test.php


* Secure test.php:</code>



<code>

chmod a-rwx /var/www/html/horde/test.php

chmod a-rwx /var/www/html/horde/*/test.php

</code>



++ Finishing configuration



* OpenOpen the following url in your browser and log into horde with the administrator user (defined above in Option 2 when creating databases)databases):



<code>

http://localhost.localdomain/horde

</code>



(PS: use full URL address, with host and domain name)



Fell free to change other options, as you like. The good thing about H G W EHorde Groupware Webmail Edition is it comes pretty much configured and ready for use!



* RememberRemember to restart httpd after you make changes:



<code>

service httpd restart

</code>