How to install SOGo components on Debian 10

How to install SOGo components on Debian 10

SOGo is a free, open source and collaborative component software server released under GNU GPL/LGPL v2 and higher. It comes with an easy-to-use web-based interface and supports multiple native clients. It provides native Microsoft ActiveSync support and also supports mobile devices such as Apple iPhone, Android, Windows Phone and BlackBerry.

feature

  • Support multiple languages.
  • Share your mail, calendar and address book with other users.
  • Set the alert as an important event and get the alert directly from the browser.
  • Receive desktop notifications.
  • Use a complete embedded RTF editor to compose HTML mail.
  • Support multiple mail accounts.
  • Import and export calander and mailbox.
  • Support two-factor authentication.

In this tutorial, we will show you how to install SOGo component server on Debian 10.

prerequisites

  • A server running Debian 10.
  • The root password is configured for the server.

getting Started

Before starting, it is recommended to update and upgrade the server to the latest version. You can do this by running the following command:

apt-get update -yapt-get upgrade -y

After updating the server, restart it to apply all changes.

Install and configure MariaDB

SOGo uses MariaDB/MySQL as the database backend. Therefore, you need to install it in the server. You can install it by running the following command:

apt-get install mariadb-server -y

Once MariaDB is installed, you will need to secure the MariaDB installation. You can do this by running the following script:

mysql_secure_installation

Answer all the questions shown below to set the root password:

Enter current password for root (enter for none):
OK, successfully used password, moving on...
Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Once your MariaDB is secure, use the following command to log in to MariaDB:

mysql

After logging in, use the following commands to create a database and user for SOGo:

MariaDB [(none)]> CREATE DATABASE sogo;MariaDB [(none)]> GRANT ALL ON sogo.* TO 'sogo'@'localhost' IDENTIFIED BY 'password';

Next, change the database to SOGo and create the required tables and insert some values ​​using the following command:

MariaDB [(none)]> USE sogo;MariaDB [sogo]> 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));MariaDB [sogo]> INSERT INTO sogo_users VALUES ('admin', 'admin', MD5('password'), 'Hitesh', '[email protected]');

Next, refresh the privileges and exit from MariaDB using the following command:

MariaDB [sogo]> flush privileges;MariaDB [sogo]> exit;

Once completed, you can proceed to the next step.

Install SOGo

By default, SOGo is not available in the Debian 10 default repositories, so you need to download it from its official website.You can view all packages at Sope download page with Sogo download pageYou can also download it manually using the following command:

wget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sogo/sogo_5.0.1.20201110-1_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sogo/sogo-activesync_5.0.1.20201110-1_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sogo/sogo-dbg_5.0.1.20201110-1_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sogo/sogo-dev_5.0.1.20201110-1_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsbjson2.3-dev_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsbjson2.3_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope-appserver4.9-dev_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope-appserver4.9_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope-core4.9-dev_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope-core4.9_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope-gdl1-4.9-dev_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope-gdl1-4.9_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope-ldap4.9-dev_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope-ldap4.9_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope-mime4.9-dev_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope-mime4.9_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope-xml4.9-dev_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope-xml4.9_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/libsope4.9-dev_4.9.r1664.20201103_all.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/sope4.9-appserver_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/sope4.9-dbg_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/sope4.9-gdl1-mysql_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/sope4.9-gdl1-postgresql_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/sope4.9-libxmlsaxdriver_4.9.r1664.20201103_amd64.debwget https://packages.inverse.ca/SOGo/nightly/5/debian/pool/buster/s/sope/sope4.9-stxsaxdriver_4.9.r1664.20201103_amd64.deb

After downloading all packages, install all packages by running the following command:

dpkg -i *.deb

After running the above command, you will get a dependency error. You can install all missing dependencies by running the following command:

apt-get install -f

After installing all dependencies, use the following command to start the SOGo service and enable it to start when the system restarts:

systemctl start sogosystemctl enable sogo

Once completed, you can proceed to the next step.

Install and configure Apache web server

Next, you will need to install and configure the Apache web server to serve SOGo over port 80. You can install it by running the following command:

apt-get install apache2 -y

After installing the Apache web server, run the following command to enable all required modules:

a2enmod proxy proxy_http headers rewrite

Next, use the following command to enable the SOGo default virtual host file:

a2enconf SOGo.conf

Next, you will need to edit the SOGo virtual host configuration file and replace the https connection with http and 443 with port 80:

nano /etc/apache2/conf-enabled/SOGo.conf

Find the following lines:

  RequestHeader set "x-webobjects-server-port" "443"
  RequestHeader set "x-webobjects-server-url" "https://%{HTTP_HOST}e" env=HTTP_HOST

And, replace them with the following:

  RequestHeader set "x-webobjects-server-port" "80"
  RequestHeader set "x-webobjects-server-url" "http://%{HTTP_HOST}e" env=HTTP_HOST

Save and close the file, and then check the Apache server for syntax errors by running the following command:

apachectl configtest

If everything is ok, you should get the following output:

Syntax OK

Finally, restart the Apache service to apply the changes:

systemctl restart apache2

You can also use the following command to verify the status of the Apache service:

systemctl status apache2

You should get the following output:

? apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-11-12 04:17:37 UTC; 14s ago
     Docs: https://httpd.apache.org/docs/2.4/
  Process: 15278 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 15282 (apache2)
    Tasks: 55 (limit: 4701)
   Memory: 17.2M
   CGroup: /system.slice/apache2.service
           ??15282 /usr/sbin/apache2 -k start
           ??15283 /usr/sbin/apache2 -k start
           ??15284 /usr/sbin/apache2 -k start

Nov 12 04:17:37 debian10 systemd[1]: Starting The Apache HTTP Server...

So far, the Apache web server has been installed and configured. Now you can proceed to the next step.

Configure SOGo

Next, you will need to configure SOGo to use MariaDB for authentication, define the SOGo configuration file, OCS folder, COS session, and super user name. You can do this by editing the SOGo main configuration file:

nano /etc/sogo/sogo.conf

Add the following lines before the last line}:

SOGoProfileURL = "mysql://sogo:[email protected]:5432/sogo/sogo_user_profile";
OCSFolderInfoURL = "mysql://sogo:[email protected]:5432/sogo/sogo_folder_info";
OCSSessionsFolderURL = "mysql://sogo:[email protected]:5432/sogo/sogo_sessions_folder";

SOGoPasswordChangeEnabled = YES;

SOGoUserSources =
  (
    {
      type = sql;
      id = users;
     viewURL = "mysql://sogo:[email protected]:3306/sogo/sogo_users";
     canAuthenticate = YES;
     isAddressBook = NO;
      userPasswordAlgorithm = md5;
    }
  );

  SOGoPageTitle = SOGo;
  SOGoVacationEnabled = YES;
  SOGoForwardEnabled = YES;
  SOGoSieveScriptsEnabled = YES;
  SOGoMailAuxiliaryUserAccountsEnabled = YES;
  SOGoTrustProxyAuthentication = NO;
  SOGoXSRFValidationEnabled = YES;

  SOGoSuperUsernames = (admin); // This is an array - keep the parens!

Save and close the file when you are done, then restart the SOGo service to apply the changes:

systemctl restart sogo

Now, you can verify the status of the SOGo service by running the following command:

systemctl status sogo

You should get the following output:

? sogo.service - LSB: SOGo server
   Loaded: loaded (/etc/init.d/sogo; generated)
   Active: active (running) since Thu 2020-11-12 04:19:00 UTC; 3s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 15422 ExecStart=/etc/init.d/sogo start (code=exited, status=0/SUCCESS)
    Tasks: 4 (limit: 4701)
   Memory: 44.9M
   CGroup: /system.slice/sogo.service
           ??15493 /usr/sbin/sogod -WOWorkersCount 3 -WOPidFile /var/run/sogo/sogo.pid -WOLogFile /var/log/sogo/sogo.log
           ??15495 /usr/sbin/sogod -WOWorkersCount 3 -WOPidFile /var/run/sogo/sogo.pid -WOLogFile /var/log/sogo/sogo.log
           ??15496 /usr/sbin/sogod -WOWorkersCount 3 -WOPidFile /var/run/sogo/sogo.pid -WOLogFile /var/log/sogo/sogo.log
           ??15497 /usr/sbin/sogod -WOWorkersCount 3 -WOPidFile /var/run/sogo/sogo.pid -WOLogFile /var/log/sogo/sogo.log

Nov 12 04:19:00 debian10 systemd[1]: Starting LSB: SOGo server...
Nov 12 04:19:00 debian10 sogo[15422]: Starting SOGo: sogo.
Nov 12 04:19:00 debian10 systemd[1]: Started LSB: SOGo server.

At this point, SOGo has started and is listening on port 20000. You can use the following command to check:

ss -ntpl | grep -i sogo

You should get the following output:

LISTEN    0         5                127.0.0.1:20000            0.0.0.0:*        users:(("sogod",pid=15497,fd=3),("sogod",pid=15496,fd=3),("sogod",pid=15495,fd=3),("sogod",pid=15493,fd=3))

Once completed, you can proceed to the next step.

Access the SOGo web interface

Now, open your web browser and enter the URL http: // your-server-ip / SOGo Visit the SOGo Web UI. You will be redirected to the following page:

Provide your administrator username as admin and password as “password”, then click > Button. You should see the SOGo default dashboard in the following page:

SOGo component dashboard

in conclusion

Congratulations! You have successfully installed and configured SOGo components using Apache on Debian 10. You can now explore SOGo for more features and deploy it in a production environment. If you have any questions, please feel free to ask me.

Source

Sidebar