Tuesday, December 20, 2005

Deploying PHPGroupware ...


PhpGroupware Features

Web Based Email Interface(Supports IMAP/POP/IMAPs/POPs).

Calendar.
Global Address Book.
Task Management / Delegation.
Adding Notes Private/Public
To-do List.
News Reader.
File Sharing among Users


How to Implement it ?

First I download phpgroupware-0.9.16.010.tar

and untarred it in /var/www/html which is document root directory


set the permission of directory to 755

chmod -R 755 /var/www/html/phpgroupware

Create database phpgroupware
mysql> create database phpgroupware;
Query OK, 1 row affected (0.01 sec)

Created user/pass phpgroupware along with giving permission to access database phpgroupware :

mysql> grant all on phpgroupware.* to phpgroupware@localhost identified by "phpgroupware";
Query OK, 0 rows affected (0.23 sec)

Type the below in your browser
http://localhost/phpgroupware/setup

once i do this

Analysis
You appear to have MySQL support enabled
No Postgres-DB support found. Disabling
No Microsoft SQL Server support found. Disabling
No Oracle-DB support found. Disabling
No ODBC/SAPDB support found. Disabling
You appear to be using PHP4. Enabling PHP4 sessions support
It appears that you do not have IMAP Supprt. Imap Suuport has been disabled ###
Sample configuration not found. using built in defaults
Now guessing better values for defaults...

Imap support needs to be enabled as per their documentation

So I installed php-imap module using urpmi

[root@mybox html]# urpmi php-imap
medium "contrib" uses an invalid list file:
mirror is probably not up-to-date, trying to use alternate method

ftp://ftp.is.co.za/mirror/mandrivalinux/official/9.2/i586/Mandrake/RPMS/php-imap-4.3.2-3mdk.i586.rpm
installing /var/cache/urpmi/rpms/php-imap-4.3.2-3mdk.i586.rpm
Preparing... ##################################################
1:php-imap ##################################################

After installing I checked the modules under
[root@mybox apache2]# pwd
/usr/lib/apache2

It listed mod_imap.so*

To have IMAP support enabled

I added the module to apaches's httpd.conf /etc/httpd/conf/httpd.conf

LoadModule access_module modules/mod_imap.so


Now I refresh http://mybox.sriram.com//phpgroupware/setup/ in the browser and it shows Imap Support Enabled... you can see that below

Analysis
You appear to have MySQL support enabled
No Postgres-DB support found. Disabling
No Microsoft SQL Server support found. Disabling
No Oracle-DB support found. Disabling
No ODBC/SAPDB support found. Disabling
You appear to be using PHP4. Enabling PHP4 sessions support
You appear to have IMAP support enabled
Sample configuration not found. using built in defaults
Now guessing better values for defaults...


Just give chmod 777 permission to phpgroupware in /var/www/html/phpgroupware and it will add write button Just refresh the above url... since we need to add the file header.inc.php

There are 3 ways to add header.inc.php 1)Click Write Button2)click download button 3) view button copy and paste in the file header.inc.php

We choose write after giving 777 permission to directory /var/www/html/phpgroupware

Note it points to http://mybox.sriram.com//phpgroupware/setup/manageheader.php


Now Lets fill the phpGroupWare version Setup details :


Settings

Server Root
/var/www/html/phpgroupware

Include Root (this should be the same as Server Root unless you know what you are doing)
/var/www/html/phpgroupware

Admin password to header manager
header123


Persistent connections
True Do you want persistent connections (higher performance, but consumes more resources)

Sessions Type
PHP4 What type of sessions management do you want to use (PHP4 session management may perform better)?

Enable Mcrypt
False

MCrypt version
Set this to "old" for versions <>JPG->PNG


Host information

Enter the hostname of the machine on which this server is running: mybox.sriram.com

Enter your default FTP server:

Attempt to use correct mimetype for FTP instead of default 'application/octet-stream': No


Datetime port.
If using port 13, please set firewall rules appropriately before submitting this page.
(Port: 13 / Host: 129.6.15.28) 00(disable/recommended)



Enter your HTTP proxy server Blank

Enter your HTTP proxy server port: Blank

Enter the site username for peer servers. Blank

Enter the site password for peer servers. Blank




Authentication / Accounts SQL
Select which type of authentication you are using: SQL
Select where you want to store/retrieve user accounts:
Minimum account id (e.g. 500 or 1000, etc.)*:
Maximum account id (e.g. 65535 or 1000000):
Minimum group id (e.g. 100 or 500, etc.) - should not overlap with account ids*}:

Maximum group id (e.g. 499 or 999) - should not overlap with account ids*:
Auto create account records for authenticated users: No
Auto-created user accounts expire: One Week
Add auto-created users to this group ('Default' will be attempted if this is empty.):
If no ACL records for user or any group the user is a member of: Deny Access


Note : whereever I have not filled Information is all blank



If using LDAP:
Do you want to manage homedirectory and loginshell attributes?: No
LDAP Default homedirectory prefix (e.g. /home for /home/username):
LDAP Default shell (e.g. /bin/bash):
LDAP host:
LDAP accounts context:
LDAP groups context:
LDAP rootdn:
LDAP root password:
LDAP encryption type: DES





Mcrypt Settings (requires mcrypt PHP extension)
Enter some random text for app session encryption:
Mcrypt algorithm (default TRIPLEDES): TRIPLEDES
Mcrypt mode (default CBC): CBC

Additional settings
Select where you want to store/retrieve filesystem information:
(file type, size, version, etc.) SQL
Select where you want to store/retrieve file contents:
(Recommended: Filesystem) Filesystem

Click Here to setup an admin account and (optionally) 3 demo accounts.
This will delete all existing accounts




Step 3 - Language Management

Click Manage Languages

Select Delete all old languages and install new ones - Click Install

Step 4 - Advanced Application Management

This is needed if you need to remove/add appalications later.

Please Note All the 4 steps should have a tick which means you have completed their instructions.

Click Logout




Now


2) Header Admin Login

This will have same settings that we configured in the beginning

http://mybox.sriram.com/phpgroupware/setup/manageheader.php


Analysis
You appear to have MySQL support enabled
No Postgres-DB support found. Disabling
No Microsoft SQL Server support found. Disabling
No Oracle-DB support found. Disabling
No ODBC/SAPDB support found. Disabling
You appear to be using PHP4. Enabling PHP4 sessions support
It appears that you do not have IMAP Supprt. Imap Suuport has been disabled ###
Sample configuration not found. using built in defaults
Now guessing better values for defaults...


ETC ....


One important I also changed the /etc/php.ini

register_globals = On

In the beginning I had set it to off and now back to On after faing some problems

Anytime you forgetor face any problem I recommend changing the

[root@mybox phpgroupware]# pwd
/var/www/html/phpgroupware
[root@mybox phpgroupware]#

[root@mybox phpgroupware]# mv header.inc.php header.inc.php.old

and running http://mybox.sriram.com/phpgroupware/setup in the browser for new setup

You might have forgot to add or missed some details.



Please Take care of the permissions Later once you familiar with all this.

Now you can login with the account created :

http://mybox.sriram.com/phpgroupware/login.php
srirams
srirams

Once you Implement this make sure you have set up the Email settings for it to work.


Some additional PhpGroupware Information - FAQ

How To set up smtp-auth ? Note : you don't have a web based for this

Solution: phpGroupware as basic support for SMTP Auth in that you can set a single username and password so the whole phpGroupWare install to use when sending email.

  1. Edit /var/www/html/phpgroupware/email/inc/class.mail_send.inc.php
  2. Search for "$smtp_auth_login_required". Should be around line 209.
  3. Change False to True and set the username and password in the $mylogin and $mypassword variables respectivly.
  4. Save the file and send an email. The changes will take effect immediatly for all phpGroupWare users.

How to use a different port for imap instead of default 143 ?

open file > /var/www/html/email/inc/class.mail_msg_base.inc.php

$mail_port = 143


Change it to whatever your non standard port is

eg.
$mail_port = 8143



When is it scheduled to check mails ?

Default is 4 minutes .. I am told this will come in user preference until then

Step 1.

In email/inc/class.boindex.inc.php delete the ,240000 in the $this->xi['auto_refresh_widget'] line (line 368). That number forces the default to be 4 minutes (240000 milliseconds)

Step 2.

In email/inc/class.html_widgets.inc.php find:

function auto_refresh($reload_me=, $feed_refresh_ms=)

{

and add

$GLOBALS['phpgw']->msg->set_pref_value('refresh_ms', 10*60*1000 );

// change the number to your desired refresh time in milliseconds (example is 10 minutes)

// use 0 (zero) to disable the refresh

You're done.

By the way, if you want to manually refresh the INBOX contents, you can just click on the email icon in the navbar.









Installing and configuring IMAP

[root@mybox urpmi]# urpmi imap
medium "contrib" uses an invalid list file:
mirror is probably not up-to-date, trying to use alternate method

ftp://ftp.is.co.za/mirror/mandrivalinux/official/9.2/i586/Mandrake/RPMS/imap-2002d-6mdk.i586.rpm

100% of 2246k completed, ETA = 0:00:00, speed = 2294 installing /var/cache/urpmi/rpms/imap-2002d-6mdk.i586.rpm
Preparing... ##################################################
1:imap ##################################################

[root@mybox urpmi]#

This will install but wont accept imap connection to port 143

[root@mybox xinetd.d]# telnet localhost 143
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused
[root@mybox xinetd.d]#

Got to
[root@mybox xinetd.d]# pwd
/etc/xinetd.d


[root@mybox xinetd.d]# cat imap
# default: off
# description: The IMAP service allows remote users to access their mail using # an IMAP client such as Mutt, Pine, fetchmail, or Netscape # Communicator.
service imap
{
socket_type = stream
wait = no
user = root
server = /usr/sbin/imapd
log_on_success += DURATION USERID
log_on_failure += USERID
disable = no
}
[root@mybox xinetd.d]#


Change the disable from yes to no and restart inetd/xinetd services.

Note : xinetd or inetd service is required to start imap service.

If that is not installed you will need to install it.