See also: MonkeyWiki
Because of how Monkey Wiki formats things, please look at the source code for this page (edit the page) to see all the values / configuration information. There is no way to “escape” the data so it renders correctly.
chkconfig --list chkconfig httpd on
vi /etc/httpd/conf.d/wiki.conf
<VirtualHost *:80>
ServerName wiki.kb0odu.pvt
DocumentRoot /var/www/wiki/script/
<Directory /var/www/wiki/script/>
Options +Indexes +MultiViews +FollowSymLinks +Includes +ExecCGI
Order allow,deny
Allow from all
AllowOverride All
</Directory>
ErrorLog /var/log/wiki/wiki-error.log
CustomLog /var/log/wiki/wiki-custom.log "%h %l %u %t \"%r\" %>s %b"
</VirtualHost>
mkdir -p /var/www/wiki/script mkdir /var/log/wiki service httpd restart
test simple .html in browser : http://wiki.kb0odu.pvt/ OK, testing page displays
Options -Indexes +ExecCGI +FollowSymLinks
AddHandler cgi-script .py
DirectoryIndex index.py
<Files ~ "^.htaccess$">
Order allow,deny
Deny from all
</Files>
test simple .py in browser : http://wiki.kb0odu.pvt/ OK, testing page displays
cd /var/www/wiki/script wget http://www.waywood.co.uk/cgi-bin/monkeywiki.py chmod 705 monkeywiki.py
Following values are being used:
#==CONFIGURATION SECTION======================================================= PATH_TO_WIKI_TEXT = '/home/wiki/' PATH_TO_TEMPLATES = '/home/wiki/template/files/' FRONT_PAGE = 'FrontPage' #required, must be WikiName. (= name of 'top' or 'home' page) NOFOLLOW_OUTLINKS = 1 NUMBERED_OUTLINKS = 0 REWRITE_MODE = 1 REWRITE_BASE_URL = ' ' EDITABLE = 1 BACKUP_ON = 0 #use the backup feature? (backups are done by email) SMTP_SERVER = 'localhost' WIKI_LOGGER = ' ' #email address from which backups are sent WIKI_MASTER = ' ' #email address to which backups are sent CREDIT = 'Site powered by <a href="http://www.waywood.co.uk/MonkeyWikiInstallation/">MonkeyWikiInstallation</a>' #==============================================================================
adding in following lines in .htaccess
(for REWRITEMODE 1, it is not necessary, but nice to have if don't like it, we can set REWRITEMODE 0, and remove the follwing lines from .htaccess)
RewriteEngine on
RewriteRule ^/?$ /monkeywiki.py
RewriteRule ^(.+)\.html$ /monkeywiki.py?page=$1 [QSA]
ExpiresActive on
ExpiresByType text/html "modified"
mkdir /home/wiki
Create a simple page:
# cat /home/wiki/FrontPage
This is a test...
And go to: http://wiki.kb0odu.pvt/FrontPage.html
wiki works, URL rewrite works also
mkdir /home/dba/wikiusers cd /home/dba/wikiusers htpasswd -c ./dbas dba == to change password, run this command again
vi /var/www/wiki/script/.htaccess AuthUserFile /home/dba/wikiusers/dbas AuthName "This is a protected area" AuthGroupFile /dev/null AuthType Basic Require valid-user
chmod 701 /home/wiki/wikiusers drwx-----x 2 root root 4096 Jun 25 19:00 wikiusers
[root@db-mgmt01 script]# cat .htaccess
AuthUserFile /home/wikiusers/users
AuthName "This is a protected area"
AuthGroupFile /dev/null
AuthType Basic
Require valid-user
RewriteEngine on
RewriteRule ^/?$ /monkeywiki.py
RewriteRule ^(.+)\.html$ /monkeywiki.py?page=$1 [QSA]
ExpiresActive on
ExpiresByType text/html "modified"
Options -Indexes +ExecCGI +FollowSymLinks
AddHandler cgi-script .py
DirectoryIndex index.py
<Files ~ "^.htaccess$">
Order allow,deny
Deny from all
</Files>
[root@db-mgmt01 www]# ls -l total 20 drwxr-xr-x 2 root root 4096 Oct 16 2014 cgi-bin drwxr-xr-x 3 root root 4096 Jun 25 16:19 error drwxr-xr-x 2 root root 4096 Oct 16 2014 html drwxr-xr-x 3 root root 4096 Jun 25 16:19 icons drwxr-xr-x 3 root root 4096 Jun 25 16:47 wiki
[root@db-mgmt01 dba]# ls -l /home/
total 24
...cut unrelated directories here...
drwx---rwx 2 root root 4096 Jun 25 18:40 wiki
drwx-----x 2 root root 4096 Jun 25 19:00 wikiusers