[Home]UseModWiki/Install

UseModWiki | UseModWiki | RecentChanges | Preferences

Something you must check out ...

See the INSTALL document in the wiki distribution for the most current installation instructions. See the UPGRADE document for instructions to upgrade an existing wiki. https://www.usemod.org/cgi-bin/wiki.pl?UseModWiki/Upgrade

by argo journey to make and the with every


New Installations

1. Copy the file "wiki.pl" to your cgi-bin directory. You can rename the file to another name if you like. (Some servers may require the name to end in ".pl", some ".cgi".) [TODO: extend and generalize the following instructions] To configure CGI for a single directory in Apache create a world-readable file ".htaccess" containing the line "SetHandler cgi-script".

Where to put it?

2. For some servers, you may need to change the permissions on the wiki.pl script. (The command "chmod 755 wiki.pl" should be correct.)

3. Create the wiki database directory (see 5 below). This directory must be writable by the wiki CGI script. (You may need to use another chmod command.) If the directory does not exist, the script will attempt to create it.

4. If your installation of Perl is not located in /usr/bin/perl, you will need to change the "/usr/bin/perl" text in the first line of wiki.pl. (This is usually unnecessary.)

5. Edit the "wiki.pl" file. The configuration section starts around line 58. The main configuration variable is:

   $DataDir     = "/tmp/mywikidb";     # Main page database

... The wiki database directory. The default directory is in /tmp, which is not a good location for a long-term wiki. (Many systems will erase the contents of /tmp when they crash or reboot.) Change this directory to the one you created in step 3.

Maybe $DataDir = "D:\\CUSTOM\\root\\PC3\\var\\bin\\usemodwiki"; would work as well, because in a Perl string backslashes usually escape the following character. (In double quoted strings, i.e. "" and qq. In single quoted strings, this does not happen except for the single quote itself.)

6. Starting with version 0.90 of UseModWiki, you can edit most of the configuration variables outside the script. (You still need to edit the script to set the $DataDir variable.) To do this, copy the "config" file to your wiki's $DataDir directory and edit it.

The advantage of editing the config file (rather than the script) is that upgrades to future versions are much easier--you only need to make the changes above rather than re-edit all of your local configuration.

You will probably want to change the following configuration values:

   $CookieName  = "Wiki";       # Name for this wiki (for multi-wiki sites)

... If your site uses multiple copies of UseModWiki, you must make sure that each copy has a unique $CookieName. Cookies are normally distinquished by the domain name of the server they came from, but that doesn't work if you host multiple wikis. The cookies store user-specific settings and preferences.

   $SiteName    = "Wiki";       # Name of site (used for titles)

... This name is used in the title of every page.

   $HomePage    = "HomePage";   # Home page (must be valid LinkPattern)

... This is the name of the wiki page users will go to when:

   $LogoUrl     = "/wiki.gif";  # URL for site logo ("" for no logo)

... This is the URL for the logo image. If it is "", the logo will not be displayed.

7. If you wish to use the provided wiki.gif image, copy it to the top directory of your www pages. (Or see step 6 to change the LogoUrl variable.)

8. (Optional) To use the supplied InterWiki site definitions, copy the file "intermap" into the database directory (from step 3).

9. Start your web browser, and go to the URL of the wiki.pl script. You should be able to edit and add new pages.

this is an apache problem. Either you havent configured the server to run .pl files as perl scripts (AddHandler .cgi .pl) or the directory where wiki.pl isnt configured to run scripts

 <Directory /pathtoscript> 
 Options +ExecCGI
 </Directory>

HTH --Paul Cooper

[The "INSTALL" and "README" documents in the UseModWiki 1.0 distribution also contain some troubleshooting instructions and warnings about the email and HTML features.]


If, like me, you have a server that will only let you run php, but the server is not running php in "safe mode", you may be able to WrapCgiWithPhp -- [BayleShanks]

Directory and permission issues

How do you create the wiki database directory? Where do you put it? Be specific! When I try to change mine to anything but /tmp/mywikidb I get an error message. -Matt Apple

I had the same problem, and couldn't find an answer anywhere! But I finally figured it out: I was using a commercial web hosting service that created a virtual directory structure for their users. This meant that all of the directories above my home directory were invisible, so I didn't know that what I was calling "cgi-bin/wikidb" was actually "/mnt/web_a/d31/s43/a203frw1/cgi-bin/wikidb". When I changed the $DataDir to the later, it worked. If you can't telnet into your server (like I couldn't), just load the following CGI script into your cgi-bin, it will show you the true name of your cgi-bin directory:

The above path issue is common with people using virtual server web hosting. For example, what you see as /var/www/cgi-bin/ could very well be something like /mnt/l-o/home/somedomain.com/var/www/cgi-bin/. Most of this information is available if you check out the site docs, if not you can usually figure it out by simply calling or emailing the tech support and asking.

 #!/usr/bin/perl
 use CGI;
 $q = new CGI;
 $pwd = `pwd`; $user = `whoami`; $group=`groups`;
 print $q->header, "<H2>Current directory: $pwd </H2> 
 <H2>As: $user.$group</h2>", $q->end_html;

-Mike Cary

Thanks Mike, after three days of frustration you gave me the answer. This should be included in the README. John Saleeby

If you can't get the "pwd" system command to work in the cgi script, you can just use a relative path to reference the database, for example: $DataDir = "./wikidb"; -Floyd Reed

If your server only let's you execute scripts in the /cgi-bin folder and you want to keep things on a different folder and in a different leve;, you will need to reference the database like this: $DataDir = "../level1/level2/wikidb"; -Livia Labate

Thanks, that solved my problem. Del Brown


Thanks so much Floyd, you have rectified a problem that took me 5 hours to fix. My damn hosting company wouldn't give me the path to the bin and didn't support telnet, so I had nothing to put in as the path, and the script above gave me the relative path anyways. Thanks so much. Andrew Defries


If your cgi-data dir is in the same place as your webspace and you don't know where it physically is, the simplest way would be to use the environment variable DOCUMENT_ROOT:

 $DataDir = "$ENV{'DOCUMENT_ROOT'}/cgi-data/mywiki"

-- AKF


Q: What should the following file permissions be?

The last three is assuming that the owner of the wikidb owner matches the one with which the script is run. E.g. if the script runs as "www-data", then the wikidb, etc. files must also be owned by "www-data". See the documentation of your web server for details. If you're running apache, and your script resides in a user directory (e.g. /~someone/public_html/...), you might want to check out apache's "suexec". -- UngarPeter


After days of debuging this is a Virtual Private Server (they insisted that there really was no secret directory structure above what I could see... I doubted their word because I could not make UseMod go, and it had been so easy on other servers... However, they were right. Two things were wrong... I needed to make sure I was doing an ASCII upload... (duh)... and 2) I needed to use a relative path to reference the DataDir. html and cgi-bin were peers within /var/www. However, I could not reference /wiki from the root. I needed to use ../html/wiki to make it go. Wiki was running as a script within cgi-bin... and then I referenced up one level, and then down through html to the wiki directory. Then voila! It worked! -- MatthewSimpson

''What chmod command does it take? If there is more than one, which is the most common? Do you have to be a privileged user to do so?
For the data directory, chmod -R 777 could be fine, but depends on your server (hosting company). For example, on my server I use SuEXEC? and I just need to give permissions to the user that runs when SuEXEC? is called, which is myself, hence the permissions are not that wide open. Experiment until you get it to work. Experience is the mother of all knowledge. -- DavidCollantes

If you are not using SuEXEC?, wiki.cgi runs as the web-server (often nobody.nobody) and the data directory should be writable by them. (chmod -R 777 datadir) If this is the case, the weberver/script wll write files with -rw-r--r-- that may be unmodifiable by the installing user. In this case, you might need to be privileged to change stuff. SuEXEC? is nicer.


Cookie names with multiple wikis

... If your site uses multiple copies of UseModWiki, you must make sure that each copy has a unique $CookieName?. (Why?) The cookies store user-specific settings and preferences.

seems to me that it is equally valid to leave it as wiki for all copies of wiki, with the effect that a user's preferences have global effect, ie apply to all wikis in your WikiFarm?.

If you did this, you would also need to change the $UserDir setting so that all the copies shared the same user-data directory. With that change it might just work OK. Depending on the nature of the WikiFarm?, some users might want different settings for different wikis (for instance, displaying fewer RecentChanges days on a popular wiki). --CliffordAdams

Another subtle trap is that the global effect would be broken if the wikis appeared to be on different hosts. For example with the current urls UseModWiki and MeatBallWiki could share cookies, but later on if MeatBallWiki moved to //www.meatball.com/ the global effect would be broken even if the physical server remained the same for both sites

I will refactor this discussion into a suitable place when I have finished coding/testing my related patch--RiVer


Speeding up your wiki with mod_perl

If you have version 1.0, check out the PersistentCGI page.


$Homepage Setting In The Config File

Hi, just trying to install this, I can't seem to get it to work, and I don't know why! I set up a link from a webpage pointing to cgi-bin/wiki.pl. When ever I click on this link, a IE Download window appears, asking me whether I want to save or open this file. Is this right? I click on open, a MS-DOS prompt window shows up and closes, and nothing happens. Really stuck, and would appreciate some/any help at all. Also, so all the files and folder from the .zip file go into the cgi-bin folder? Will this make things easier? Thanks in advance! Email me if you like on steven@dwl.co.uk.

Hi, Steve, try renaming the file wiki.cgi or something that the web server is configged to run. as mentioned at UseModWiki/Install


Hi, ny name is juanma, the same error for me: "asking me whether I want to save or open this file". Try remaning like .cgi doesn´t my solution. Help, please. (Windows xp pro, IIS 5.1, usemod10, Perl 5.1.6.1.635). Thanks. juanmampurl@NOSPAMhotmail.com


(both of the above)
2 possible solutions
* try to absolutely link to to wiki.pl (not with file:// because then it'll be threatet as a file, but with e.g. http://localhost/cgi-bin/wiki.pl )
* read the apache doc about cgi-perms (default should work after uncommenting '# AddHandler cgi .....' in httpd.conf)


Could not get editing lock (how this problem can be solved)

The following is provisionally copied from UseModWiki/Bugs and should also be copied into the installation instruction file, because quite many users reported the problem here. (deleting $TempDir solved my "cannot lock" problem) TomGries 26.02.2004

I get this error message: Could not get editing lock at /....//wiki.pl line 3225.

I'm the one and only user of this wiki because it's new and there is no link to the wiki. I can't edit the page because I get this message. I have tried maintain, but it don't help. --MDE

Try action=unlock and see if that helps. (The unlock action tries a normal unlock, then tries a forced unlock if the normal one doesn't work.) For future releases I plan to make the ordinary editing code try to force-clear the lock. (This might be an option that sites could turn off, but its useful for most sites.) --CliffordAdams'''

My host service has made some (unspecified) security enhancements and I am now getting this error. Is there a file containing the locks that needs a special permission set? - BobWaller

I'm also getting this error and I'd also wonder where the locks are kept so I can clear them manually. - Dave

The locks are kept in the $TempDir, which is (unless you changed it in the config) the "temp" directory of your wiki. You can remove all the files in the "temp" directory to clear all locks. --CliffordAdams


Internal Server Error?

Ho folks, I can not believe it! The script does not work for me! Already installed some other wiki on pearl base w/out a problem! But here I can use realtiv or absolut path, in the cgi or other directory, pl or cgi, I always get a Internal Server Error. What else can I do! Tx! Daniel

Which server and operating system do you use? Which messages are in the error log of your server?

i'd recommend to read (linux) /var/log/apache/error.log which will probably contain an perl error. in this case run the wiki 'manually' with 'perl wiki.pl' to track the problem more easily

500 / Internal Error May Be Easy to Fix

I ran into the same internal error myself. If you're lucky, it may be easy to fix like it was for me.

In my case, the problem was that the wiki.pl file [and probably config too] was saved with the wrong kind of line breaks. To make a long story short, you can download EditPad? Lite:

http://www.editpadpro.com/editpadlite.html

Using this program, open the wiki.pl file, go to the Convert menu, choose Unix [or whichever of the three types of server on that list is accurate for you], save the file, and re-upload it [making sure to set the permissions again if you have to].

Treesong


Unicode

If you put Unicode text in and then try to edit it, everything gets escaped into numeric entity references... ☹


More Lock Problems

I'm getting this error message when I attempt to edit a page:

can not make home/httpd/vhosts/davidpetrieassociates.com/httpdocs/cgi-local/dhi/wikidb/temp/lock: Permission denied

I've commented the references in the wiki.pl file to both the $Temp and $Lock, but seem to still get this error. Any idea why? TIA for your help!

Restore the wiki.pl, the locking is there for a reason. One thing that I see here is a missing "/" (slash) before "home" in the path. Also, make sure that the web server process does have write access to the wikidb directory. -- UngarPeter

500 Internal Server Error

When I try to install Usemod, I get a 500 error:

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@vfdwiki.elementfx.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument? to handle the request.

Please help. --DagothUrMadGod


If you have any questions or problems please contact [usemod@usemod.org]...


UseModWiki | UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited November 6, 2023 8:04 pm by MarkusLude (diff)
Search: