InstaWiki
Questions answered by this recipe
How can I install PmWiki in seconds using a shell script?
Description
Install PmWiki in seconds using a shell script.
This script
- Installs PmWiki
- Creates writable wiki.d/ and uploads/ directories.
At that point the wiki is ready to use. The config.php file is a modified version of sample-config.php with URLs shortened and uploads enabled.
The script downloads PmWiki (if it's not already downloaded), unpacks the archive, renames the directory, then downloads InstaWiki-latest.tar.gzΔ and installs index.php and local/config.php.
Then the script sets 2777 permissions, retrieves the home page (without saving it), and sets 0777 permissions.
The wiki, once installed, is a default configuration with an index.php file and The configuration changes are:
- Automatic semi-clean URLs (with pmwiki.php removed)
- Uploads are enabled by default.
- Max upload size is set to 1MB.
- A server-writable uploads/ directory is created automatically.
Installation
Save this as a shell script or download the .txt versionΔ from the command line withwget http://www.pmwiki.org/pmwiki/uploads/Cookbook/InstaWiki.txt
#!/bin/bash dir="wiki" # name of the wiki's directory that will be created ver="2.2.91" # pmwiki version - see http://www.pmwiki.org/wiki/PmWiki/Download url="http://localhost/" # url for the directory where this script is if [ -e $dir ] ; then echo "$dir exists"; exit fi if [ ! -f pmwiki-$ver.tgz ] ; then wget http://www.pmwiki.org/pub/pmwiki/pmwiki-$ver.tgz fi tar -zxvf pmwiki-$ver.tgz mv pmwiki-$ver $dir cd $dir/local/ wget http://www.pmwiki.org/pmwiki/uploads/Cookbook/InstaWiki-latest.tar.gz tar -zxvf InstaWiki-latest.tar.gz -C ../ chmod 2777 ../ # ../ is the wiki's main/ directory wget -O- $url$dir/ >/dev/null # retrieve the page chmod 0775 ../ chmod g-s ../
Configuration
Set the directory name, PmWiki version, and URL.
Usage
- Download the scriptΔ and rename it to InstaWiki.sh or copy-n-paste the script text into a script.
- Make sure it's in a directory that matches a URL (see below).
- Set the settings.
- directory name
- version of PmWiki
- URL that points to the directory where the script is run from, ending in a
/
because it's a directory.
- Run the script. (
bash ./InstaWiki.sh
)
Notes
To disable uploads after the wiki is installed,
- comment out the line that starts with
$HandleAuth['upload']
. - delete the uploads/ directory.
Change log / Release notes
2016-09-30 - Initial release
See also
Contributors
Comments
See discussion at InstaWiki-Talk?
User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.