Manual:Extension/BlueSpiceExtendedSearch and Setup:Installation Guide/System Preparation/Linux/Apache and PHP: Difference between pages

(Difference between pages)
No edit summary
Tag: 2017 source edit
 
No edit summary
 
Line 1: Line 1:
<bookshelf src="Book:User manual" />
{{DISPLAYTITLE:Installing  Apache and PHP on Linux}}
{{DISPLAYTITLE:Extended search}}
__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.


'''ExtendedSearch''' replaces the default MediaWiki search engine. It is based on the [[Setup:Installation Guide/System Preparation/Linux/Elasticsearch|Elasticsearch]] engine and provides many improvements over standard MediaWiki search both in terms of quality of indexed content and user interface. Pages and files are indexed immediately and available for searching in real-time.  
==Configuring PHP==
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>


==Usage==
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.
<div class="training"><section begin="training" />
Extended search offers two ways of searching for content:


#'''Title search''' using the quick search
<pre>
#'''Fulltext search''' using the search center
date.timezone = Europe/Berlin
max_execution_time = 600
post_max_size = 128M
upload_max_filesize = 128M
</pre>


By default, the search indexes:
Set the value for 'date.timezone' according to your own time zone.


*wiki pages: all content pages, except for pages in the MediaWiki namespace
Save and exit the php.ini again.
*special pages: all pages in the namespace ''Special''
==Configuring Apache==
*repo files: files uploaded to the wiki - for text files like Word documents and PDFs, this includes content and metadata
{{Messagebox|boxtype=note|icon=|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.
*external files: files from arbitrary locations from accessible storage paths (e.g., mounted drives)
<br>
*social entities: entities (pages) created by the [[Manual:Extension/BlueSpiceSocial|BlueSpiceSocial]] extension, like blog posts and user profiles
'''Multiple virtual hosts'''
<section end="training" /></div>
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 by adding the following to your Apache's http-specific configuration:  <code>Alias /w/ /path/to/w/</code>).  
==Autocomplete==
The search box in the main toolbar offers with autocomplete functionality is available from any page on the wiki. Autocomplete matches only page and file titles, but does not provide a full-text search.  


After typing in the search bar, an autocomplete popup appears:
|bgcolor=}}
[[File:Manual:Autocomplete.png|alt=|center|thumb|366x366px|Autocomplete popup]]


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


This popup is divided in two columns.
#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.


'''Left column:'''


*'''Primary results:''' These are the results that are direct matches for the search term. The exact matches are shown in bold letters.
*When looking for the term "quality management", it is also possible to type in "qual man" and the search starts looking for matches
*The best match is often shown with a thumbnail preview as a top search result


'''Right column:'''
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>.


*T'''ools and secondary results:''' Tools are displayed in the top portion of the right column and contain:
Next, activate the Module Rewrite, which we configured in the <code>bluespice.conf</code>, by entering the following command: <code>a2enmod rewrite</code>
**a button to create the page with the current search term as the title (only if user has permission to create new pages)
**a button to execute full-text search for the current term. Selecting this option leads to the Search Center.


In the bottom portion of the right column, secondary results are displayed. Secondary results are matches that do not directly match the given term, but might be relevant for the user. These show up only in certain contexts:
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>.


*If there are significantly more matches for a similar term than the term actually searched for (in a situation of a typo for example)
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.
*If the namespace or subpage pill is present (see next section). In this case, secondary results will show direct matches in other namespaces/pages.


===Namespace and subpage "pills"===
[[File:Setup:apache_not_found.png|frameless]]
Autocomplete search bar supports pills for namespaces and subpages. [[File:extendedsearch-pilleEN.png|thumb|Namespace "pill"|center|link=Special:FilePath/extendedsearch-pilleEN.png]]
If a user types <code>Manual:</code>, a pill for the namespace "Manual" appears and the search for the following term is limited to this namespace. .
Subpage pills work in the same way. If the user types in <code>PageName/</code>, any term after that is matched in the context of that page. If you search for "TestPage/Te", for example, the search will match only subpages of "TestPage" that contain "Te" in the title, like "TestPage/Test" and "TestPage/TestSubpage".


===Configuration===
==Next step==
Previously explained is the full version of the autocomplete popup. Wiki admins can also choose to use "Simple autocomplete", which contains only one column with primary results and tools, without secondary results. This type of autocomplete is also more compact.
If you have successfully completed all these steps, you can proceed to the next step "[[Setup: Installation Guide/System Preparation/Linux/MariaDB | MariaDB]]".
This setting is available from [[Manual:Extension/BlueSpiceConfigManager‏‎‏‎|BlueSpiceConfigManager]], under ''Extension > BlueSpiceExtendedSearch > Use simple autocomplete''.


===Dates as search terms===
[[en:{{FULLPAGENAME}}]]
The search recognizes certain date formats. In the search center, these date formats are treated with surrounding quotation marks.  <gallery widths="400" heights="200">
[[de:Setup:Installationsanleitung/Systemvorbereitung/Linux/Apache_und_PHP]]
File:Manual:extendedsearch-datum1.png
File:Manual:extendedsearch-datum2.png
</gallery><br />
==Search Center (extended search)==
As soon as you trigger the full-search with the magnifying glass symbol or the ''Enter'' key, the wiki switches to the Search Center. This is a special page that offers the full functionality of the search. The search in the Search Center is carried out using the same search bar that is also used for autocomplete.
Here, the search engine carries out a full text search, which also includes the metadata of documents. It does not index the wikitext of a wiki page, but rather the rendered content, that is the output by the browser.<br />
[[File:Manual:extendedsearch-searchcenter.png|link=link=Special:FilePath/ExtendedSearch2.png|alt=|center|thumb|402x402px|Search Center]]
 
===Search operators ===
{{Messagebox|boxtype=Important|icon=|Note text=Search operators only work in the search center (fulltext search). You cannot use search operators in the title search.|bgcolor=}}
Search operators have to be written in '''all-caps'''.
====AND====
*<code>admin AND docu</code>: Returns pages that contain the '''exact term''' <code>admin</code> '''as well as the exact term'''  <code>docu</code>
*<code>admin* AND docu</code>: If the term  <code>administration</code>  should be found, you need to provide a wildcard asterisk (<code>*</code>).
'''Compare''': The search <code>admin docu</code>  automatically is a wildcard search. It returns pages that contain '''both''' <code>admin*</code> '''and''' <code>docu*</code> . This search normally finds more results than the serach  <code>admin* AND docu</code> (because in the second case, the exact term <code>docu</code> is returned).
====<code>"</code> (apostrophes)====
Apostrophes around a search term triggers an <code>AND</code> search for '''all terms''' in the query:
*<code>"admin" docu</code>: same result as <code>admin AND docu</code> (i.e., also the precise term  <code>docu</code>  will be searched).
====NOT====
*<code>admin* NOT docu*</code>: Returns pages that contain words that start with  <code>admin</code> , but that don't contain words that start with <code>docu</code> .
====OR====
*<code>admin OR docu</code>: Returns pages that contain '''either the exact term''' <code>admin</code> '''or the exact term''' <code>docu</code>.
====<code>*</code> (wildcard)====
*<code>'''admin*'''</code>: Returns pages that contain words that begin with <code>admin</code> .
 
===Elements===
 
*'''Hit count''' - shows how many matches a search has returned. It may be exact or approximate. Approximation is due to dynamic check for permissions to view each page in the results, some results may not be shown to the user with no adequate permissions event if it matches the search term.
*'''Tools''' - these are located in the top right as a set of buttons:
**Create a page - represented by a "plus" button - will create a page with current search term as a title (only visible if user has permission to  create pages)
**Add filters - represented by a "funnel" icon - opens a dialog where users can select the type of filter to apply to the search.<br />[[File:Manual:extendedsearch3.png|link=link=https://en.wiki.bluespice.com/wiki/File:ExtendedSearch3.png|alt=|center|thumb|341x341px|Adding filters]]
**Search options - represented by a "gear" icon - opens a dialog where users can change settings for the current search. It provides options like the number of results per page, sorting field and order.<br />[[File:Manual:extendedsearch4.png|link=link=Special:FilePath/ExtendedSearch5.png|alt=|center|thumb|Options dialog]]
**Export search - represented by the "export" icon - opens a dialog to export current search results to a dedicated page (only visible to authorized users, by default admin users).
 
*'''Filter:''' Filters are displayed in form of pills below the results counter. Each filter pill represents a different attribute. Filter values can be changed by clicking on the filter pill and selecting the desired options from the popup that will open. Filter can be removed by clicking on  the "x" button in each pill.<br />[[File:Manual:extendedsearch2.png|link=link=Special:FilePath/ExtendedSearch4.png|alt=|center|thumb|Editing filter]]
*'''Results:''' If current search criteria field any results, a list of results is displayed. The information available in the results is depending on the result type):
**Main title of the result (page title, file name...)
**Result type
**Size and extension (for files)
**Thumb image (for images) or file type icon (for other file types)
**Redirect information
**Original name (for wikipages, if the page display title is different than the actual page title)
**Secondary information like page categories, modification and creation date, author, etc.
**Snippet of the matches in the content of the page (if there are matches in the page content),
**Sections with matches in the content (for wikipages)
 
In case there is an exact match for a given search term, the result that matches exactly is displayed as a "featured" result. Such a result displays a preview image of the page and always displays the content snippet, regardless of whether there are matches in the content or not.
====Results relevance====
All logged-in users can mark certain results as "favorites" by clicking on the star symbol in the right corner of each result.
Files marked as "favorite" will score higher in future searches - this is not visible immediately, however, but happens over time.
One user's relevance settings won't affect other user's searches. Results can be unmarked as "favorite" by clicking on the "star" symbol again.
 
====Exporting search results====
After executing the search, administrators can export (save) the results to a specific page using the "Export" command from the "Tools" menu. The list is exported to ''MediaWiki:PageCollection/LISTENNAME.''
 
Only valid wikipages are exported. The pages contained in a list can be included in a book in the book function via ''Mass add> Source: Page collection.''
[[File:Manual:ExtendedSearch5.png|link=link=Special:FilePath/ExtendedSearch6.png|alt=|center|thumb|Export search]]
 
==Configuration==
In the [[Manual:Extension/BlueSpiceConfigManager‏‎‏‎|BlueSpiceConfigManager]], under settings for the extension ''BlueSpiceExtendedSearch'', the following configuration options are available:<br />
 
{{#dpl:title=Manual:Extension/BlueSpiceConfigManager|include=#BlueSpiceExtendedSearch}}
 
==SearchAdmin==
''Special:SearchAdmin'' is a special page for wiki admins. This page provides stats on documents indexed in the search.{{Box Links-en|Topic1=[[Reference:BlueSpiceExtendedSearch]]}}
 
{{Translation}}
__FORCETOC__
 
[[Category:Search]]

Revision as of 15:14, 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 by adding the following to your Apache's http-specific configuration: 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