Hi there,
I just like to give my two cents because I am creating a new nethserver install (NS 7.6). I moved my old mediawiki software from Zentyal (Ubuntu) to nethserver. I am using the standard vhosts directory. What I did and worked:
yum install php-xml php-intl php-gd ImageMagick
ImageMagick is necessary if you like to use thumbnail creation.
Go to the Mediawiki homepage and download the stable package. You can do this by eather download the tar.gz to your PC and then upload it to you server (ftp, winscp, scp, rsync) or copy the link address of the file (right mouse click and copy the link).
If you copied to file the clipboard, you than can change to the installation directory into the root of your vhost directory (in vhost/domainX/., not vhost/domainX/mediawikiXXX/.) and download the file:
cd /var/lib/netzserver/vhost/domainX
wget -c https://releases.wikimedia.org/mediawiki/VERSION/mediawiki-VERSION.tar.gz
Then do:
tar xzvf mediawiki-VERSION.tar.gz
mv mediawiki-VERSION mediawi
Do yourself a favor because of future updates and do not use âmediawiki-VERSIONâ as folder name - versions change. If you know how, you can use symlinks (but this will require a configuration vhosts change).
Create a database, dbuser as usual. Youâll need the mysql root password which you will find per default in /root/.my.cnf
. Please donât use âpasswordâ in the next section, but change it to a real one
mysql -u root -p
# you will be prompted silently !!! for the root pass of mysql server
CREATE DATABASE mediawikidb;
CREATE USER 'mediawikidbuser'@'localhost' IDENTIFIED BY 'myFancyMediawikidbuserPassword';
GRANT ALL PRIVILEGES ON mediawikidb.* TO 'mediawikidbuser'@'localhost' WITH GRANT OPTION;
Configure your LocalSettings.php of MediaWiki.
There are many HowToâs out there and on the main page of Mediawiki how to install it manually. This is not and cannot be part of this HowTo.
I am not using FTP. But you could use it. Because of that we change the user of the directory form ftp:apache to apache:apache. The sticky bit gives a little bit more security (we could only set it for directories, but it does not harm to set it globally).
cd /var/lib/nethserver/vhost
chown -R apache:apache domainX
chmod -R +s domainX
cd domainX
Harden the directory access by removing rights to others (might break the usage of ftp?!):
find . -type f -exec chmod 2640 {} \;
find . -type d -exec chmod 2750 {} \;
For the virtualhost.conf I created a new key for vhosts called DirectoryMediawiki which creates the necessary entries.
vim /etc/e-smith/templates-custom/httpd/vhost-extra/55DirectoryMediawiki
{
use esmith::ConfigDB;
my $vdb = esmith::ConfigDB->open_ro('vhosts') || die("Can't open vhosts db");
my $DirectoryMediawiki = $vdb->get_prop("$VhostName",'DirectoryMediawiki') || 'disabled';
$OUT = '';
$DOCROOT = "{{$DocumentRoot}}";
$DOCROOT =~ tr/\{//d;
$DOCROOT =~ tr/\}//d;
$MYHOST = "{{$ServerName}}";
$MYHOST =~ tr/\{//d;
$MYHOST =~ tr/\}//d;
if ($DirectoryMediawiki eq 'enabled') {
$OUT .= <<MWINSTALL;
# 55DirectoryMediawiki
<Directory $DOCROOT>
Options ExecCGI FollowSymLinks
DirectoryIndex index.php
AllowOverride All
Require all granted
DefaultType application/x-httpd-php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\$ /index.php?title=\$1 [L,QSA]
RewriteCond %{HTTP_HOST} ^www.${MYHOST}\$ [NC]
RewriteRule ^(.*) http://${MYHOST}\$1 [L,R\=301]
</Directory>
MWINSTALL
} else {
$OUT = '';
}
}
Activate it with
db vhosts setprop domainX DirectoryMediawiki enabled
Check with db vhosts show `domainX. Then reconfigure the files for testing:
expand-template /etc/httpd/conf.d/virtualhosts.conf
service httpd restart
For normal activation use:
signal-event nethserver-httpd-update
My wiki is here: https://wiki.blue-it.org.
Cheers Axel