Tested on Ubuntu 8.10 Intrepid Ibex
Notation: text you need to enter in the specified file
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install openssh-server
$ sudo gedit /etc/ssh/sshd_config
change "Port 22" to "Port 1022"
$ sudo /etc/init.d/ssh restart
$ sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server
120 MB disk space used, 40MB download
you will be prompted for the MySQL root user password
verify you have a working webserver by opening
$ firefox http://localhost/ &
$ sudo vi /etc/apache2/conf.d/fqdn
add the line
ServerName localhost
$ sudo /etc/init.d/apache2 restart
Now the server should be accessible by IP address from other boxes
Lock the box down: https://help.ubuntu.com/community/BastilleLinux
$ sudo apt-get install bastille perl-tk
16 MB of diskspace, 4MB of download.
Configure:sudo
accept
title screen: OK
file permissions:
more restrictive permissions: NO
disable SUID mount: NO
disable SUID ping: NO
disable SUID at: NO
account security:
disable clear-text: YES
enforce password aging: NO
restrict cron: YES
set default umask: NO
disallow root login: YES
boot security:
password protect GRUB: NO
disable CTRL-ALT-DEL reboot: NO
password protect single-user mode: NO
secure inetd:
default deny TCP wrappers: NO
disallow telnet: YES
disallow FTP: YES
display "auth use": NO
disable user toos:
disable gcc: NO
Configure Misc PAM:
limit resource usage: YES (settings in /etc/security/limits.conf)
restrict console access: NO
logging:
additional logging: YES
remote logging host: NO
misc daemons:
disable printing: NO
install TMP scripts: YES
packet filtering: NO
End screen
finished: YES
"save configuration"
"apply configuration to system"
credits: "close"
https://help.ubuntu.com/community/MediaWiki
$ sudo apt-get install mediawiki imagemagick mediawiki-math
660MB disk space, 343MB download
$ sudo vi /etc/apache2/conf.d/mediawiki.conf
uncomment third line # in front of alias
$ sudo /etc/init.d/apache2 restart
check out http://localhost/mediawiki/
$ firefox http://localhost/mediawiki/config/index.php &
wikiname =
contact email =
WikiSysop password =
confirm WikiSysop password =
user-to-user email = disabled
email notification about changes = disabled
database name = wikidb
db username = wikiuser
db password =
superuser account = yes
superuser name = root
superuser password = <password used in setting up the MySQL db>
install mediawiki!
$ sudo mv /var/lib/mediawiki/config/LocalSettings.php /etc/mediawiki/LocalSettings.php
then go to http://localhost/mediawiki/index.php
login http://localhost/mediawiki/index.php?title=Special:Userlogin
edited it in GIMP down to 135x120
$ sudo cp new_logo_small.png /var/lib/mediawiki/skins/common/images/wiki.png
to have the wiki send email,
$ sudo apt-get install sendmail
6MB disk space, 2MB download
$ sudo gedit /etc/mediawiki/LocalSettings.php
$wgEnableUploads = true;
$wgFileExtensions = array('png','jpg','jpeg','ogg','doc','xls','ppt','pdf');
# see http://www.mediawiki.org/wiki/Manual:Preventing_access#Restrict_viewing_of_all_pages
# Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['sysop']['createaccount'] = true;
# Disable reading by anonymous users
$wgGroupPermissions['*']['read'] = false;
# But allow them to read e.g., these pages:
$wgWhitelistRead = array ( "Main Page", "Special:Userlogin", "Help:Contents");
Note: to do a wget download, one needs to comment out the previous two commands
$ sudo chmod 600 /etc/mediawiki/LocalSettings.php
$ sudo rm -Rf /var/lib/mediawiki/config
http://www.virtualbox.org/manual/UserManual.html#natforward
mysqldump -u root -p$PASSWORD wikidb > wikidb_dump_`date +20%y%m%d`.sql
Your computer starts on fire and it's time to restore from an SQL dump.
New computer, reinstall mediawiki. Proceed until a fresh wiki is set up.
I was not able to use
$ mysqdump -u root -p wikidb < wikidbdump.sql
I used navicat to restore the wikidb, using "execute batch file" (right click on the connected wikidb)
$ sudo cp /usr/share/doc/mediawiki/examples/Adminsettings.sample /etc/mediawiki/AdminSettings.php
change the DB username to root, with the appropriate password
$ sudo gedit /etc/mediawiki/AdminSettings.php
$ sudo php /var/lib/mediawiki/maintenance/update.php
THESE NOTES ARE NOT FOR PUBLIC CONSUMPTION!!
relavent directories are
/var/lib/mediawiki
/usr/share/mediawiki
/etc/mediawiki
/usr/share/mediawiki/math
http://zarjay.net/2008/03/07/how-to-get-math-support-in-mediawiki/
http://kb.siteground.com/article/How_to_enable_Math_support_in_my_MediaWiki_application.html
texvc binary:
http://www.4shared.com/file/189530321/d5f9ed1b/texvc.html
$ sudo apt-get install ocaml mediawiki-math
$ which gs
/usr/bin/gs
$ which convert
/usr/bin/convert
$ which latex
/usr/bin/latex
$ which dvips
/usr/bin/dvips
$ locate Math.php
/usr/share/mediawiki/includes/Math.php
$ ls -hal /usr/share/mediawiki/includes/
$ sudo gedit /usr/share/mediawiki/includes/Math.php
Replaced
public static function renderMath( $tex, $params=array() ) {
global $wgUser;
$math = new MathRenderer( $tex, $params );
$math->setOutputMode( $wgUser->getOption('math'));
return $math->render();
}
with
public static function renderMath( $tex, $params=array() ) {
return '<img src="http://131.151.77.11/mimetex.cgi?' . $tex . '" alt="" />';
}
$ sudo gedit LocalSettings.php
changed
$wgUseTeX = false;
to
$wgUseTeX = true;
$ cd /var/lib/mediawiki/
$ sudo su
# cd images/
# mkdir math
# mkdir tmp
# chown www-data math
# chown www-data tmp
# chgrp www-data tmp
# chgrp www-data math
$ sudo mkdir math
$ sudo chown www-data math
$ sudo chgrp www-data math
$ sudo cp /home/ben/texvc .
$ sudo chown www-data texvc
$ sudo chgrp www-data texvc
$ sudo chmod 777 texvc
To add a user, log in as WikiSysop
go to http://localhost/mediawiki/index.php?title=Special:Userlogin&type=signup