Debian 9 Step by Step



  • I am attempting a fresh install on Debian 9, and despite extensive googling, I am unable to find a comprehensive step-by-step install procedure that can be executed from a bash script.

    I am aware of and read https://documentation.kopano.io/kopanocore_administrator_manual/installing.html, however forgive me for saying that it is a little vague (to me anyway !).

    What I would like to do is add the repos to apt sources list, and then use apt install x,y,z

    Can this be done ??

    echo "deb https://serial:MYSERIAL@download.kopano.io/supported/core:/final/Debian_9.0/ ./" > /etc/apt/sources.list.d/kopano.list
    echo "deb https://serial:MYSERIAL@download.kopano.io/supported/webapp:/final/Debian_9.0/ ./" >> /etc/apt/sources.list.d/kopano.list
    
    curl https://serial:MYSERIAL@download.kopano.io/supported/core:/final/Debian_9.0/Release.key | apt-key add -
    
    apt update
    apt upgrade
    
    apt install kopano-server-packages kopano-webapp php-fpm nginx mysql-server
    
    ## config overrides
    echo -e "mysql_password = xxxx" > /etc/kopano/server.cfg
    echo -e "mysql_database = kopanoserver" >> /etc/kopano/server.cfg
    echo -e "disabled_features = \"\"" >> /etc/kopano/server.cfg
    
    echo -e "imaps_listen    = *:993" > /etc/kopano/gateway.cfg
    
    ## restart the server to create tables.
    systemctl restart kopano-server
    

    When I execute this, install appears to complete successfully however none of the .cfg files (i.e. /etc/kopano/server.cfg) are created.



  • I am not sure what you want to do with the third line but this is indeed the correct installation path.

    The cfg-file are available in /usr/share/doc/kopano/example-config. You can copy them to /etc/kopano.

    Finally the articles on the Knowledge Base (https://kb.kopano.io/display/WIKI/Core) will tell the settings required to make it working.



  • @nschoote - thanks for helping, the third line was a typo, removed it, so it’s just a case of:

    cp -p /usr/share/doc/kopano/example-config/*.cfg /etc/kopano/
    

    And my install steps are correct ??



  • so far all good. ( correction)

    if you look in “/usr/share/doc/kopano/example-config/” you will also see .gz files.
    You missing these now.



  • How about a sql dump file that I can import into mysql after creating the database, adding the user and giving them GRANT ALL PRIVILEGES ??

    I am very familiar with MYSQL and know how to add databases, users etc etc - all I need is the default sql dump file.


  • Kopano

    @crankshaft said in Debian 9 Step by Step:

    however none of the .cfg files (i.e. /etc/kopano/server.cfg) are created.

    This is the expected and documented behaviour.

    You do not need to copy over all configuration files, as all services have preprogrammed defaults. You only need to create config files for values that you want to override (like your mysql credentials for example).



  • Here, my notes for a Debian install.

    RANDOMPASSWD(){ < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-16};echo; }
    apt-get install kopano-server-packages kopano-webapp -y --autoremove
    
    # Setup the Database
    SQLDBPWD="$(RANDOMPASSWD)"
    # Create database and set rights. 
    mysql --defaults-file=/etc/mysql/debian.cnf -Bse "CREATE DATABASE kopano"; 
    mysql --defaults-file=/etc/mysql/debian.cnf -Bse "CREATE USER kopano@localhost IDENTIFIED BY '$SQLDBPWD'";
    mysql --defaults-file=/etc/mysql/debian.cnf -Bse "GRANT ALL PRIVILEGES ON kopano.* TO 'kopano'@'localhost' IDENTIFIED BY '$SQLDBPWD'";
    
    # Or a restriced user with :  
    # mysql --defaults-file=/etc/mysql/debian.cnf -Bse "GRANT ALTER, CREATE, CREATE ROUTINE, \
    #   DELETE, DROP, INDEX, INSERT, LOCK TABLES, SELECT, UPDATE ON kopano.* TO 'kopano'@'localhost' \
    #   IDENTIFIED BY '$SQLDBPWD'";
    
    echo "Write down you kopano user password : $SQLDBPWD" 
    cp /usr/share/doc/kopano/example-config/* /etc/kopano/ 
    gunzip /etc/kopano/*.gz
    
    # ! change the domain here.. 
    sed -i "s/#system_email_address = postmaster@localhost/system_email_address = postmaster@yourdomain.tld/g"  /etc/kopano/server.cfg
    
    # change the mysql password here 
    sed -i "s/#mysql_user = root/mysql_user = kopano/g" /etc/kopano/server.cfg
    sed -i "s/#mysql_password =/mysql_password = HIERPASSWD/g" /etc/kopano/server.cfg
    
    # enable tls. 
    sed -i "s/#server_listen_tls =/server_listen_tls = *:237/g"  /etc/kopano/server.cfg
    
    # change secret 
    sed -i "s/#server_secret_key = GEHEIM/server_secret_key = $(RANDOMPASSWD)/g" /etc/kopano/presence.cfg
    
    

    That should give you a nice start.



  • @thctlo - Thanks, but I need a kopano.sql dump file to import the tables, triggers etc etc etc - where would I find this sqldump file ?



  • @crankshaft configure kopano and start it with an empty database,
    It will create all needed tables.



  • This post is deleted!


  • @fbartels - You do not need to copy over all configuration files… - ahh, that’s useful, I have done that instead.



  • Thanks so much to everyone that contributed.



  • One final question, where in kopano configuration do I enter my Serial Number Subscription key ?



  • This post is deleted!

  • Kopano

    @crankshaft said in Debian 9 Step by Step:

    where in kopano configuration do I enter my Serial Number Subscription key ?

    The binaries of the server (currently) have no need to validate a license key. As we are 100% open source, there is no code that would need to be triggered by such a key. The subscription key only serves as a means to get access to the repository with the supported builds.


Log in to reply