Koozali.org: home of the SME Server

[HOW TO] Install eGroupWare on SME 7.x

Offline cool34000

  • *
  • 339
  • +0/-0
[HOW TO] Install eGroupWare on SME 7.x
« on: January 07, 2007, 09:11:40 AM »
I take advantage of the release of a new version of eGroupWare (v1.2.106-2) to provide a howto to script its installation.

First of all, download necessary files here and here

Create a folder in /root nammed 'egroupware'

Copy the 2 downloaded files into /root/egroupware

Create a file /root/egroupware/98egroupware with :
Code: [Select]

# eGroupWare
Alias /egroupware /opt/egroupware/html
<Directory /opt/egroupware/html>
SSLRequireSSL on
AddType application/x-httpd-php .php .php3 .phtml
Options Indexes +Includes FollowSymLinks
AllowOverride all
order deny,allow
deny from all
allow from all
php_flag magic_quotes_gpc on
php_flag track_vars on
php_flag register_globals off
php_admin_value phpa on
php_admin_value eaccelerator.enable 1
php_admin_value display_errors 0
php_admin_value mbstring.func_overload 7
</Directory>

This template allows access from anywhere (global). https mode is enabled.

Create a file /root/egroupware/60redir-egroupware with :
Code: [Select]

{

if ($port ne "443")

{

$OUT .= <<'HERE';


## Redirect Web Address to Secure Address


RewriteEngine on

RewriteRule ^/egroupware https://%{HTTP_HOST}/egroupware


## End Of Redirect


HERE


}

}
This template redirect automatically http to https for access to eGroupWare

Create a file /root/egroupware.sh with :
Code: [Select]
#!/bin/sh


echo "-------------------------------------------------------------------"
echo "Installation of eGroupWare (public access, automatic https mode)..."
echo "-------------------------------------------------------------------"


DOMAINE=$(db configuration get DomainName)


echo "Generating password..."
passok=0
while [ "$passok" != "1" ] ; do
openssl genrsa 32 > /root/pass.txt
pass=$(grep -v "PRIVATE KEY" < /root/pass.txt)
echo test > /root/pass.txt
sed -e "s/test/$pass/" /root/pass.txt >/root/pass.new
passok=$(grep -c $pass < /root/pass.new)
done
egwpass=$pass
echo "Password is : $egwpass"
rm -f /root/pass.txt
rm -f /root/pass.new


echo "Creating Data bases..."
mysqladmin -u root create egroupware
echo "Creating mysql user..."
mysql -e " grant select, insert, update, delete, create, drop, index, alter on egroupware.* \
to 'egroupware'@'localhost' \
identified by '$egwpass' "
mysqladmin flush-privileges


echo "Decompressing files..."
mkdir -p /opt/egroupware/backup
mkdir -p /opt/egroupware/files
mkdir -p /opt/egroupware/tmp
unzip -q /root/egroupware/eGroupWare-1.2.106-2.zip -d /opt/egroupware
unzip -qo /root/egroupware/eGroupWare-contrib-1.2.106-2.zip -d /opt/egroupware
mv -f /opt/egroupware/egroupware /opt/egroupware/html
mv -f /opt/egroupware/html/sitemgr/sitemgr-link /opt/egroupware/html/


echo "Cleaning installed modules..."
rm -rf /opt/egroupware/html/phpsysinfo
rm -rf /opt/egroupware/html/phpldapadmin


echo "Setting file access rules :"
cd /opt
echo "   - Changing owner recursivly..."
chown -R root:www /opt/egroupware
echo "   - Recursive CHMOD 550 on folders..."
find egroupware -type d -exec chmod 550 {} \;
echo "   - Recursive CHMOD 440 on files..."
find egroupware -type f -exec chmod 440 {} \;
echo "   - Customization of CHMOD for a few folders..."
chmod -R 770 /opt/egroupware/files
chmod -R 770 /opt/egroupware/backup
chmod -R 770 /opt/egroupware/tmp
chmod -R 770 /opt/egroupware/html/fudforum
chmod 770 /opt/egroupware/html/phpgwapi/images
touch /opt/egroupware/html/header.inc.php
chown www /opt/egroupware/html/header.inc.php
chmod 600 /opt/egroupware/html/header.inc.php


echo "Adding templates..."
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts
cp /root/egroupware/60redir-egroupware /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/
cp /root/egroupware/98egroupware /etc/e-smith/templates/etc/httpd/conf/httpd.conf/
expand-template /etc/httpd/conf/httpd.conf
service httpd-e-smith restart
echo


echo "-------------------------------------------------------------------------------"
echo "Installation completed, you must finish the installation of eGroupWare website."
echo "Please go to https://$DOMAINE/egroupware"
echo "-------------------------------------------------------------------------------"
echo
echo
echo "Reminder :"
echo "         - Website open globally"
echo "         - https mode enabled with automatic redirection"
echo
echo "         - eGroupware is installed in the folder : /opt/egroupware/html"
echo "         - tmp folder path is                    : /opt/egroupware/tmp"
echo "         - backup folder path is                 : /opt/egroupware/backup"
echo "         - files folder path is                  : /opt/egroupware/files"
echo
echo "         - MySQL database name is                : egroupware"
echo "         - MySQL username is                     : egroupware"
echo "         - MySQL user password is                : $egwpass"
echo "-------------------------------------------------------------------------------"

Now the only thing you have to do is
Code: [Select]
# sh egroupware.shand eGroupWare installs automatically.
A random password is generated for MySQL user, please note the informations given by the script and finish eGroupWare installation.


edit : added setup howto


you should be able to go to https://yourdomain.com/egroupware

Here what I do set at header admin stage :
Quote
Server root : /opt/egroupware/html
Include root : /opt/egroupware/html
Admin user for header manager : admin
Admin password to header manager : my_password
Limit access to setup to the following addresses, networks or hostnames (e.g. 127.0.0.1,10.1.1,myhost.dnydns.org) :
Persistent connections : yes
Sessions Type : php
Enable MCrypt : no
MCrypt version :
MCrypt initialization vector :
Domain select box on login : no
Database instance (eGW domain) : mydomain.com
DB Type : MySQL
DB Host : localhost
DB Port : 3306
DB Name : egroupware
DB User : egroupware
DB Password : my_db_password <-- the one given by the script !
Configuration User : admin
Configuration Password : my_password
Then write config and continue and login at Setup/Config Admin
Click on Install all applications
When done, click on Re-Check the installation
Then click on Edit current configuration
Quote
Enter the full path for temporary files : /opt/egroupware/tmp
Enter the full path for users and group files : /opt/egroupware/files
Enter the full path to the backup directory: /opt/egroupware/backup
Enter the location of eGroupWare's URL : /egroupware
Image type selection order : PNG->JPG->GIF
Enter the hostname of the machine on which this server is running : mydomain.com
Enter your default FTP server : localhost
Attempt to use correct mimetype for FTP instead of default 'application/octet-stream' : No
Enter your HTTP proxy server :
Enter your HTTP proxy server port :
Enter your HTTP proxy server username :
Enter your HTTP proxy server password :
POP/IMAP mail server hostname or IP address : localhost
Mail server protocol : IMAP
Mail server login type : standard
Mail domain (for Virtual mail manager) :
SMTP server hostname or IP address : localhost
SMTP server port : 25
User for SMTP-authentication (leave it empty if no auth required) :
Password for SMTP-authentication :
Select which type of authentication you are using : SQL/SSL
Select where you want to store/retrieve user accounts : SQL
SQL encryption type for passwords (default - md5) : MD5
Allow authentication via cookie : Yes
Auto login anonymous user : No
Allow password migration : No
Allowed migration types (comma-separated) :
Minimum account id (e.g. 500 or 100, etc.) :
Maximum account id (e.g. 65535 or 1000000) :
User account prefix :
Usernames are casesensitive : No
Auto create account records for authenticated users : No
Auto-created user accounts expire : never
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
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 search filter for accounts, default: "(uid=%user)", %domain=eGW-domain :
LDAP groups context :
LDAP rootdn (searching accounts and changing passwords) :
LDAP root password :
LDAP encryption type : DES
Enable LDAP Version 3 : No
Host/IP Domain controler :
Domain name :
Enter some random text for app session encryption :
Mcrypt algorithm (default TRIPLEDES) : TRIPLEDES
Mcrypt mode (default CBC) : CBC
Select where you want to store/retrieve filesystem information : SQL version 2 (EXPERIMENTAL, required and works only with FilesCenter)  
Select where you want to store/retrieve file contents : Filesystem
And then click on save
Finally, create the admin account... Installation is finished !
Click on Back to user login and login with the admin account you've created !!!


I've tested many modules and I have to say that all worked for me !

Work well in collaboration !!!


The french version of this howto can be seen here

Offline fpausp

  • *
  • 728
  • +0/-0
[HOW TO] Install eGroupWare on SME 7.x
« Reply #1 on: January 10, 2007, 03:52:39 PM »
Thanks  :D

fpausp
Viribus unitis

Offline cool34000

  • *
  • 339
  • +0/-0
[HOW TO] Install eGroupWare on SME 7.x
« Reply #2 on: January 10, 2007, 09:06:07 PM »
I forgot to say to CHMOD header.inc.php to 400 (read only for root) AFTER the install is done for security reasons...
Code: [Select]
chmod 400 /opt/egroupware/html/header.inc.phpThis should be better !

I'm also digging the fact that mysql user should have LOCK permission for its database... Will tell here if needed.

Offline Amir Inbar

  • *
  • 113
  • +0/-0
    • http://www.sheroot.net
[HOW TO] Install eGroupWare on SME 7.x
« Reply #3 on: January 14, 2007, 08:18:50 AM »
what do i have to do AFTER the install and the setup completes ?
I get an empty page and beeing redirected to setup after i write the config at the setup page.
......

Offline cool34000

  • *
  • 339
  • +0/-0
[HOW TO] Install eGroupWare on SME 7.x
« Reply #4 on: January 14, 2007, 11:09:16 AM »
Quote from: "amir"
what do i have to do AFTER the install and the setup completes ?
I get an empty page and beeing redirected to setup after i write the config at the setup page.
I've modified the howto and added howto for the 2 next setup stages. Just take a look at it.

Offline Amir Inbar

  • *
  • 113
  • +0/-0
    • http://www.sheroot.net
[HOW TO] Install eGroupWare on SME 7.x
« Reply #5 on: January 14, 2007, 08:57:54 PM »
@cool34000 :

Worked like charm ..

Thank you.

I have another problem though, related to Hebrew characters - i use UTF-8 as the basic encoding but some of the mail messages show scrambled and some messages are shown with whiped out text - mainly messags that were written in Hebrew.

Do you know how to solve that ?

Another question : is there a known solution for syncing eGroupWare with outlook without the need to accept security warnings ?
......

Offline cool34000

  • *
  • 339
  • +0/-0
[HOW TO] Install eGroupWare on SME 7.x
« Reply #6 on: January 14, 2007, 09:13:20 PM »
Don't know, sorry... I'm discovering eGroupWare !
You should try http://www.egroupware.org/ for further support/questions

straubd

Server-manager and other ibays missing after egroupware inst
« Reply #7 on: January 14, 2007, 09:32:42 PM »
Help - I followed the directions as outlined, ran the egroupware.sh installation script and now none of my previous ibays, http://server/server-manager and https://server/egroupware can be accessed. I've rebooted the server and have restarted the httpd services with no success.

The primary ibay is the only one that is accessible.

What am I doing wrong here?

Offline Amir Inbar

  • *
  • 113
  • +0/-0
    • http://www.sheroot.net
[HOW TO] Install eGroupWare on SME 7.x
« Reply #8 on: January 14, 2007, 09:39:04 PM »
@ straubd :

watch out for lines being copied-pasted incorrectly from browser to pico.
......

straubd

[HOW TO] Install eGroupWare on SME 7.x
« Reply #9 on: January 14, 2007, 10:15:47 PM »
Did that, same results. However, the following errors have occured in the template section of the script.

ERROR in /etc/e-smith/templates-custom//etc/httpd/conf/httpd.conf/VirtualHosts/60redir-egroupware: Program fragment delivered error <<Can't find string terminator "
HERE" anywhere before EOF at /etc/e-smith/templates-custom//etc/httpd/conf/httpd.conf/VirtualHosts/60redir-egroupware line 4.>> at template line 1
WARNING in /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts: ERROR: Template processing failed for //etc/httpd/conf/httpd.conf/VirtualHosts: 1 fragment generated errors
 at /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts line 38
WARNING in /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts: Use of uninitialized value in concatenation (.) or string at /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts line 38.
ERROR in /etc/e-smith/templates-custom//etc/httpd/conf/httpd.conf/VirtualHosts/60redir-egroupware: Program fragment delivered error <<Can't find string terminator "
HERE" anywhere before EOF at /etc/e-smith/templates-custom//etc/httpd/conf/httpd.conf/VirtualHosts/60redir-egroupware line 4.>> at template line 1
WARNING in /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts: ERROR: Template processing failed for //etc/httpd/conf/httpd.conf/VirtualHosts: 1 fragment generated errors
 at /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts line 38
WARNING in /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts: Use of uninitialized value in concatenation (.) or string at /etc/e-smith/templates//etc/httpd/conf/httpd.conf/80VirtualHosts line 38.
WARNING: Template processing succeeded for //etc/httpd/conf/httpd.conf: 4 fragments generated warnings
 at /sbin/e-smith/expand-template line 45

Offline cool34000

  • *
  • 339
  • +0/-0
[HOW TO] Install eGroupWare on SME 7.x
« Reply #10 on: January 15, 2007, 12:31:00 AM »
Please be careful on the beginning and on the ending of templates files :
They have blank lines !!!
Verify your templates and expand templates then restart service.

Offline Amir Inbar

  • *
  • 113
  • +0/-0
    • http://www.sheroot.net
[HOW TO] Install eGroupWare on SME 7.x
« Reply #11 on: January 15, 2007, 07:07:47 AM »
Quote from: "cool34000"

Don't know, sorry... I'm discovering eGroupWare !
You should try http://www.egroupware.org/ for further support/questions


Thank you anyway - greate script !
......

Offline daniel

  • ***
  • 146
  • +0/-0
  • Platinum Sponsor
    • http://www.charton-mgmt.com
Funambol sync
« Reply #12 on: January 15, 2007, 01:28:59 PM »
I've been working with egroupware since version 102 and have had the outlook sync working using the syncml or funambol clients.   I followed the script on a new test server but am unable to get the sync working.  I verified xmlrpc was turned on in egroupware admin setup.  My setup includes php5 and mysql5 all of which I had working on egroupware 105 for testing.

Has anyone else had an issue with it not working?

PS  thanks for the script

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
[HOW TO] Install eGroupWare on SME 7.x
« Reply #13 on: January 15, 2007, 04:52:37 PM »
Yes, I get XML-RPC Fault:9999 when visiting the Filescenter:
Code: [Select]
PHP Fatal error:  Call to a member function on a non-object in /opt/egroupware/html/xmlrpc/testsuite.php on line 58


I also get:

Code: [Select]
PHP Warning:  imap_open(): Couldn't open stream {localhost:143}INBOX in /opt/egroupware/html/email/inc/class.mail_dcom_imap.inc.php on line 214
When trying the email.

Using the default PHP and MySQL from SME.

Thanks,

Offline cool34000

  • *
  • 339
  • +0/-0
[HOW TO] Install eGroupWare on SME 7.x
« Reply #14 on: January 16, 2007, 10:41:46 AM »
Quote from: "stuntshell"
Yes, I get XML-RPC Fault:9999 when visiting the Filescenter:
Code: [Select]
PHP Fatal error:  Call to a member function on a non-object in /opt/egroupware/html/xmlrpc/testsuite.php on line 58


I also get:

Code: [Select]
PHP Warning:  imap_open(): Couldn't open stream {localhost:143}INBOX in /opt/egroupware/html/email/inc/class.mail_dcom_imap.inc.php on line 214
When trying the email.

The 1st error you see is because xmlrpc service is not enabled in eGroupWare. In the admin panel, configure your site to enable xmlrpc service and FileCenter will work !

For the 2nd error you see, you should use in eGroupWare same users and passwords as SME accounts. It works perfectly !

I know eGroupWare is able to work with LDAP authentification, still don't know how to make this works but hope I'll be able soon to give a simple howto here (unless someone already knows how to make this working)