Egroupware on SME8 with Subversion
As I want to apply updates on EGW when needed, the rpm install is not my preferred one.
I also want to...
- access EGW by calling a subdomain like "egroupware.mydomain.com",
- use either WGW 1.6 or 1.7, 1.8
- store files on a webdav drive
Update for egw 1.8
# mysql database pw must be very strong mypasswd=z5if....ofjfjf
mkdir -p /opt/egw/1.8/userdata/{tmp,files,backup}
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts
mkdir -p /etc/e-smith/templates-custom/etc/php.ini
mysql -e "CREATE DATABASE egroupware;"
mysql -e "GRANT ALL ON egroupware.* TO egroupware@localhost IDENTIFIED BY '$mypasswd';"
mysql -e "FLUSH PRIVILEGES"
mkdir /root/egroupware
cd /root/egroupware
wget http://logicielslibres.sophieromano.com/system/files/20IbayContent.txt
wget http://logicielslibres.sophieromano.com/system/files/98egroupware.txt
wget http://logicielslibres.sophieromano.com/system/files/egwupdate.txt
wget http://logicielslibres.sophieromano.com/system/files/svnupdateperms.txt
wget http://logicielslibres.sophieromano.com/system/files/81timez.txt
# edit your timezone
nano 20IbayContent.txt
# edit path
nano 98egroupware.txt# edit path and trunk nano egwupdate.txt
# edit path nano svnupdateperms.txt
cp 20IbayContent.txt /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent cp 98egroupware.txt /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/98egroupware cp 81timez.txt /etc/e-smith/templates-custom/etc/php.ini/81timez cp egwupdate.txt /opt/egw/1.8/egwupdate cp svnupdateperms.txt /opt/egw/1.8/svnupdateperms chmod u+x /opt/egw/1.8/egwupdate chmod u+x /opt/egw/1.8/svnupdateperms chown -R www:www /opt/egw/1.8/userdata chmod -R 770 /opt/egw/1.8/userdata/files chmod -R 770 /opt/egw/1.8/userdata/backup chmod -R 770 /opt/egw/1.8/userdata/tmp # Edit URL first MYDOMAIN=egroupware.yourdomain.org # Edit path to egw MYFOLDER=egw/1.8/egroupware # Make Domain point to path db domains set $MYDOMAIN domain db domains setprop $MYDOMAIN Nameservers internet db domains setprop $MYDOMAIN Content $MYFOLDER db domains setprop $MYDOMAIN WebApp yes signal-event domain-create $MYDOMAIN # add repo smecontribs db yum_repositories \ setprop smecontribs \ MirrorList http://distro.ibiblio.org/pub/linux/distributions/smeserver/mirrorlist/s... signal-event yum-modify yum -y install subversion yum -y install smeserver-mod_dav --enablerepo=smecontribs pear install XML_Feed_Parser cd /opt/egw/1.8 touch /opt/egw/1.8/svnupdate_u.txt /opt/egw/1.8/egwupdate /opt/egw/1.8/svnupdateperms expand-template /etc/httpd/conf/httpd.conf sv t httpd-e-smith # after egw setup: mv /opt/egw/1.8/egroupware/header.inc.php /opt/egw/1.8 ln -s /opt/egw/1.8/header.inc.php /../header.inc.php chmod 644 /opt/egw/1.8/header.inc.php
So here is how I do it...
1. Create folders:
Folders used for EGW, httpd.conf and php
mkdir -p /opt/egw/1.6/userdata{tmp,files,backup}
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts
mkdir -p /etc/e-smith/templates-custom/etc/php.ini
2. Create database
Watch out for your password here...
mypasswd='!very-$-strong-$-password!not-.-like-.-123456!' mysql -e "CREATE DATABASE egroupware;" mysql -e "GRANT ALL ON egroupware.* TO egroupware@localhost IDENTIFIED BY $mypasswd;" mysql -e "FLUSH PRIVILEGES"
3. Copy files to folders and set permissions
Download attached files to your system and place them on the server. Then set rigths for them.
Note that the file "20IbayContent" is modified to accomodate a different home directory for webapps: /opt
mkdir /root/egroupware cd /root/egroupware wget http://logicielslibres.sophieromano.com/system/files/20IbayContent.txt wget http://logicielslibres.sophieromano.com/system/files/98egroupware.txt wget http://logicielslibres.sophieromano.com/system/files/egwupdate.txt wget http://logicielslibres.sophieromano.com/system/files/svnupdateperms.txt wget http://logicielslibres.sophieromano.com/system/files/81timez.txt
cp 20IbayContent.txt /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent cp 98egroupware.txt /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/98egroupware cp 81timez.txt /etc/e-smith/templates-custom/etc/php.ini/81timez cp egwupdate.txt /opt/egw/1.6/egwupdate cp svnupdateperms.txt /opt/egw/1.6/svnupdateperms
and edit permissions:
chmod u+x /opt/egw/1.6/egwupdate chmod u+x /opt/egw/1.6/svnupdateperms chown -R www:www /opt/egw/1.6/userdata chmod -R 770 /opt/egw/1.6/userdata/files chmod -R 770 /opt/egw/1.6/userdata/backup chmod -R 770 /opt/egw/1.6/userdata/tmp
4. Create a domain and an iBay for a DAV file system for EGW from the server-manager
- Create ibay egwdav (and a group) without script handling, with Read/Write only for group.
- Create subdomain (like http://davegw.mydomain.com) using ibay egwdav.
- Create domain like egroupware.yourdomain.com (and edit DNS if requiered) using internet dns.
Webapps can be managed using some tips found here.
From the command line:
# Edit URL first MYDOMAIN=egroupware.sophieromano.com MYFOLDER=egw/1.8/egroupware
# Vars MYGROUP=egwdav MYIBAY=egwdav # Group db accounts set g_$MYGROUP group db accounts setprop g_$MYGROUP Description $MYGROUP db accounts setprop g_$MYGROUP Group g_$MYGROUP signal-event group-create g_$MYGROUP # ibay db accounts set $MYIBAY ibay db accounts setprop $MYIBAY CgiBin disabled db accounts setprop $MYIBAY Group g_$MYGROUP db accounts setprop $MYIBAY ModDav enabled db accounts setprop $MYIBAY ModDav-FileETag none db accounts setprop $MYIBAY Name $MYIBAY db accounts setprop $MYIBAY PasswordSet no db accounts setprop $MYIBAY PublicAccess global db accounts setprop $MYIBAY UserAccess wr-group-rd-group signal-event ibay-create $MYIBAY # Domain db domains set $MYDOMAIN domain db domains setprop $MYDOMAIN Nameservers internet db domains setprop $MYDOMAIN Content $MYFOLDER db domains setprop $MYDOMAIN WebApp yes signal-event domain-create $MYDOMAIN
5. Add repositories
If not done already, add contribs to repositories
db yum_repositories \ setprop smecontribs \ MirrorList http://distro.ibiblio.org/pub/linux/distributions/smeserver/mirrorlist/s... signal-event yum-modify
6. Install packages
Add packages and install EGW using subversion...
yum install subversion yum install smeserver-mod_dav --enablerepo=smecontribs pear install XML_Feed_Parser /opt/egw/1.6/egwupdate /opt/egw/1.6/svnupdateperms
7. Configuration
Previously egroupware was mapped to subdomain and your own domain might need to be adapted to your own DNS environment.
With ibay DAV enabled, this will be used as a filesystem when installing EGW. So instead of the standard VFS "/opt/egw/1.6/userdata/files", we would be able to use something like "http://davegw.mydomain.com/"
Now apply any changes affecting apache server:
expand-template /etc/httpd/conf/httpd.conf sv t httpd-e-smith
8. Setup EGW
EGW can now be setup by opening this URL:
http://egroupware.mydomain.com/setup/
-
folders
-
standard files system: /opt/egw/1.6/userdata/files
-
alternate files system: (example) http://davegw.mydomain.com
-
backup: /opt/egw/1.6/userdata/backup
- tmp: /opt/egw/1.6/userdata/tmp
-
-
authentification
- ldap
When done with egroupware's setup, we need to protect config file header.inc.php.
9. Finish
After this setup (step 8), protect the header file:
mv /opt/egw/1.6/egroupware/header.inc.php /opt/egw/1.6 ln -s /opt/egw/1.6/header.inc.php /opt/egw/1.6/egroupware/header.inc.php chmod 644 /opt/egw/1.6/header.inc.php
10. Configure EGW
Installation being done, there is a lot of configuration to do withing EGW. See http://www.egroupware.org if needed.
Notes and links
When doing an update, backup database.
Som people say that updating in the same folder is not safe since it can bring a broken or buggy version. This is mainly true for version 1.7.
Subversion: how it is used here...
#!/bin/sh # yum install subversion # To set version: UPDATE egw_applications SET app_version='1.6.001' WHERE app_name='phpgwapi'; echo "Egroupware 1.6 SVN update" myegw="/opt/egw/1.6" echo "in folder $myegw" cd $myegw echo "...checking" # 1.7 = svn checkout http://svn.egroupware.org/egroupware/trunk/aliases/default . # 1.6 = svn checkout http://svn.egroupware.org/egroupware/branches/1.6/aliases/default . svn checkout http://svn.egroupware.org/egroupware/branches/1.6/aliases/default . | tee $myegw/svnupdate.txt cat $myegw/svnupdate.txt|grep "^U" > $myegw/svnupdate_u.txt echo "Remove htaccess to let httpd.conf handle parameters" #rm -f $myegw/egroupware/.htaccess if [[ -s $myegw/svnupdate_u.txt ]] then echo "...apply changes" cat $myegw/svnupdate_u.txt $myegw/svnupdateperms else echo "...No updates." fi echo "Done" rm -f $myegw/svnupdate.txt
Files to download must be edited to suite your context and to verify that they do what you think they do!
| Fichier attaché | Taille |
|---|---|
| 20IbayContent.txt | 2.14 Ko |
| 81timez.txt | 74 octets |
| egwupdate.txt | 864 octets |
| svnupdateperms.txt | 590 octets |
| 98egroupware.txt | 1.43 Ko |