Install the Media Wiki Release: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 8: Line 8:
wget https://releases.wikimedia.org/mediawiki/1.35/mediawiki-1.35.0.tar.gz
wget https://releases.wikimedia.org/mediawiki/1.35/mediawiki-1.35.0.tar.gz
</syntaxhighlight>
</syntaxhighlight>
As <code>root</code>
As <code>root</code>:
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
su -
su -
cd /var/www
cd /var/www
gunzip < /tmp/mediawiki-1.35.0.tar.gz | tar xfv -
gunzip < /tmp/mediawiki-1.35.0.tar.gz | tar xfv -
rm /tmp/mediawiki-1.35.0.tar.gz
</syntaxhighlight>
</syntaxhighlight>
Set the correct ownership:
Set the correct ownership:
Line 18: Line 19:
cd /var/www
cd /var/www
chown -R apache:apache mediawiki-1.35.0
chown -R apache:apache mediawiki-1.35.0
</syntaxhighlight>
Link the newly created Media Wiki directory under a name representative to the web server external DNS name:
<syntaxhighlight lang='bash'>
cd /var/www
ln -s ./mediawiki-1.35.0 wiki.novaordis.com
chown apache:apache ./wiki.novaordis.com
</syntaxhighlight>
==SELinux Configuration==
{{External|https://www.mediawiki.org/wiki/SELinux}}
Find out if SELinux is enabled:
{{Internal|SELinux_Operations#How_to_Find_Out_Whether_SELinux_is_Enabled|How to find out whether SELinux is enabled}}
If yes, read the reference above and do what it says, things change from time to time.
This is what worked last time. As <code>root</code>:
<syntaxhighlight lang='bash'>
restorecon -FR /var/www/mediawiki-1.35.0/
</syntaxhighlight>
Check the result:
<syntaxhighlight lang='bash'>
ls -lZ /var/www/
</syntaxhighlight>
The MediaWiki directories should have the "system_u:object_r:httpd_sys_content_t:s0" context:
<syntaxhighlight lang='text'>
drwxr-xr-x. apache apache system_u:object_r:httpd_sys_content_t:s0 mediawiki-1.26.2
lrwxrwxrwx. root  root  system_u:object_r:httpd_sys_content_t:s0 wiki.novaordis.com -> mediawiki-1.26.2
</syntaxhighlight>
<syntaxhighlight lang='bash'>
chcon -t httpd_sys_script_exec_t includes/GlobalFunctions.php
</syntaxhighlight>
===Allow image upload===
<syntaxhighlight lang='bash'>
cd /var/www/mediawiki-1.35.0
chcon -R -t httpd_user_rw_content_t ./images
</syntaxhighlight>
</syntaxhighlight>


=Mac=
=Mac=
As the regular, non-<code>root</code> user that performed the <code>httpd</code> installation:
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
cd /tmp
cd /tmp
wget https://releases.wikimedia.org/mediawiki/1.39/mediawiki-1.39.6.tar.gz
wget https://releases.wikimedia.org/mediawiki/1.39/mediawiki-1.39.6.tar.gz
cd /opt/brew/var/www
tar xfvz /tmp/mediawiki-1.39.6.tar.gz
rm /tmp/mediawiki-1.39.6.tar.gz
</syntaxhighlight>
Link the newly created Media Wiki directory under a name representative to the local web server name:
<syntaxhighlight lang='bash'>
cd /opt/brew/var/www
ln -s ./mediawiki-1.39.6 nokb.local
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 00:12, 30 December 2023

Internal

Overview

Go to https://releases.wikimedia.org/mediawiki/ and download the latest patch corresponding to the selected LTS release.

Linux

cd /tmp
wget https://releases.wikimedia.org/mediawiki/1.35/mediawiki-1.35.0.tar.gz

As root:

su -
cd /var/www
gunzip < /tmp/mediawiki-1.35.0.tar.gz | tar xfv -
rm /tmp/mediawiki-1.35.0.tar.gz

Set the correct ownership:

cd /var/www
chown -R apache:apache mediawiki-1.35.0

Link the newly created Media Wiki directory under a name representative to the web server external DNS name:

cd /var/www
ln -s ./mediawiki-1.35.0 wiki.novaordis.com
chown apache:apache ./wiki.novaordis.com

SELinux Configuration

https://www.mediawiki.org/wiki/SELinux

Find out if SELinux is enabled:

How to find out whether SELinux is enabled

If yes, read the reference above and do what it says, things change from time to time.

This is what worked last time. As root:

restorecon -FR /var/www/mediawiki-1.35.0/

Check the result:

ls -lZ /var/www/

The MediaWiki directories should have the "system_u:object_r:httpd_sys_content_t:s0" context:

drwxr-xr-x. apache apache system_u:object_r:httpd_sys_content_t:s0 mediawiki-1.26.2
lrwxrwxrwx. root   root   system_u:object_r:httpd_sys_content_t:s0 wiki.novaordis.com -> mediawiki-1.26.2
chcon -t httpd_sys_script_exec_t includes/GlobalFunctions.php

Allow image upload

cd /var/www/mediawiki-1.35.0
chcon -R -t httpd_user_rw_content_t ./images

Mac

As the regular, non-root user that performed the httpd installation:

cd /tmp
wget https://releases.wikimedia.org/mediawiki/1.39/mediawiki-1.39.6.tar.gz
cd /opt/brew/var/www
tar xfvz /tmp/mediawiki-1.39.6.tar.gz
rm /tmp/mediawiki-1.39.6.tar.gz

Link the newly created Media Wiki directory under a name representative to the local web server name:

cd /opt/brew/var/www
ln -s ./mediawiki-1.39.6 nokb.local