Loading...
 
Skip to main content

History: Ubuntu Install

Source of version: 135

Copy to clipboard
            ! Ubuntu Install

Here we have some step-by-step instructions for installing Tiki on Ubuntu Server with Apache2, MySQL/MARIADB5, and PHP5/PHP7.

!! Install Ubuntu Server
I would recommend installing only SSH Server as part of the initial install.

!! Patch it up
{CODE(colors=bash wrap=1)}sudo apt-get update
sudo apt-get upgrade{CODE}
{TABS(name="installationUbuntu" tabs="20.04 LTS|18.04 LTS|16.04 LTS" toggle="y" inside_pretty="n")}
!!# Install Lamp
You can install Linux, Apache, Mysql and PHP (plus a few other helper utils such as git or subversion, etc) with:
{CODE(ln="1" colors="bash")}
sudo apt install mariadb-server mariadb-client apache2 curl composer php php-tidy php-pear memcached php-gd php-xmlrpc phpmyadmin php-mbstring libapache2-mod-php php-mysql php-apcu php-curl php-intl php-sqlite3 php-zip postfix git subversion php-memcache php7.4-gettext  php-pspell php-zip poppler-utils php-memcached bsdmainutils pstotext catdoc elinks man-db odt2txt php-pear pstotext php-common php-intl php7.4-opcache php7.4-xml php7.4-zip php7.4-ldap
{CODE}

^__Note__
If you need to install ((Tiki22)) or newer, you don't need to add any extra repository, since you already have php 7.4 using the default ubuntu 20.04 repositories.
{CODE(ln="1" colors="bash")}
sudo apt-get update
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/apache2
sudo apt-get update
sudo apt -y install php7.4 php7.4-tidy php7.4-gd php7.4-xmlrpc php7.4-mbstring php7.4-mysql php7.4-apcu php7.4-curl php7.4-intl php7.4-sqlite3 php7.4-zip php7.4-memcache php7.4-pspell php7.4-memcached php7.4-common php7.4-opcache php7.4-xml php7.4-ldap php7.4-bcmath php7.4-soap
{CODE}
^

In case you have other php versions newer than 7.4 (such as php 8.0.x), you may set the default php version at 7.4 with these commands:
{CODE()}
sudo a2dismod php8.0
sudo a2enmod php7.4
sudo service apache2 restart
  
sudo update-alternatives --set php /usr/bin/php7.4
{CODE}
  
If it's a brand new server, you might be asked a few questions to configure some server programs.

To configure __postfix__ (program to mange email sending and  receiving from the server), you can answer, for instance (unless you know what you are doing):
* General type of mail configuration: __Internet site__
* System mail name: mail.yourdomain.org

To configure __phpmyadmin__ (program to manage mysql databases through a web based GUI), you can answer, for instance (unless you know what you are doing):
* Webserver: __apache2__ (you can select using the space bar and arrow keys if needed to move between the options)
* Configure database with dbconfig-common: yes
* MySQL application password for phpmyadmin: [[leave empty]



Then you can enable the modules
{CODE(colors="shell")}
#sudo phpenmod mcrypt # mcrypt is not found in php 7.2
sudo phpenmod mbstring
{CODE}

Extra packages for ((Media Alchemyst)):
{CODE(colors="shell")}
#sudo apt install software-properties-common
#sudo add-apt-repository ppa:libreoffice/libreoffice-6-0 # not available for ubuntu 20.04 at the time of this writing
sudo apt install libreoffice ffmpeg unoconv ghostscript php-imagick imagemagick
{CODE}


Enable the Apache rewrite rules:

{CODE(colors="shell", ln="1", caption="Command on a console")}
sudo  a2enmod rewrite
sudo  service apache2 restart
{CODE}

And you can enable the self-signed ssl certificates to allow connections with https:
{CODE(colors="shell", ln="1", caption="Command on a console")}
sudo a2enmod ssl
sudo a2ensite default-ssl
sudo  service apache2 restart
{CODE}

And add this section between the VirtualHost tags the to this file /etc/apache2/sites-enabled/000-default.conf (or equivalent for your configuration; in this case, the doc. root where tiki is installed is __/var/www/html/__, which is where ubuntu 20.04 comes pre-configured for the base doc root):

{CODE(colors=bash wrap=1)}sudo nano /etc/apache2/sites-enabled/000-default.conf{CODE}

Section to add (just after the Document root line):
{CODE(colors=xml ln=1)}
<Directory /var/www/html/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        ## The following lines to allow connections have changed syntax
        ## between apache 2.2 and apache 2.4
        ## See: http://httpd.apache.org/docs/2.4/upgrading.html  > Run-Time Configuration Changes > Access control
        #Order allow,deny
        #Allow from all
        Require all granted
 </Directory>
{CODE}

Do the same type of edit into the equivalent config file for https:
{CODE(colors=bash wrap=1)}sudo nano /etc/apache2/sites-enabled/default-ssl.conf{CODE}


After the change, they should look like:
{CODE(colors="shell", ln="1", caption="Contents of /etc/apache2/sites-enabled/000-default.conf")}
<VirtualHost *:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	#ServerName www.example.com

	ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

<Directory /var/www/html/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
        #Order allow,deny
        #Allow from all
        Require all granted
	</Directory>

	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.
	# It is also possible to configure the loglevel for particular
	# modules, e.g.
	#LogLevel info ssl:warn

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	# For most configuration files from conf-available/, which are
	# enabled or disabled at a global level, it is possible to
	# include a line for only one particular virtual host. For example the
	# following line enables the CGI configuration for this host only
	# after it has been globally disabled with "a2disconf".
	#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
{CODE}

{CODE(colors="shell", ln="1", caption="Contents of /etc/apache2/sites-enabled/default-ssl.conf")}
<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin webmaster@localhost

                DocumentRoot /var/www/html

<Directory /var/www/html/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        ## The following lines to allow connections have changed syntax
        ## between apache 2.2 and apache 2.4
        ## See: http://httpd.apache.org/docs/2.4/upgrading.html  > Run-Time Configuration Changes > Access control
        #Order allow,deny
        #Allow from all
        Require all granted
 </Directory>

                # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
                # error, crit, alert, emerg.
                # It is also possible to configure the loglevel for particular
                # modules, e.g.
                #LogLevel info ssl:warn

                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined

                # For most configuration files from conf-available/, which are
                # enabled or disabled at a global level, it is possible to
                # include a line for only one particular virtual host. For example the
                # following line enables the CGI configuration for this host only
                # after it has been globally disabled with "a2disconf".
                #Include conf-available/serve-cgi-bin.conf

                #   SSL Engine Switch:
                #   Enable/Disable SSL for this virtual host.
                SSLEngine on

                #   A self-signed (snakeoil) certificate can be created by installing
                #   the ssl-cert package. See
                #   /usr/share/doc/apache2/README.Debian.gz for more info.
                #   If both key and certificate are stored in the same file, only the
                #   SSLCertificateFile directive is needed.
                SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
                SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

                #   Server Certificate Chain:
                #   Point SSLCertificateChainFile at a file containing the
                #   concatenation of PEM encoded CA certificates which form the
                #   certificate chain for the server certificate. Alternatively
                #   the referenced file can be the same as SSLCertificateFile
                #   when the CA certificates are directly appended to the server
                #   certificate for convinience.
                #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt

                #   Certificate Authority (CA):
                #   Set the CA certificate verification path where to find CA
                #   certificates for client authentication or alternatively one
                #   huge file containing all of them (file must be PEM encoded)
                #   Note: Inside SSLCACertificatePath you need hash symlinks
                #                to point to the certificate files. Use the provided
                #                Makefile to update the hash symlinks after changes.
                #SSLCACertificatePath /etc/ssl/certs/
                #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

                #   Certificate Revocation Lists (CRL):
                #   Set the CA revocation path where to find CA CRLs for client
                #   authentication or alternatively one huge file containing all
                #   of them (file must be PEM encoded)
                #   Note: Inside SSLCARevocationPath you need hash symlinks
                #                to point to the certificate files. Use the provided
                #                Makefile to update the hash symlinks after changes.
                #SSLCARevocationPath /etc/apache2/ssl.crl/
                #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

                #   Client Authentication (Type):
                #   Client certificate verification type and depth.  Types are
                #   none, optional, require and optional_no_ca.  Depth is a
                #   number which specifies how deeply to verify the certificate
                #   issuer chain before deciding the certificate is not valid.
                #SSLVerifyClient require
                #SSLVerifyDepth  10

                #   SSL Engine Options:
                #   Set various options for the SSL engine.
                #   o FakeBasicAuth:
                #        Translate the client X.509 into a Basic Authorisation.  This means that
                #        the standard Auth/DBMAuth methods can be used for access control.  The
                #        user name is the `one line' version of the client's X.509 certificate.
                #        Note that no password is obtained from the user. Every entry in the user
                #        file needs this password: `xxj31ZMTZzkVA'.
                #   o ExportCertData:
                #        This exports two additional environment variables: SSL_CLIENT_CERT and
                #        SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
                #        server (always existing) and the client (only existing when client
                #        authentication is used). This can be used to import the certificates
                #        into CGI scripts.
                #   o StdEnvVars:
                #        This exports the standard SSL/TLS related `SSL_*' environment variables.
                #        Per default this exportation is switched off for performance reasons,
                #        because the extraction step is an expensive operation and is usually
                #        useless for serving static content. So one usually enables the
                #        exportation for CGI and SSI requests only.
                #   o OptRenegotiate:
               #        This enables optimized SSL connection renegotiation handling when SSL
                #        directives are used in per-directory context.
                #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>

                #   SSL Protocol Adjustments:
                #   The safe and default but still SSL/TLS standard compliant shutdown
                #   approach is that mod_ssl sends the close notify alert but doesn't wait for
                #   the close notify alert from client. When you need a different shutdown
                #   approach you can use one of the following variables:
                #   o ssl-unclean-shutdown:
                #        This forces an unclean shutdown when the connection is closed, i.e. no
                #        SSL close notify alert is send or allowed to received.  This violates
                #        the SSL/TLS standard but is needed for some brain-dead browsers. Use
                #        this when you receive I/O errors because of the standard approach where
                #        mod_ssl sends the close notify alert.
                #   o ssl-accurate-shutdown:
                #        This forces an accurate shutdown when the connection is closed, i.e. a
                #        SSL close notify alert is send and mod_ssl waits for the close notify
                #        alert of the client. This is 100% SSL/TLS standard compliant, but in
                #        practice often causes hanging connections with brain-dead browsers. Use
                #        this only for browsers where you know that their SSL implementation
                #        works correctly.
                #   Notice: Most problems of broken clients are also related to the HTTP
                #   keep-alive facility, so you usually additionally want to disable
                #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
                #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
                #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
                #   "force-response-1.0" for this.
                # BrowserMatch "MSIE [2-6]" \
                #               nokeepalive ssl-unclean-shutdown \
                #               downgrade-1.0 force-response-1.0

        </VirtualHost>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
{CODE}

!!# Create for tiki a mysql db and a mysql user with local perms for that db
!!! Option 1 - using console
We can create a database and user for tiki. We can do so through a terminal windows converting ourselves in root in a first step with -+sudo su+-, and then, we can continue with the mysql commands. Please note that when executing -+mysql -++- (as root) you need to provide no password, since mysql authenticaation scheme in Ubuntu 18.04 only requires that you run this command as user root in the shell.

{CODE(colors="shell" ln="1" caption="commands in a terminal window")}
# sudo su

# mysql -p

# mysql> CREATE DATABASE mytikidb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

# mysql> CREATE USER 'mytikiuser'@'localhost' IDENTIFIED BY 'mypassword';

# mysql> GRANT ALL ON mytikidb.* TO 'mytikiuser'@'localhost';

# mysql> FLUSH PRIVILEGES;

# mysql> \q
{CODE}

If it's a brand new server, you are encouraged to secure your mysql installation with the provided script ( -+sudo mysql_secure_installation+- ), and do the recommended setup steps indicated here:
https://vitux.com/how-to-install-and-configure-mysql-in-ubuntu-18-04-lts/

!!! Option 2 - use phpmyadmin or adminer
Alternatively, you can use your PhpMyAdmin install:
http://example.com/phpmyadmin/

or a small php script to manage your mysql server, called [https://www.adminer.org/|Adminer], that you can download to your server with an instruction like this one in a terminal:
{CODE(colors="shell" ln=1)}
sudo wget https://www.adminer.org/latest-mysql-en.php -O "/var/www/html/tiki/adminer.php"
# once you are done with managing your database and users, you are encouraged to remove adminer.php from the web access to somewhere else unaccessible from your web root for extra precaution
sudo mv /var/www/html/tiki/adminer.php /var/www/
{CODE}

Then you can login to your GUI web access (either phpmyadmin or adminer). You will probably not be able to login with your mysql root password, since the msyql auth scheme in ubuntu 18.04 has changed compared to previous versions (it currently uses auth_socket instead of native_mysql_password). 
Therefore, you can use the -+debian-sys-maint+- credentials that you will find here:
-+/etc/mysql/debian.cnf+-

* Create a new user for mysql that does NOT have all perms
** New user is __tikiuser__, and we do not select neither database nor general perms for this user.
* Go to the start page for PhpMyAdmin/Adminer again
* Create a bbdd named __tiki18svn__ and as collation select utf8mb4_unicode_ci
* Go to the users tab, and go to Databases
** Select the db tiki18svn, and check all perms except "grant" to that user for that db

And that's all. Then you will need to tell tiki that we have created:
* mysql db: tiki18svn
* mysql user: tikiuser
* mysql password: xxxxxxx (whatever you provided as password)

It is recommended to secure your phpMyAdmin by following the steps: https://www.atlantic.net/vps-hosting/how-to-install-and-secure-phpmyadmin-on-centos-8/

!!# Use bash instead of dash
Ubuntu 20.04 comes with dash as the default shell interpreter. And Tiki shell scripts expect bash instead of dash. Therefore, one easy solution is to setup bash for your user with sudo perms in the server to use bash by default. You can do so with the command (for user ''username''):

{CODE()}
usermod --shell /bin/bash yourusername
{CODE}

More information:
* https://wiki.ubuntu.com/ChangingShells
* https://www.scivision.dev/ubuntu-default-shell/
* https://superuser.com/questions/46748/how-do-i-make-bash-my-default-shell-on-ubuntu

!!# Install Tiki 21 through git
(url's taken from http://dev.tiki.org/Get+code )

We will fetch tiki21 through git shallow clone. This option is best to checkout on production servers. It uses about 187M of disk space. 

Change directory to /var/www and get that tiki21 clone:

{CODE(colors="shell")}
cd /var/www
git clone --depth=1 --branch=21.x https://gitlab.com/tikiwiki/tiki.git tiki21
{CODE}

Then we run the Tiki setup script through console:
{CODE(colors="shell")}
cd tiki21
bash setup.sh
{CODE}

The first question you will asked is about running composer to fetch the dependencies (libraries) which need to be downloaded for Tiki to run:
{CODE()}
# First choose:
Your choice [c]?: c
# Then choose to fix file and directory permissions (classic default):
Your choice [f]?: f
User [www-data]: www-data
Group [www-data]: www-data
Multi []: 
# Then you can quit from the setup.sh script:
Your choice [x]?: x
{CODE}

You can have a look at what the script does here:
https://gitlab.com/tikiwiki/tiki/-/blob/21.x/setup.sh

This script manages all Tiki dependencies through a program called "Composer" (it downloads and updated them when needed)

You need to make this tiki21 folder available through the webserver. 
You can easily do so by means of a symbolic link
{CODE()}
ln -s /var/www/tiki21 /var/www/html/tiki
{CODE}

Then you can proceed with the standard Tiki installation through the web browser (replace example.com with your domain name):
http://example.com/tiki/

and this will take us to __tiki-install.php__:
http://example.com/tiki/tiki-install.php

Tip for Spanish speakers: see the video from a course on Tiki:
* http://seeds4c.org/CT14
* http://seeds4c.org/CT14%20S1.1#Instalaci_n_del_software
+ (from miunte 9' 30'' onwards)

At the screen to Setup the database connection, we provide the database name, db user and password that we previosuly created and we follow instructions on screen. 

At the new installation, the first user is admin, with password admin. We replace the password and continue to log in for the first time.
You have your tiki installed, ready for you to continue using the ((Wizards))


!!# Get a free SSL Certificate from Let's Encrypt  
Install a repository to get updated version of packages that will just work:
{CODE(ln="1" colors="bash")}
#sudo add-apt-repository ppa:certbot/certbot
#sudo apt update
sudo apt install python3-certbot-apache 
{CODE}

Before we can start to create the SSL cert, set the domain name in the vhost configuration file. Open the default vhost file with an editor:
{CODE(ln="0" colors="bash")}
nano /etc/apache2/sites-available/000-default.conf
{CODE}

and add the line:
{CODE()}
ServerName example.com
{CODE}

Replace example.com with your fully qualified domain name.

Then create the SSL Certificate with this command:
{CODE(ln="0" colors="bash")}
sudo certbot --apache
{CODE}

The command will start a wizard that asks you several questions.
If you want further customization, use other options as described or linked from here:
https://certbot.eff.org/lets-encrypt/ubuntubionic-apache

!!!# Add some composer packages through console
If you want, you can add some packages through ((console))
{CODE(ln="1", colors="shell")}
sudo su
cd /var/www/html/
composer require --update-no-dev --prefer-dist mpdf/mpdf
composer require --update-no-dev --prefer-dist fullcalendar/fullcalendar-scheduler
composer require --update-no-dev --prefer-dist tikiwiki/diagram # updated for Tiki 21.x instead of mxgraph-editor
composer require --update-no-dev --prefer-dist onelogin/php-saml
composer require --update-no-dev --prefer-dist thiagoalessio/tesseract_ocr
# composer require --update-no-dev --prefer-dist npm-asset/pdfjs-dist-viewer-min
#composer require --update-no-dev --prefer-dist media-alchemyst/media-alchemyst
#composer require --update-no-dev --prefer-dist php-ffmpeg/php-ffmpeg
#composer require --update-no-dev --prefer-dist npm-asset/dexie
#composer require --update-no-dev --prefer-dist npm-asset/lozad
composer require --update-no-dev --prefer-dist google/apiclient
service apache2 restart
chown www-data:www-data composer.*
exit
{CODE}

! Related links
* https://www.howtoforge.com/tutorial/tiki-wiki-ubuntu/ - Tutorial showing installation of Tiki 21 from sf.net zip file into an Ubuntu 20.04 installation with ufw enabled (untested but looks very nice{sign user="xavi" datetime="2021-07-09T16:28:11+00:00"})

/////

!!# Install Lamp
You can install Linux, Apache, Mysql and PHP (plus a few other helper utils such as git or subversion, etc) with:
{CODE(ln="1" colors="bash")}
sudo apt install mysql-server mysql-client apache2 curl composer php php-tidy php-pear memcached php-gd php-xmlrpc phpmyadmin php-mbstring libapache2-mod-php php-mysql php-apcu php-curl php-intl php-sqlite3 php-zip postfix git subversion php-memcache php-gettext  php-pspell php-zip poppler-utils php-memcached bsdmainutils pstotext catdoc elinks man-db odt2txt php-pear pstotext php-common php-intl php7.2-opcache php7.2-xml php7.2-zip php7.2-ldap
{CODE}

^__Note__
If you need to install ((Tiki22)) or newer, since they require php 7.4, you will need to add a couple of extra repository to the server, in order to be able to install the php 7.4 packages.
{CODE(ln="1" colors="bash")}
sudo apt-get update
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/apache2
sudo apt-get update
sudo apt -y install php7.4 php7.4-tidy php7.4-gd php7.4-xmlrpc php7.4-mbstring php7.4-mysql php7.4-apcu php7.4-curl php7.4-intl php7.4-sqlite3 php7.4-zip php7.4-memcache php7.4-pspell php7.4-memcached php7.4-common php7.4-opcache php7.4-xml php7.4-ldap  php7.4-bcmath php7.4-soap
{CODE}
^
  
In case you have other php versions newer than 7.4 (such as php 8.0.x), you may set the default php version at 7.4 with these commands:
{CODE()}
sudo a2dismod php8.0
sudo a2enmod php7.4
sudo service apache2 restart
  
sudo update-alternatives --set php /usr/bin/php7.4
{CODE}

If it's a brand new server, you might be asked a few questions to configure some server programs.

To configure __postfix__ (program to mange email sending and  receiving from the server), you can answer, for instance (unless you know what you are doing):
* General type of mail configuration: __Internet site__
* System mail name: mail.yourdomain.org

To configure __phpmyadmin__ (program to manage mysql databases through a web based GUI), you can answer, for instance (unless you know what you are doing):
* Webserver: __apache2__ (you can select using the space bar and arrow keys if needed to move between the options)
* Configure database with dbconfig-common: yes
* MySQL application password for phpmyadmin: [[leave empty]



Then you can enable the modules
{CODE(colors="shell")}
#sudo phpenmod mcrypt # mcrypt is not found in php 7.2
sudo phpenmod mbstring
{CODE}

Extra packages for ((Media Alchemyst)):
{CODE(colors="shell")}
sudo apt install software-properties-common
sudo add-apt-repository ppa:libreoffice/libreoffice-6-0
sudo apt install libreoffice ffmpeg unoconv ghostscript php-imagick imagemagick
{CODE}


Enable the Apache rewrite rules:

{CODE(colors="shell", ln="1", caption="Command on a console")}
sudo  a2enmod rewrite
sudo  service apache2 restart
{CODE}

And you can enable the self-signed ssl certificates to allow connections with https:
{CODE(colors="shell", ln="1", caption="Command on a console")}
sudo a2enmod ssl
sudo a2ensite default-ssl
sudo  service apache2 restart
{CODE}

And add this section between the VirtualHost tags the to this file /etc/apache2/sites-enabled/000-default.conf (or equivalent for your configuration; in this case, the doc. root where tiki is installed is __/var/www/html/__, which is where ubuntu 16.04 comes pre-configured for the base doc root):

{CODE(colors=bash wrap=1)}sudo nano /etc/apache2/sites-enabled/000-default.conf{CODE}

Section to add (just after the Document root line):
{CODE(colors=xml ln=1)}
<Directory /var/www/html/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        ## The following lines to allow connections have changed syntax
        ## between apache 2.2 and apache 2.4
        ## See: http://httpd.apache.org/docs/2.4/upgrading.html  > Run-Time Configuration Changes > Access control
        #Order allow,deny
        #Allow from all
        Require all granted
 </Directory>
{CODE}

Do the same type of edit into the equivalent config file for https:
{CODE(colors=bash wrap=1)}sudo nano /etc/apache2/sites-enabled/default-ssl.conf{CODE}


After the change, they should look like:
{CODE(colors="shell", ln="1", caption="Contents of /etc/apache2/sites-enabled/000-default.conf")}
<VirtualHost *:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	#ServerName www.example.com

	ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

<Directory /var/www/html/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
        #Order allow,deny
        #Allow from all
        Require all granted
	</Directory>

	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.
	# It is also possible to configure the loglevel for particular
	# modules, e.g.
	#LogLevel info ssl:warn

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	# For most configuration files from conf-available/, which are
	# enabled or disabled at a global level, it is possible to
	# include a line for only one particular virtual host. For example the
	# following line enables the CGI configuration for this host only
	# after it has been globally disabled with "a2disconf".
	#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
{CODE}

{CODE(colors="shell", ln="1", caption="Contents of /etc/apache2/sites-enabled/default-ssl.conf")}
<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin webmaster@localhost

                DocumentRoot /var/www/html

<Directory /var/www/html/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        ## The following lines to allow connections have changed syntax
        ## between apache 2.2 and apache 2.4
        ## See: http://httpd.apache.org/docs/2.4/upgrading.html  > Run-Time Configuration Changes > Access control
        #Order allow,deny
        #Allow from all
        Require all granted
 </Directory>

                # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
                # error, crit, alert, emerg.
                # It is also possible to configure the loglevel for particular
                # modules, e.g.
                #LogLevel info ssl:warn

                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined

                # For most configuration files from conf-available/, which are
                # enabled or disabled at a global level, it is possible to
                # include a line for only one particular virtual host. For example the
                # following line enables the CGI configuration for this host only
                # after it has been globally disabled with "a2disconf".
                #Include conf-available/serve-cgi-bin.conf

                #   SSL Engine Switch:
                #   Enable/Disable SSL for this virtual host.
                SSLEngine on

                #   A self-signed (snakeoil) certificate can be created by installing
                #   the ssl-cert package. See
                #   /usr/share/doc/apache2/README.Debian.gz for more info.
                #   If both key and certificate are stored in the same file, only the
                #   SSLCertificateFile directive is needed.
                SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
                SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

                #   Server Certificate Chain:
                #   Point SSLCertificateChainFile at a file containing the
                #   concatenation of PEM encoded CA certificates which form the
                #   certificate chain for the server certificate. Alternatively
                #   the referenced file can be the same as SSLCertificateFile
                #   when the CA certificates are directly appended to the server
                #   certificate for convinience.
                #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt

                #   Certificate Authority (CA):
                #   Set the CA certificate verification path where to find CA
                #   certificates for client authentication or alternatively one
                #   huge file containing all of them (file must be PEM encoded)
                #   Note: Inside SSLCACertificatePath you need hash symlinks
                #                to point to the certificate files. Use the provided
                #                Makefile to update the hash symlinks after changes.
                #SSLCACertificatePath /etc/ssl/certs/
                #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

                #   Certificate Revocation Lists (CRL):
                #   Set the CA revocation path where to find CA CRLs for client
                #   authentication or alternatively one huge file containing all
                #   of them (file must be PEM encoded)
                #   Note: Inside SSLCARevocationPath you need hash symlinks
                #                to point to the certificate files. Use the provided
                #                Makefile to update the hash symlinks after changes.
                #SSLCARevocationPath /etc/apache2/ssl.crl/
                #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

                #   Client Authentication (Type):
                #   Client certificate verification type and depth.  Types are
                #   none, optional, require and optional_no_ca.  Depth is a
                #   number which specifies how deeply to verify the certificate
                #   issuer chain before deciding the certificate is not valid.
                #SSLVerifyClient require
                #SSLVerifyDepth  10

                #   SSL Engine Options:
                #   Set various options for the SSL engine.
                #   o FakeBasicAuth:
                #        Translate the client X.509 into a Basic Authorisation.  This means that
                #        the standard Auth/DBMAuth methods can be used for access control.  The
                #        user name is the `one line' version of the client's X.509 certificate.
                #        Note that no password is obtained from the user. Every entry in the user
                #        file needs this password: `xxj31ZMTZzkVA'.
                #   o ExportCertData:
                #        This exports two additional environment variables: SSL_CLIENT_CERT and
                #        SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
                #        server (always existing) and the client (only existing when client
                #        authentication is used). This can be used to import the certificates
                #        into CGI scripts.
                #   o StdEnvVars:
                #        This exports the standard SSL/TLS related `SSL_*' environment variables.
                #        Per default this exportation is switched off for performance reasons,
                #        because the extraction step is an expensive operation and is usually
                #        useless for serving static content. So one usually enables the
                #        exportation for CGI and SSI requests only.
                #   o OptRenegotiate:
               #        This enables optimized SSL connection renegotiation handling when SSL
                #        directives are used in per-directory context.
                #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>

                #   SSL Protocol Adjustments:
                #   The safe and default but still SSL/TLS standard compliant shutdown
                #   approach is that mod_ssl sends the close notify alert but doesn't wait for
                #   the close notify alert from client. When you need a different shutdown
                #   approach you can use one of the following variables:
                #   o ssl-unclean-shutdown:
                #        This forces an unclean shutdown when the connection is closed, i.e. no
                #        SSL close notify alert is send or allowed to received.  This violates
                #        the SSL/TLS standard but is needed for some brain-dead browsers. Use
                #        this when you receive I/O errors because of the standard approach where
                #        mod_ssl sends the close notify alert.
                #   o ssl-accurate-shutdown:
                #        This forces an accurate shutdown when the connection is closed, i.e. a
                #        SSL close notify alert is send and mod_ssl waits for the close notify
                #        alert of the client. This is 100% SSL/TLS standard compliant, but in
                #        practice often causes hanging connections with brain-dead browsers. Use
                #        this only for browsers where you know that their SSL implementation
                #        works correctly.
                #   Notice: Most problems of broken clients are also related to the HTTP
                #   keep-alive facility, so you usually additionally want to disable
                #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
                #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
                #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
                #   "force-response-1.0" for this.
                # BrowserMatch "MSIE [2-6]" \
                #               nokeepalive ssl-unclean-shutdown \
                #               downgrade-1.0 force-response-1.0

        </VirtualHost>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
{CODE}

!!# Create for tiki a mysql db and a mysql user with local perms for that db
!!! Option 1 - using console
We can create a database and user for tiki. We can do so through a terminal windows converting ourselves in root in a first step with -+sudo su+-, and then, we can continue with the mysql commands. Please note that when executing -+mysql -++- (as root) you need to provide no password, since mysql authenticaation scheme in Ubuntu 18.04 only requires that you run this command as user root in the shell.

{CODE(colors="shell" ln="1" caption="commands in a terminal window")}
# sudo su

# mysql -p

# mysql> CREATE DATABASE mytikidb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

# mysql> GRANT ALL PRIVILEGES ON mytikidb.* TO 'mytikiuser'@'localhost' IDENTIFIED BY 'mypassword';

# mysql> FLUSH PRIVILEGES;

# mysql> \q
{CODE}

If it's a brand new server, you are encouraged to secure your mysql installation with the provided script ( -+sudo mysql_secure_installation+- ), and do the recommended setup steps indicated here:
https://vitux.com/how-to-install-and-configure-mysql-in-ubuntu-18-04-lts/

!!! Option 2 - use phpmyadmin or adminer
Alternatively, you can use your PhpMyAdmin install:
http://example.com/phpmyadmin/

or a small php script to manage your mysql server, called [https://www.adminer.org/|Adminer], that you can download to your server with an instruction like this one in a terminal:
{CODE(colors="shell" ln=1)}
sudo wget https://www.adminer.org/latest-mysql-en.php -O "/var/www/html/tiki/adminer.php"
# once you are done with managing your database and users, you are encouraged to remove adminer.php from the web access to somewhere else unaccessible from your web root for extra precaution
sudo mv /var/www/html/tiki/adminer.php /var/www/
{CODE}

Then you can login to your GUI web access (either phpmyadmin or adminer). You will probably not be able to login with your mysql root password, since the msyql auth scheme in ubuntu 18.04 has changed compared to previous versions (it currently uses auth_socket instead of native_mysql_password). 
Therefore, you can use the -+debian-sys-maint+- credentials that you will find here:
-+/etc/mysql/debian.cnf+-

* Create a new user for mysql that does NOT have all perms
** New user is __tikiuser__, and we do not select neither database nor general perms for this user.
* Go to the start page for PhpMyAdmin/Adminer again
* Create a bbdd named __tiki18svn__ and as collation select utf8mb4_unicode_ci
* Go to the users tab, and go to Databases
** Select the db tiki18svn, and check all perms except "grant" to that user for that db

And that's all. Then you will need to tell tiki that we have created:
* mysql db: tiki18svn
* mysql user: tikiuser
* mysql password: xxxxxxx (whatever you provided as password)

!!# Use bash instead of dash
Ubuntu 18.04 comes with dash as the default shell interpreter. And Tiki shell scripts expect bash instead of dash. Therefore, one easy solution is to setup bash for your user with sudo perms in the server to use bash by default. You can do so with the command (for user ''username''):

{CODE()}
usermod --shell /bin/bash yourusername
{CODE}

More information:
* https://wiki.ubuntu.com/ChangingShells
* https://www.scivision.dev/ubuntu-default-shell/
* https://superuser.com/questions/46748/how-do-i-make-bash-my-default-shell-on-ubuntu

!!# Install Tiki 21 through git
(url's taken from http://dev.tiki.org/Get+code )

We will fetch tiki21 through git shallow clone. This option is best to checkout on production servers. It uses about 187M of disk space. 

Change directory to /var/www and get that tiki21 clone:

{CODE(colors="shell")}
cd /var/www
git clone --depth=1 --branch=21.x https://gitlab.com/tikiwiki/tiki.git tiki21
{CODE}

Then we run the Tiki setup script through console:
{CODE(colors="shell")}
cd tiki21
bash setup.sh
{CODE}

The first question you will asked is about running composer to fetch the dependencies (libraries) which need to be downloaded for Tiki to run:
{CODE()}
# First choose:
Your choice [c]?: c
# Then choose to fix file and directory permissions (classic default):
Your choice [f]?: f
User [www-data]: www-data
Group [www-data]: www-data
Multi []: 
# Then you can quit from the setup.sh script:
Your choice [x]?: x
{CODE}

You can have a look at what the script does here:
https://gitlab.com/tikiwiki/tiki/-/blob/21.x/setup.sh

This script manages all Tiki dependencies through a program called "Composer" (it downloads and updated them when needed)

You need to make this tiki21 folder available through the webserver. 
You can easily do so by means of a symbolic link
{CODE()}
ln -s /var/www/tiki21 /var/www/html/tiki
{CODE}

Then you can proceed with the standard Tiki installation through the web browser (replace example.com with your domain name):
http://example.com/tiki/

and this will take us to __tiki-install.php__:
http://example.com/tiki/tiki-install.php

Tip for Spanish speakers: see the video from a course on Tiki:
* http://seeds4c.org/CT14
* http://seeds4c.org/CT14%20S1.1#Instalaci_n_del_software
+ (from miunte 9' 30'' onwards)

At the screen to Setup the database connection, we provide the database name, db user and password that we previosuly created and we follow instructions on screen. 

At the new installation, the first user is admin, with password admin. We replace the password and continue to log in for the first time.
You have your tiki installed, ready for you to continue using the ((Wizards))


!!!# Additional step for H5P
It seems that you need to create a folder for h5p to work as expected (in case you have ((H5P)) enabled in your site); otherwise, when you attempt to upload a file to a file gallery, you get an error message saying that Tiki cannot write to the corresponding folder from h5p.

You can run these commands, from the tiki root folder in the server:
{CODE()}
sudo mkdir storage/public/h5p
sudo chmod 775 storage/public/h5p
{CODE}

!!# Get a free SSL Certificate from Let's Encrypt  
Install a repository to get updated version of packages that will just work:
{CODE(ln="1" colors="bash")}
sudo add-apt-repository ppa:certbot/certbot
sudo apt update
sudo apt install python-certbot-apache 
{CODE}

Before we can start to create the SSL cert, set the domain name in the vhost configuration file. Open the default vhost file with an editor:
{CODE(ln="0" colors="bash")}
nano /etc/apache2/sites-available/000-default.conf
{CODE}

and add the line:
{CODE()}
ServerName example.com
{CODE}

Replace example.com with your fully qualified domain name.

Then create the SSL Certificate with this command:
{CODE(ln="0" colors="bash")}
sudo certbot --apache
{CODE}

The command will start a wizard that asks you several questions.
If you want further customization, use other options as described or linked from here:
https://certbot.eff.org/lets-encrypt/ubuntubionic-apache

!!!# Add some composer packages through console
If you want, you can add some packages through ((console))
{CODE(ln="1", colors="shell")}
sudo su
cd /var/www/html/
composer require --update-no-dev --prefer-dist mpdf/mpdf
composer require --update-no-dev --prefer-dist fullcalendar/fullcalendar-scheduler
#composer require --update-no-dev --prefer-dist xorti/mxgraph-editor # deprecated for Tiki 21.x
composer require --update-no-dev --prefer-dist tikiwiki/diagram # updated for Tiki 21.x instead of mxgraph-editor
composer require --update-no-dev --prefer-dist onelogin/php-saml
composer require --update-no-dev --prefer-dist thiagoalessio/tesseract_ocr
# composer require --update-no-dev --prefer-dist npm-asset/pdfjs-dist-viewer-min
#composer require --update-no-dev --prefer-dist media-alchemyst/media-alchemyst
#composer require --update-no-dev --prefer-dist php-ffmpeg/php-ffmpeg
#composer require --update-no-dev --prefer-dist npm-asset/dexie
#composer require --update-no-dev --prefer-dist npm-asset/lozad
composer require --update-no-dev --prefer-dist google/apiclient
service apache2 restart
chown www-data:www-data composer.*
exit
{CODE}

/////

!!# Install Lamp
You can install Linux, Apache, Mysql and PHP (plus a few other helper utils such as subversion, etc) with:
{CODE(ln="1" colors="bash")}
sudo apt install mysql-server mysql-client apache2 php php-tidy php-pear memcached php-gd php-xmlrpc php-xml-parser phpmyadmin php-mbstring php-mcrypt  libapache2-mod-php php-mysql php-opcache php-apcu php-curl php-intl php-sqlite3 postfix subversion php-memcache php-gettext  php-pspell php-zip poppler-utils php-memcached bsdmainutils pstotext catdoc elinks man-db odt2txt php-pear pstotext php-common
{CODE}

Then you can enable the modules
{CODE(colors="shell")}
sudo phpenmod mcrypt
sudo phpenmod mbstring
{CODE}

Extra packages for ((Media Alchemyst)):
{CODE(colors="shell")}
sudo add-apt-repository ppa:libreoffice/libreoffice-5-1
sudo apt install libreoffice
sudo apt-get install ffmpeg
sudo apt-get install unoconv
sudo apt-get install ghostscript
sudo apt-get install php-imagick
sudo apt-get install imagemagick
{CODE}


Enable the Apache rewrite rules:

{CODE(colors="shell", ln="1", caption="Command on a console")}
sudo  a2enmod rewrite
sudo  service apache2 restart
{CODE}

And you can enable the self-signed ssl certificates to allow connections with https:
{CODE(colors="shell", ln="1", caption="Command on a console")}
sudo a2enmod ssl
sudo a2ensite default-ssl
sudo  service apache2 restart
{CODE}

And add this section between the VirtualHost tags the to this file /etc/apache2/sites-enabled/000-default.conf (or equivalent for your configuration; in this case, the doc. root where tiki is installed is __/var/www/html/__, which is where ubuntu 16.04 comes pre-configured for the base doc root):

{CODE(colors=bash wrap=1)}sudo nano /etc/apache2/sites-enabled/000-default.conf{CODE}

Section to add (just after the Document root line):
{CODE(colors=xml ln=1)}
<Directory /var/www/html/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        ## The following lines to allow connections have changed syntax
        ## between apache 2.2 and apache 2.4
        ## See: http://httpd.apache.org/docs/2.4/upgrading.html  > Run-Time Configuration Changes > Access control
        #Order allow,deny
        #Allow from all
        Require all granted
 </Directory>
{CODE}

Do the same type of edit into the equivalent config file for https:
{CODE(colors=bash wrap=1)}sudo nano /etc/apache2/sites-enabled/default-ssl.conf{CODE}


After the change, they should look like:
{CODE(colors="shell", ln="1", caption="Contents of /etc/apache2/sites-enabled/000-default.conf")}
<VirtualHost *:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	#ServerName www.example.com

	ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

<Directory /var/www/html/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
        #Order allow,deny
        #Allow from all
        Require all granted
	</Directory>

	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.
	# It is also possible to configure the loglevel for particular
	# modules, e.g.
	#LogLevel info ssl:warn

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	# For most configuration files from conf-available/, which are
	# enabled or disabled at a global level, it is possible to
	# include a line for only one particular virtual host. For example the
	# following line enables the CGI configuration for this host only
	# after it has been globally disabled with "a2disconf".
	#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
{CODE}

{CODE(colors="shell", ln="1", caption="Contents of /etc/apache2/sites-enabled/default-ssl.conf")}
<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin webmaster@localhost

                DocumentRoot /var/www/html

<Directory /var/www/html/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        ## The following lines to allow connections have changed syntax
        ## between apache 2.2 and apache 2.4
        ## See: http://httpd.apache.org/docs/2.4/upgrading.html  > Run-Time Configuration Changes > Access control
        #Order allow,deny
        #Allow from all
        Require all granted
 </Directory>

                # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
                # error, crit, alert, emerg.
                # It is also possible to configure the loglevel for particular
                # modules, e.g.
                #LogLevel info ssl:warn

                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined

                # For most configuration files from conf-available/, which are
                # enabled or disabled at a global level, it is possible to
                # include a line for only one particular virtual host. For example the
                # following line enables the CGI configuration for this host only
                # after it has been globally disabled with "a2disconf".
                #Include conf-available/serve-cgi-bin.conf

                #   SSL Engine Switch:
                #   Enable/Disable SSL for this virtual host.
                SSLEngine on

                #   A self-signed (snakeoil) certificate can be created by installing
                #   the ssl-cert package. See
                #   /usr/share/doc/apache2/README.Debian.gz for more info.
                #   If both key and certificate are stored in the same file, only the
                #   SSLCertificateFile directive is needed.
                SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
                SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

                #   Server Certificate Chain:
                #   Point SSLCertificateChainFile at a file containing the
                #   concatenation of PEM encoded CA certificates which form the
                #   certificate chain for the server certificate. Alternatively
                #   the referenced file can be the same as SSLCertificateFile
                #   when the CA certificates are directly appended to the server
                #   certificate for convinience.
                #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt

                #   Certificate Authority (CA):
                #   Set the CA certificate verification path where to find CA
                #   certificates for client authentication or alternatively one
                #   huge file containing all of them (file must be PEM encoded)
                #   Note: Inside SSLCACertificatePath you need hash symlinks
                #                to point to the certificate files. Use the provided
                #                Makefile to update the hash symlinks after changes.
                #SSLCACertificatePath /etc/ssl/certs/
                #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

                #   Certificate Revocation Lists (CRL):
                #   Set the CA revocation path where to find CA CRLs for client
                #   authentication or alternatively one huge file containing all
                #   of them (file must be PEM encoded)
                #   Note: Inside SSLCARevocationPath you need hash symlinks
                #                to point to the certificate files. Use the provided
                #                Makefile to update the hash symlinks after changes.
                #SSLCARevocationPath /etc/apache2/ssl.crl/
                #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

                #   Client Authentication (Type):
                #   Client certificate verification type and depth.  Types are
                #   none, optional, require and optional_no_ca.  Depth is a
                #   number which specifies how deeply to verify the certificate
                #   issuer chain before deciding the certificate is not valid.
                #SSLVerifyClient require
                #SSLVerifyDepth  10

                #   SSL Engine Options:
                #   Set various options for the SSL engine.
                #   o FakeBasicAuth:
                #        Translate the client X.509 into a Basic Authorisation.  This means that
                #        the standard Auth/DBMAuth methods can be used for access control.  The
                #        user name is the `one line' version of the client's X.509 certificate.
                #        Note that no password is obtained from the user. Every entry in the user
                #        file needs this password: `xxj31ZMTZzkVA'.
                #   o ExportCertData:
                #        This exports two additional environment variables: SSL_CLIENT_CERT and
                #        SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
                #        server (always existing) and the client (only existing when client
                #        authentication is used). This can be used to import the certificates
                #        into CGI scripts.
                #   o StdEnvVars:
                #        This exports the standard SSL/TLS related `SSL_*' environment variables.
                #        Per default this exportation is switched off for performance reasons,
                #        because the extraction step is an expensive operation and is usually
                #        useless for serving static content. So one usually enables the
                #        exportation for CGI and SSI requests only.
                #   o OptRenegotiate:
               #        This enables optimized SSL connection renegotiation handling when SSL
                #        directives are used in per-directory context.
                #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>

                #   SSL Protocol Adjustments:
                #   The safe and default but still SSL/TLS standard compliant shutdown
                #   approach is that mod_ssl sends the close notify alert but doesn't wait for
                #   the close notify alert from client. When you need a different shutdown
                #   approach you can use one of the following variables:
                #   o ssl-unclean-shutdown:
                #        This forces an unclean shutdown when the connection is closed, i.e. no
                #        SSL close notify alert is send or allowed to received.  This violates
                #        the SSL/TLS standard but is needed for some brain-dead browsers. Use
                #        this when you receive I/O errors because of the standard approach where
                #        mod_ssl sends the close notify alert.
                #   o ssl-accurate-shutdown:
                #        This forces an accurate shutdown when the connection is closed, i.e. a
                #        SSL close notify alert is send and mod_ssl waits for the close notify
                #        alert of the client. This is 100% SSL/TLS standard compliant, but in
                #        practice often causes hanging connections with brain-dead browsers. Use
                #        this only for browsers where you know that their SSL implementation
                #        works correctly.
                #   Notice: Most problems of broken clients are also related to the HTTP
                #   keep-alive facility, so you usually additionally want to disable
                #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
                #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
                #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
                #   "force-response-1.0" for this.
                # BrowserMatch "MSIE [2-6]" \
                #               nokeepalive ssl-unclean-shutdown \
                #               downgrade-1.0 force-response-1.0

        </VirtualHost>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
{CODE}

!!# Create for tiki a mysql db and a mysql user with local perms for that db
Use your PhpMyAdmin install:
http://example.com/phpmyadmin/

If you can't login with your mysql root password, you can use the -+debian-sys-maint+- crdentials that you will find here:
-+/etc/mysql/debian.cnf+-

* Go to users: We remove debian-sys-maint user, to prevent system upgrades from eventually touching the mysql db's.
* Create a new user for mysql that does NOT have all perms
** New user is __tikiuser__, and we do not select neither database nor general perms for this user.
* Go to the start page for PhpMyAdmin again
* Create a bbdd named __tiki18svn__ and as collation select UTF8_unicode_ci
* Go to the users tab, and go to Databases
** Select the db tiki18svn, and check all perms except "grant" to that user for that db

And that's all. Then you will need to tell tiki that we have created:
* mysql db: tiki18svn
* mysql user: tikiuser
* mysql password: xxxxxxx (whatever you provided as password)

Alternatively, if we don't use control panel we can create a database and user for tiki.
{CODE(colors="shell" ln="1")}
# mysql -p

# mysql> CREATE DATABASE youraccountname_tiki;

# mysql> GRANT ALL PRIVILEGES ON youraccountname_tiki.* TO 'youraccountname_yourusername'@'localhost' IDENTIFIED BY 'yourpassword';

# mysql> \q
{CODE}

!!# Install Tiki 21 through git
(url's taken from http://dev.tiki.org/Get+code )

We will fetch tiki21 through git shallow clone. This option is best to checkout on production servers. It uses about 187M of disk space. 

Change directory to /var/www and get that tiki21 clone:

{CODE(colors="shell")}
cd /var/www
git clone --depth=1 --branch=21.x https://gitlab.com/tikiwiki/tiki.git tiki21
{CODE}

Then we run the Tiki setup script through console:
{CODE(colors="shell")}
cd tiki21
bash setup.sh
{CODE}

The first question you will asked is about running composer to fetch the dependencies (libraries) which need to be downloaded for Tiki to run:
{CODE()}
# First choose:
Your choice [c]?: c
# Then choose to fix file and directory permissions (classic default):
Your choice [f]?: f
User [www-data]: www-data
Group [www-data]: www-data
Multi []: 
# Then you can quit from the setup.sh script:
Your choice [x]?: x
{CODE}

You can have a look at what the script does here:
https://gitlab.com/tikiwiki/tiki/-/blob/21.x/setup.sh

This script manages all Tiki dependencies through a program called "Composer" (it downloads and updated them when needed)

You need to make this tiki21 folder available through the webserver. 
You can easily do so by means of a symbolic link
{CODE()}
ln -s /var/www/tiki21 /var/www/html/tiki
{CODE}

Then you can proceed with the standard Tiki installation through the web browser (replace example.com with your domain name):
http://example.com/tiki/

and this will take us to __tiki-install.php__:
http://example.com/tiki/tiki-install.php

Tip for Spanish speakers: see the video from a course on Tiki:
* http://seeds4c.org/CT14
* http://seeds4c.org/CT14%20S1.1#Instalaci_n_del_software
+ (from miunte 9' 30'' onwards)

At the screen to Setup the database connection, we provide the database name, db user and password that we previosuly created and we follow instructions on screen. 

At the new installation, the first user is admin, with password admin. We replace the password and continue to log in for the first time.
You have your tiki installed, ready for you to continue using the ((Wizards))


!!# Get a free SSL Certificate from Let's Encrypt  
Install a repository to get updated version of packages that will just work:
{CODE(ln="1" colors="bash")}
sudo add-apt-repository ppa:certbot/certbot
sudo apt update
sudo apt install python-certbot-apache 
{CODE}

Before we can start to create the SSL cert, set the domain name in the vhost configuration file. Open the default vhost file with an editor:
{CODE(ln="0" colors="bash")}
nano /etc/apache2/sites-available/000-default.conf
{CODE}

and add the line:
{CODE()}
ServerName example.com
{CODE}

Replace example.com with your fully qualified domain name.

Then create the SSL Certificate with this command:
{CODE(ln="0" colors="bash")}
sudo certbot --apache
{CODE}

The command will start a wizard that asks you several questions.
If you want further customization, use other options as described or linked from here:
https://certbot.eff.org/lets-encrypt/ubuntuxenial-apache
{TABS}

Alias names for this page:
(alias(UbuntuInstall)) | (alias(Install Ubuntu)) | (alias(InstallUbuntu))
        

History

Advanced
Information Version
Xavier de Pedro 152
Xavi (as xavidp - admin) command to start manticore search server side 151
Xavier de Pedro info for tiki26 and manticore search 150
Volker Wysk Noted that Tiki 25 actually needs PHP 7.4 149
Xavier de Pedro replacing mysql with mariaadb, otherwise the instructions further down in the tutorial will faill, because root will not be able to connect withtout password to mysql in the console, and changing that setup is too complicated for intro tutorial 148
Volker Wysk 147
Xavier de Pedro 146
Xavier de Pedro 145
Xavier de Pedro removed section (tab) for 16.04 and added tab for 22.04 cloning content (as a starting point) from the tab 20.04. 144
Xavier de Pedro missing package 143
Xavier de Pedro added php7.4-bz2 142
Xavier de Pedro added libapache2-mod-php7.4 as it was not explicitly listed 141
Xavi (as xavidp - admin) 140
Xavi (as xavidp - admin) 139
Xavi (as xavidp - admin) 138
Xavi (as xavidp - admin) 137
Xavier de Pedro 136
Xavier de Pedro 135
Xavier de Pedro 134
Xavier de Pedro 133
Xavier de Pedro added info on how to set default phhp v to 7.4 (instead of 8.0.x for instance) and add git to the list of programs to get installed 132
Xavier de Pedro removed old content 131
Xavier de Pedro 130
Xavier de Pedro 129
Xavier de Pedro 128
Hitesh mohanbhai jethva Add a link to secure phpMyAdmin 127
Xavier de Pedro 126
Xavier de Pedro updated php modules needed for tiki22 125
aristo compasso mysql 8 syntax changed for creating user and granting privileges 124
aristo compasso Updated install LAMP command. php7.2 packages are not found, 123
Xavier de Pedro 122
Xavier de Pedro 121
Xavier de Pedro 120
Xavier de Pedro 119
Xavier de Pedro 118
Xavier de Pedro added ldap php module for the cases in which tiki admins would like to setup conection/login against ldap server 117
Xavier de Pedro 116
Xavier de Pedro 115
Xavier de Pedro 114
Xavier de Pedro 113
Xavier de Pedro 112
Xavier de Pedro 111
Xavier de Pedro 110
Xavier de Pedro 109
Xavier de Pedro 108
Xavier de Pedro 107
Xavier de Pedro 106
Xavier de Pedro 105
Xavier de Pedro 104
Xavier de Pedro 103