Last edited one year ago
by Richard Heigl

Integration of third party content and Setup:Installation Guide/System Preparation/Linux/Apache and PHP: Difference between pages

(Difference between pages)
(Changed categories.)
 
No edit summary
Tag: 2017 source edit
 
Line 1: Line 1:
Integration of third party content into a wiki page can be achieved in various ways. It depends on several factors:
{{DISPLAYTITLE:Installing  Apache and PHP on Linux}}
__TOC__
{{Messagebox|boxtype=important|Note text=The web server delivers your BlueSpice installation to the user's browser. Without a web server, BlueSpice cannot be used. The source code of BlueSpice is based on the scripting language "PHP". This must also be installed on your server in order to operate BlueSpice. The steps listed here are required.}}
==Introduction==
Apache or Nginx are available as web servers under Linux. BlueSpice can theoretically also be operated with Nginx, but in this documentation only Apache is treated in detail. Of course, you can also install Nginx with the appropriate expertise and operate it according to the here documented Virtualhost configuration of Apache.
{{Messagebox|boxtype=note|Note text=If "User is not in the sudoers file." type "su" in the terminal and execute. Write a "sudo" in front of a command.}}
==Installation==
Install Apache and PHP using the Aptitude package manager with the following steps:
<pre>
apt update; \
apt install apache2 \
    libapache2-mod-php7.4 \
    php7.4 \
    php7.4-cli \
    php7.4-common \
    php7.4-curl \
    php7.4-gd \
    php7.4-intl \
    php7.4-json \
    php7.4-mbstring \
    php7.4-mysql \
    php7.4-opcache \
    php7.4-tidy \
    php7.4-xml \
    php7.4-zip; \
apt clean
</pre>Depending on requirements, further PHP extensions may be necessary, e.g. for an LDAP connection.


== Embedding support by 3rd party ==
==Configuring PHP==
Does the software actively or via interfaces support embedding? Most web-based services nowadays do so, but some restrict functionality.
After the installation has been completed, first configure PHP. First change to the directory <code>/etc/php/7.4/apache2</code> through the terminal and then execute the <code>php.ini</code> file with the command <code>nano php.ini.</code>


* '''Embedding widgets available:''' Does the 3rd party provide some widget code, which can be used for embedding? In the best case, the 3rd party already has some snippets ready, which do all the necessary embedding. This is the case e.g. for YouTube videos. In this case, we use the extension Widgets to create a wrapper, which includes the snippets mostly as they are provided. This is required for security reasons.  Embeddings are very good for displaying complex content, such as video players, specialized graphics, dynamic diagrams, and so on, which require some sort of player.
Find the following settings and change the values accordingly. If a setting is commented out with a semicolon in front of it, please remove it.
* '''API provided:''' If the 3rd party provides API access, an extension needs to be written, which calls the API and pulls the relevant data. This data then has to be transformed and be presented within the wiki. Depending on the complexity of the API, this can be a very simple task, but also a very challenging endeavor. API is very good for asking complex queries to the 3rd party database, and when the focus is mostly on the data retrieved (as opposed to the visualization).
* '''SDK provided:''' Some 3rd parties provide software development kits that help creating complex applications on top of the software. Using SDKs is the best means when there is some complex interaction required between the wiki and the 3rd party, but typically the development of such connectors is very time-intense.


== Authentication and access control ==
<pre>
This is a limiting factor to which of the above ways can be used.
date.timezone = Europe/Berlin
max_execution_time = 600
post_max_size = 128M
upload_max_filesize = 128M
</pre>


* '''Client (browser) based authentication:''' The user has to be logged into the 3rd party system. On the pro side, the application has full control over authentication and access control. On the con side, this can be a nuisance in case there is no single login system in place, since the user will be prompted for logins.
Set the value for 'date.timezone' according to your own time zone.
* '''Server side authentication:''' Communication between the 3rd party and the wiki is done on the server side. This means, the server has to take control over authentication. In this scenario, typically, communication takes place using a proxy user. On the pro side, this means the wiki user does not care about authentication. On the con side, however, per-user access control becomes hard to implement. It is possible, though.


== Level of integration ==
Save and exit the php.ini again.
==Configuring Apache==
{{Messagebox|boxtype=note|Note text=In this documentation, we assume the recommended installation with [https://www.mediawiki.org/wiki/Manual:Short_URL ShortURL]. In this case, the root directory of the web server is in <code>/var/www/bluespice</code>, but the actual source code of BlueSpice is in <code>/var/www/bluespice/w</code>. This configuration is designed accordingly.<br>


* '''Tease and redirect:''' In some scenarios, an integration wants to only get the attention of a user. For deep interaction, the user is redirected to the 3rd party software. This is the case, e.g., for embedding a ticket system number (which simply shows the ticket state, but for any interaction, the user has to follow the link to the ticket system).
'''Multiple virtual hosts'''
* '''Full read:''' In this scenario, the embedded content should be fully readable, such as with videos or graphics. There is no editing required.
This guide applies to cases where BlueSpice is being installed on a dedicated server. If you have other virtual hosts configured, you may need to specify an alias for the <code>/w/</code> subfolder (e.g. by using <code>Alias /w/ /path/to/w/</code>).  
* '''Full interact:''' In this scenario, the full range of interaction should be supported. This is the case in BlueSpice with embedding Draw.io diagrams.


There are several technical ways of embedding content. Mostly, we would try to work with widgets, as long as there is an embedding code or some ''iframe'' solution.
}}
[[Category:Customization]]
 
To configure a VirtualHost for BlueSpice, please proceed as follows:
 
#Change to the directory <code>/etc/apache2/sites-available </code>.
#In a text editor of your choice, open the file <code>bluespice.conf</code>, which does not yet exist, and create it. Copy the entire contents of the following file into this new configuration file:
##For BlueSpice free: [[Media:Setup:apache vhost bluespice free.txt|apache_vhost_bluespice_free.txt]]
##For BlueSpice pro: [[Media:Setup:apache vhost bluespice pro.txt|apache_vhost_bluespice_pro.txt]]
#In rows 3 and 4, replace "SERVERNAME" and "SERVERALIAS" according to your server name and domain. If the server is explicitly operated with only one VirtualHost for BlueSpice, you can also completely remove these two lines.
#Save the file and close it.
 
 
 
Delete the VirtualHost created by default during the Apache installation with the command <code>a2dissite 000-default</code>. Then activate the just created VirtualHost with the command <code>a2ensite bluespice</code>.
 
Next, activate the Module Rewrite, which we configured in the <code>bluespice.conf</code>, by entering the following command: <code>a2enmod rewrite</code>
 
Next, create the directory <code>/var/www/bluespice</code>(<code>mkdir/var/www/bluespice</code>) and restart Apache with the command <code>service apache2 restart</code>.
 
Next, call up the URL of your BlueSpice server (localhost). If configured correctly, Apache should respond to the request with the error message "Not found", which is completely correct at the time of installation.
 
[[File:Setup:apache_not_found.png|frameless]]
 
==Next step==
If you have successfully completed all these steps, you can proceed to the next step "[[Setup: Installation Guide/System Preparation/Linux/MariaDB | MariaDB]]".
 
[[en:{{FULLPAGENAME}}]]
[[de:Setup:Installationsanleitung/Systemvorbereitung/Linux/Apache_und_PHP]]

Revision as of 13:57, 17 May 2023

Important!The web server delivers your BlueSpice installation to the user's browser. Without a web server, BlueSpice cannot be used. The source code of BlueSpice is based on the scripting language "PHP". This must also be installed on your server in order to operate BlueSpice. The steps listed here are required.

Introduction

Apache or Nginx are available as web servers under Linux. BlueSpice can theoretically also be operated with Nginx, but in this documentation only Apache is treated in detail. Of course, you can also install Nginx with the appropriate expertise and operate it according to the here documented Virtualhost configuration of Apache.

Note:If "User is not in the sudoers file." type "su" in the terminal and execute. Write a "sudo" in front of a command.

Installation

Install Apache and PHP using the Aptitude package manager with the following steps:

apt update; \
apt install apache2 \
    libapache2-mod-php7.4 \
    php7.4 \
    php7.4-cli \
    php7.4-common \
    php7.4-curl \
    php7.4-gd \
    php7.4-intl \
    php7.4-json \
    php7.4-mbstring \
    php7.4-mysql \
    php7.4-opcache \
    php7.4-tidy \
    php7.4-xml \
    php7.4-zip; \
apt clean

Depending on requirements, further PHP extensions may be necessary, e.g. for an LDAP connection.

Configuring PHP

After the installation has been completed, first configure PHP. First change to the directory /etc/php/7.4/apache2 through the terminal and then execute the php.ini file with the command nano php.ini.

Find the following settings and change the values accordingly. If a setting is commented out with a semicolon in front of it, please remove it.

date.timezone = Europe/Berlin
max_execution_time = 600
post_max_size = 128M
upload_max_filesize = 128M

Set the value for 'date.timezone' according to your own time zone.

Save and exit the php.ini again.

Configuring Apache

Note:In this documentation, we assume the recommended installation with ShortURL. In this case, the root directory of the web server is in /var/www/bluespice, but the actual source code of BlueSpice is in /var/www/bluespice/w. This configuration is designed accordingly.

Multiple virtual hosts

This guide applies to cases where BlueSpice is being installed on a dedicated server. If you have other virtual hosts configured, you may need to specify an alias for the /w/ subfolder (e.g. by using Alias /w/ /path/to/w/).


To configure a VirtualHost for BlueSpice, please proceed as follows:

  1. Change to the directory /etc/apache2/sites-available .
  2. In a text editor of your choice, open the file bluespice.conf, which does not yet exist, and create it. Copy the entire contents of the following file into this new configuration file:
    1. For BlueSpice free: apache_vhost_bluespice_free.txt
    2. For BlueSpice pro: apache_vhost_bluespice_pro.txt
  3. In rows 3 and 4, replace "SERVERNAME" and "SERVERALIAS" according to your server name and domain. If the server is explicitly operated with only one VirtualHost for BlueSpice, you can also completely remove these two lines.
  4. Save the file and close it.


Delete the VirtualHost created by default during the Apache installation with the command a2dissite 000-default. Then activate the just created VirtualHost with the command a2ensite bluespice.

Next, activate the Module Rewrite, which we configured in the bluespice.conf, by entering the following command: a2enmod rewrite

Next, create the directory /var/www/bluespice(mkdir/var/www/bluespice) and restart Apache with the command service apache2 restart.

Next, call up the URL of your BlueSpice server (localhost). If configured correctly, Apache should respond to the request with the error message "Not found", which is completely correct at the time of installation.

Setup:apache not found.png

Next step

If you have successfully completed all these steps, you can proceed to the next step " MariaDB".



To submit feedback about this documentation, visit our community forum.

No categories assignedEdit

Discussions