Setup:Installation Guide/System Preparation/Linux/Apache and PHP and Recent changes transclusion: Difference between pages

(Difference between pages)
No edit summary
 
(Changed categories.)
 
Line 1: Line 1:
{{DISPLAYTITLE:Installing  Apache and PHP on Linux}}
It is possible to include the results of the "Recent changes" special page in a wiki page.
__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>
==Configuring PHP==
After installation, configure PHP. Open <code>php.ini</code> with a text editor of your choice (nano, vi), which, in our  Debian version, is located in the directory <code>/etc/php/7.3/apache2</code>.


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. Or open the terminal with <code>sudo nano /etc/php/7.4/apache2/php.ini</code>.
== Adding the changelist to a page ==
To show the Recent changes list on any page in the wiki, you can simply transclude it by adding the following to your page source:<syntaxhighlight lang="text">
{{Special:RecentChanges}}
</syntaxhighlight>This will simply output the same content as is shown on the page ''Special:RecentChanges''.
[[File:Include Recent changes.png|alt=Recent changes included in a wiki page|center|thumb|650x650px|Recent changes included in a wiki page]]


<pre>
== Limiting the displayed information ==
date.timezone = Europe/Berlin
Sometimes, you might want to limit the information that is shown for recent changes.
max_execution_time = 600
[[File:recent changes filtered include.png|link=https://en.wiki.bluespice.com/wiki/File:recent%20changes%20filtered%20include.png|alt=Recent changes filtered view|center|thumb|500x500px|Recent changes filtered view]]
post_max_size = 128M
upload_max_filesize = 128M
</pre>


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


Save and exit the php.ini again.
To do this, you need to make two changes:
==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.}}


To configure a VirtualHost for BlueSpice, please proceed as follows:
# '''Add a wrapper and filter paramters:''' Apply a wrapper around your transclusion  for formatting purposes and add some filter parameters to limit the results in the list.
# '''Format the output:''' Remove the unnecessary information through some style adjustment in the page MediaWiki:Common.css (admin rights required)


#Change to the directory <code>/etc/apache2/sites-available </code>.
=== Add a wrapper and filter parameters ===
#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:
You can set some parameters in the tag to filter some information. The following example shows up to the latest 100 changes in the last 7 days in the main namespace (Pages):<syntaxhighlight lang="text">
##For BlueSpice free: [[Media:Setup:apache vhost bluespice free.txt|apache_vhost_bluespice_free.txt]]
<div class="rcinclude">{{Special:RecentChanges|limit=100|days=7|namespace=0}}</div>
##For BlueSpice pro: [[Media:Setup:apache vhost bluespice pro.txt|apache_vhost_bluespice_pro.txt]]
</syntaxhighlight>To show changes in additional namespaces, add them to the namepace parameter, separated by a semi-colon:<syntaxhighlight lang="text">
#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.
<div class="rcinclude">{{Special:RecentChanges|limit=100|days=7|namespace=0;3010}}</div>
#Save the file and close it.
</syntaxhighlight>


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>.
=== Format the output ===
After adding the <nowiki><div class="rinclude">...</div></nowiki> wrapper around your transclusion content, you can now use this rinclude class to style the output and to hide some unnecessary information. This class is important, because it ensures that  other pages in the wiki, such as the actual "Recent changes" special page or  the version history pages in your wiki are not affected by these changes.


Next, activate the Module Rewrite, which we configured in the <code>bluespice.conf</code>, by entering the following command: <code>a2enmod rewrite</code>
To filter out additional detail information — such as change in file size, markers, or direct links to the version comparison —, add the following to the page ''MediaWiki:Common.css'' (admin rights required):<syntaxhighlight lang="text">
/** custom formatting for recent changes that are included on a wiki page with a div-wrapper of css-class .rcinclude **/


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>.
/* first style declaration hides all unnecessary info such as bytes, direct links to differences, links related to user, and markers */
.rcinclude .mw-changeslist-line-inner-userTalkLink,
.rcinclude .mw-diff-bytes,
.rcinclude .mw-tag-markers,
.rcinclude .mw-changeslist-legend,
.rcinclude .mw-changeslist-line-inner-rollback,
.rcinclude .mw-changeslist-links,
.rcinclude .mw-changeslist-separator,
.rcinclude.mw-rollback-link,
.rcinclude .mw-rollback-link {display:none}


Next, call up the URL of your BlueSpice server. If configured correctly, Apache should respond to the request with the error message "Not found", which is completely correct at the time of installation.
/* remove the "New" indicator from the time in front of each entry - they can only be removed together */
.rcinclude td.mw-enhanced-rc {display:none}


[[File:Setup:apache_not_found.png|frameless]]
/* increase spacing between entries */
.rcinclude .mw-changeslist-line {margin-bottom:0.6em}


==Next step==
/* separate page title and user name */
If you have successfully completed all these steps, you can proceed to the next step "[[Setup: Installation Guide/System Preparation/Linux/MariaDB | MariaDB]]".
.rcinclude .mw-title::after {content:" -"}


/* make the day heading more compact */
.rcinclude .mw-changeslist h4 {font-size:0.95em; margin:1em 0 0.5em 0} 
/* remove unnecessary space in the expanded version rows */
.rcinclude tr.mw-rcfilters-ui-highlights-enhanced-nested td:nth-child(3){display:none} 
/** end recent changes formatting  **/
</syntaxhighlight>After saving these changes in MediaWiki:Common.css, you should now see the modified output of the transcluded content as shown in the previous screenshot.
If you still see the original formatting, you will need to clear the network cache:
# '''Right-click''' on the wiki page that contains the "Recent changes" transclusion.
# '''Click''' ''Inspect''.
# Activate Disable cache
# '''Press''' ''F5'' on your keyboard to refresh the page.
[[File:disable caching.png|alt=disable network cache|center|thumb|650x650px|disable network cache]]
[[en:{{FULLPAGENAME}}]]
[[en:{{FULLPAGENAME}}]]
[[de:Setup:Installationsanleitung/Systemvorbereitung/Linux/Apache_und_PHP]]
[[de:Letzte Änderungen Transklusion]]
[[Category:Organiz]]
[[Category:Organization]]
[[Category:Portal]]

Revision as of 09:43, 6 May 2022

It is possible to include the results of the "Recent changes" special page in a wiki page.

Adding the changelist to a page

To show the Recent changes list on any page in the wiki, you can simply transclude it by adding the following to your page source:

{{Special:RecentChanges}}

This will simply output the same content as is shown on the page Special:RecentChanges.

Recent changes included in a wiki page
Recent changes included in a wiki page

Limiting the displayed information

Sometimes, you might want to limit the information that is shown for recent changes.

Recent changes filtered view
Recent changes filtered view


To do this, you need to make two changes:

  1. Add a wrapper and filter paramters: Apply a wrapper around your transclusion for formatting purposes and add some filter parameters to limit the results in the list.
  2. Format the output: Remove the unnecessary information through some style adjustment in the page MediaWiki:Common.css (admin rights required)

Add a wrapper and filter parameters

You can set some parameters in the tag to filter some information. The following example shows up to the latest 100 changes in the last 7 days in the main namespace (Pages):

<div class="rcinclude">{{Special:RecentChanges|limit=100|days=7|namespace=0}}</div>

To show changes in additional namespaces, add them to the namepace parameter, separated by a semi-colon:

<div class="rcinclude">{{Special:RecentChanges|limit=100|days=7|namespace=0;3010}}</div>

Format the output

After adding the <div class="rinclude">...</div> wrapper around your transclusion content, you can now use this rinclude class to style the output and to hide some unnecessary information. This class is important, because it ensures that other pages in the wiki, such as the actual "Recent changes" special page or the version history pages in your wiki are not affected by these changes.

To filter out additional detail information — such as change in file size, markers, or direct links to the version comparison —, add the following to the page MediaWiki:Common.css (admin rights required):

/** custom formatting for recent changes that are included on a wiki page with a div-wrapper of css-class .rcinclude **/

/* first style declaration hides all unnecessary info such as bytes, direct links to differences, links related to user, and markers */
.rcinclude .mw-changeslist-line-inner-userTalkLink,
.rcinclude .mw-diff-bytes, 
.rcinclude .mw-tag-markers,
.rcinclude .mw-changeslist-legend,
.rcinclude .mw-changeslist-line-inner-rollback,
.rcinclude .mw-changeslist-links,
.rcinclude .mw-changeslist-separator,
.rcinclude.mw-rollback-link, 
.rcinclude .mw-rollback-link {display:none}

/* remove the "New" indicator from the time in front of each entry - they can only be removed together */
.rcinclude td.mw-enhanced-rc {display:none} 

/* increase spacing between entries */
.rcinclude .mw-changeslist-line {margin-bottom:0.6em} 

/* separate page title and user name */
.rcinclude .mw-title::after {content:" -"} 

/* make the day heading more compact */
.rcinclude .mw-changeslist h4 {font-size:0.95em; margin:1em 0 0.5em 0}  

/* remove unnecessary space in the expanded version rows */
.rcinclude tr.mw-rcfilters-ui-highlights-enhanced-nested td:nth-child(3){display:none}   

/** end recent changes formatting  **/

After saving these changes in MediaWiki:Common.css, you should now see the modified output of the transcluded content as shown in the previous screenshot.

If you still see the original formatting, you will need to clear the network cache:

  1. Right-click on the wiki page that contains the "Recent changes" transclusion.
  2. Click Inspect.
  3. Activate Disable cache
  4. Press F5 on your keyboard to refresh the page.
disable network cache
disable network cache



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

Discussions