Advertisement
princeofisles

SOGo Configuration

Oct 14th, 2011
1,710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 9.15 KB | None | 0 0
  1. # become root
  2. su
  3.  
  4. # this manual assumes you allready have apache2 running
  5. # if not please install it first.
  6.  
  7. # change sources.list
  8. echo '# sogo:" >> /etc/apt/sources.list
  9. echo 'deb http://inverse.ca/debian squeeze squeeze' >> /etc/apt/sources.list
  10. apt-key adv --keyserver keys.gnupg.net --recv-key 0x810273C4
  11. apt-get update
  12.  
  13. # install sogo
  14. apt-get install sogo sope4.9-gdl1-mysql memcached
  15. # you will get an error about the key of the repostitory, there is no key.
  16. # in some cases mysql is stopped, therefore I restart mysql:
  17. /etc/init.d/mysql restart
  18. # you will get an security message from tmpreaper, no problem.
  19. # you will get an error when sogo starts, no problem.
  20.  
  21. # install rpl  (I use it in this manual)
  22. apt-get install rpl
  23.  
  24. # to read more about the security-issues of tmpreader
  25. zless /usr/share/doc/tmpreaper/README.security.gz
  26. # to remove the warning of tmpreaper
  27. rpl 'SHOWWARNING=true' 'SHOWWARNING=false' /etc/tmpreaper.conf
  28.  
  29. # memcached
  30. apt-get install memcached
  31. # this is because of IPv6 errors, do this only in Squee-ze, not in Len-ny.
  32. rpl '127.0.0.1' localhost /etc/memcached.conf
  33. /etc/init.d/memcached restart
  34.  
  35. # create a database and add some test-users
  36. mysql  # start mysql client, maybe you will need the -p option
  37.  
  38. ------start mysql------
  39. CREATE DATABASE sogo CHARSET='UTF8';
  40. CREATE USER 'sogo'@'localhost' IDENTIFIED BY 'secret';
  41. GRANT ALL PRIVILEGES ON sogo.* TO 'sogo'@'localhost';
  42. USE sogo;
  43. CREATE TABLE sogo_users (c_uid VARCHAR(10) PRIMARY KEY, c_name VARCHAR(10), c_password VARCHAR(32), c_cn VARCHAR(128), mail VARCHAR(128));
  44. INSERT INTO sogo_users VALUES ('paul', 'paul', MD5('zxc'), 'Paul van der Vlis', 'paul@vandervlis.nl');
  45. INSERT INTO sogo_users VALUES ('piet', 'piet', MD5('zxc'), 'Piet van der Vlis', 'piet@vandervlis.nl');
  46. INSERT INTO sogo_users VALUES ('klaas', 'klaas', MD5('zxc'), 'Klaas van der Vlis', 'klaas@vandervlis.nl');
  47. flush privileges;
  48. exit
  49. ----end mysql--------
  50.  
  51. # add some apache modules
  52. a2enmod proxy
  53. a2enmod proxy_http
  54. a2enmod headers
  55. a2enmod rewrite
  56. # restart apache
  57. /etc/init.d/apache2 restart
  58.  
  59. # sogo configuration, as user "sogo"
  60. su sogo
  61. defaults write sogod SOGoTimeZone "Europe/Amsterdam"
  62. defaults write sogod SOGoMailDomain "vandervlis.nl"
  63. defaults write sogod SOGoLanguage "Dutch"
  64. # say "isAddressBook = NO" for a shared hosting situation
  65. # this is a very long line:
  66. defaults write sogod SOGoUserSources '({canAuthenticate = YES; displayName = "SOGo Users"; id = users; isAddressBook = YES; type = sql; userPasswordAlgorithm = md5; viewURL ="mysql://sogo:secret@127.0.0.1:3306/sogo/sogo_users";})'
  67. defaults write sogod SOGoProfileURL 'mysql://sogo:secret@127.0.0.1:3306/sogo/sogo_user_profile'
  68. defaults write sogod OCSFolderInfoURL 'mysql://sogo:secret@127.0.0.1:3306/sogo/sogo_folder_info'
  69. defaults write sogod OCSSessionsFolderURL 'mysql://sogo:secret@127.0.0.1:3306/sogo/sogo_sessions_folder'
  70. defaults write sogod SOGoAppointmentSendEMailNotifications YES
  71. defaults write sogod SOGoLoginModule Calendar
  72. defaults write sogod SOGoSieveScriptsEnabled YES
  73. # sometimes Sieve is running on port 2000, port 4190 is relative new:
  74. defaults write sogod SOGoSieveServer sieve://localhost:4190
  75. defaults write sogod SOGoVacationEnabled YES
  76. defaults write sogod SOGoMailMessageCheck every_5_minutes
  77. defaults write sogod SOGoFirstDayOfWeek 1
  78. defaults write sogod SOGoSuperUsernames '( "paul" )'
  79. # I am using Cyrus IMAP 2.2 in the default settings, I needed this 4 lines
  80. # for mailbox setting. I don't think you need them with other IMAP servers:
  81. defaults write sogod SOGoDraftsFolderName "INBOX.Drafts"
  82. defaults write sogod SOGoSentFolderName "INBOX.Sent"
  83. defaults write sogod SOGoTrashFolderName "INBOX.Trash"
  84. defaults write sogod NGImap4ConnectionStringSeparator "."
  85. exit
  86. /etc/init.d/sogo restart
  87.  
  88. # the default apache configuration adds an /SOGo/ to every site you run.
  89. # if you don't like that, like me, you can use my apache-config.
  90.  
  91. # backup and remove default apache sogo configuration
  92. mv /etc/apache2/conf.d/SOGo.conf /root/SOGo.conf-backup
  93. echo "# disabled" >> /etc/apache2/conf.d/SOGo.conf
  94. # copy the virtualhost apache configuration and restart apache
  95. pico /etc/apache2/sites-available/sogo.vandervlis.nl
  96.  
  97. ---begin apache config-------
  98. <VirtualHost *:80>
  99.    Servername sogo.vandervlis.nl
  100.    DocumentRoot /usr/lib/GNUstep/SOGo/WebServerResources/
  101.    ErrorLog /var/log/apache2/error.log
  102.    Customlog /var/log/apache2/access.log combined
  103.    ServerSignature Off
  104.  
  105.    Alias /SOGo.woa/WebServerResources/ /usr/lib/GNUstep/SOGo/WebServerResources/
  106.    Alias /SOGo/WebServerResources/ /usr/lib/GNUstep/SOGo/WebServerResources/
  107.    AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2
  108.  
  109.    <Directory /usr/lib/GNUstep/SOGo/>
  110.       AllowOverride None
  111.       Order deny,allow
  112.       Allow from all
  113.    </Directory>
  114.  
  115.    <LocationMatch "^/SOGo/so/ControlPanel/Products/.*UI/Resources/.*\.(jpg|png|gif|css|js)">
  116.      SetHandler default-handler
  117.    </LocationMatch>
  118.  
  119.    ProxyRequests Off
  120.    SetEnv proxy-nokeepalive 1
  121.    ProxyPreserveHost On
  122.    ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0
  123.  
  124.    <Proxy http://127.0.0.1:20000/SOGo>
  125.      RequestHeader set "x-webobjects-server-port" "80"
  126.      RequestHeader set "x-webobjects-server-name" "sogo.vandervlis.nl"
  127.      RequestHeader set "x-webobjects-server-url" "http://sogo.vandervlis.nl"
  128.      RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
  129.      RequestHeader set "x-webobjects-remote-host" %{REMOTE_HOST}e env=REMOTE_HOST
  130.      AddDefaultCharset UTF-8
  131.      Order allow,deny
  132.      Allow from all
  133.    </Proxy>
  134.    ## We use mod_rewrite to pass remote address to the SOGo proxy.
  135.    # The remote address will appear in SOGo's log files and in the X-Forward
  136.    # header of emails.
  137.    RewriteEngine On
  138.    RewriteRule ^/SOGo/(.*)$ /SOGo/$1 [env=REMOTE_HOST:%{REMOTE_ADDR},PT]
  139.  
  140.    Redirect permanent /index.html http://sogo.vandervlis.nl/SOGo
  141.  
  142. </virtualhost>
  143. ----end apache config---------
  144.  
  145. a2ensite sogo.vandervlis.nl
  146. /etc/init.d/apache2 reload
  147.  
  148. # Now you can access SOGo on http://sogo.vanderdervlis.nl/SOGo
  149.  
  150. # Url's for Thunderbird:
  151. # adressbook: http://sogo.vandervlis.nl/SOGo/dav/paul/Contacts/personal/
  152. # calendar:   http://sogo.vandervlis.nl/SOGo/dav/paul/Calendar/personal/
  153.  
  154. # If everything works well, you can make it https, with something like this:
  155. pico /etc/apache2/sites-available/sogo.vandervlis.nl
  156.  
  157. ------begin apache config ssl---------
  158. <VirtualHost *:80>
  159.    Servername sogo.vandervlis.nl
  160.    RedirectMatch permanent ^/ https://sogo.vandervlis.nl/SOGo
  161.    RedirectMatch permanent ^/SOGo https://sogo.vandervlis.nl/SOGo
  162. </VirtualHost>
  163.  
  164. <VirtualHost *:443>
  165.    Servername sogo.vandervlis.nl
  166.    SSLEngine On
  167.    SSLCertificateFile /etc/apache2/ssl/sogo.vandervlis.nl.pem
  168.    SSLCertificateChainFile /etc/apache2/ssl/sogo.vandervlis.nl.pem
  169.    DocumentRoot /usr/lib/GNUstep/SOGo/WebServerResources/
  170.    ErrorLog /var/log/apache2/error.log
  171.    Customlog /var/log/apache2/access.log combined
  172.    ServerSignature Off
  173.    <IfModule mpm_itk_module>
  174.        AssignUserId sogo-a sogo-a
  175.   </IfModule>
  176.  
  177.    Alias /SOGo.woa/WebServerResources/ /usr/lib/GNUstep/SOGo/WebServerResources/
  178.    Alias /SOGo/WebServerResources/ /usr/lib/GNUstep/SOGo/WebServerResources/
  179.    AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2
  180.  
  181.    <Directory /usr/lib/GNUstep/SOGo/>
  182.       AllowOverride None
  183.       Order deny,allow
  184.       Allow from all
  185.    </Directory>
  186.  
  187.    <LocationMatch "^/SOGo/so/ControlPanel/Products/.*UI/Resources/.*\.(jpg|png|gif|css|js)">
  188.      SetHandler default-handler
  189.    </LocationMatch>
  190.  
  191.    ProxyRequests Off
  192.    SetEnv proxy-nokeepalive 1
  193.    ProxyPreserveHost On
  194.    ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0
  195.  
  196.    <Proxy http://127.0.0.1:20000/SOGo>
  197.      RequestHeader set "x-webobjects-server-port" "443"
  198.      RequestHeader set "x-webobjects-server-name" "sogo.vandervlis.nl"
  199.      RequestHeader set "x-webobjects-server-url" "https://sogo.vandervlis.nl"
  200.      RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
  201.      RequestHeader set "x-webobjects-remote-host" %{REMOTE_HOST}e env=REMOTE_HOST
  202.      AddDefaultCharset UTF-8
  203.      Order allow,deny
  204.      Allow from all
  205.    </Proxy>
  206.    ## We use mod_rewrite to pass remote address to the SOGo proxy.
  207.    # The remote address will appear in SOGo's log files and in the X-Forward
  208.    # header of emails.
  209.    RewriteEngine On
  210.    RewriteRule ^/SOGo/(.*)$ /SOGo/$1 [env=REMOTE_HOST:%{REMOTE_ADDR},PT]
  211.    
  212.    Redirect permanent /index.html https://sogo.vandervlis.nl/SOG
  213.    
  214. </virtualhost>
  215. ------end apache config ssl-----------------
  216.  
  217. a2ensite sogo.vandervlis.nl
  218. /etc/init.d/apache2 reload
  219.  
  220. # Now you can access it on https://sogo.vanderdervlis.nl/SOGo
  221.  
  222. # Url's for Thunderbird:
  223. # adressbook: https://sogo.vandervlis.nl/SOGo/dav/paul/Contacts/personal/
  224. # calendar:   https://sogo.vandervlis.nl/SOGo/dav/paul/Calendar/personal/
  225.  
  226. # please write me if you have an good idea to make this manual better:
  227. # Paul van der Vlis paul@vandervlis.nl
  228. # please don't change the setup of this page without contact.
  229. # I also like something like this:
  230. echo "Your SOGo manual helped me" | mail -s Thanks paul@vandervlis.nl
  231.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement