Howto:Install MediaWiki on 1and1

From ChrisWiki
Jump to navigationJump to search

Howto:Install MediaWiki on 1&1

After hours of toil to download a 3.8MB wiki software zip file, uploading 12MB of the uncompressed files[1], then finding out that MediaWiki requires PHP5, and that 1&1 uses the .php5 extension for that so I needed to change my .htaccess file to map .php files to the PHP5 interpreter instead of PHP4, and then finding out that 1&1 also retardedly uses the /config directory to redirect to the administration login page, and that this supersedes any files that actually exist on the server, including .htaccess, then finding out that the installation script craps out if the /config directory doesn't exist[2], then going through the hassle to shorten the URLs through more .htaccess hacks so you don't end up with URLs like http://wiki.chrisretlich.com/wiki/index.php?title=Main_Page, I finally have the wiki set up in a half-way decent fashion that appears to work now.

Note: as of 2019, many of the issues above no longer apply. E.g. PHP5 is no longer supported (or is being deprecated by 1&1), the /config redirect is no longer mandated, 1&1 is now 1&1 Ionos, etc.


How to Really install MediaWiki on 1&1

  1. Download the zip file for MediaWiki (I used the 1.9.3 stable release).
  2. Unzip the files somewhere.
  3. Rename the "config" folder to "config2".
  4. Create a new folder named "config".
  5. Create a file named ".htaccess" and put it in the root folder of the unzipped files, this file should contain the text AddType x-mapp-php5 .php
    • You may also want to add RewriteEngine On and RewriteRule ^(.*)\&(.*)$ $1\%26$2 to allow URLs which contain the ampersand character (&).
  6. Upload the files to your webspace using some kind of FTP program. Use a separate folder for your files, such as /wiki/, and/or a different subdomain.
  7. Create a new MySQL database using the 1&1 control panel
    1. Copy the password, username, and server that you get on the confirmation screen
    2. You may want to change the password to something better
  8. Browse to the directory where you uploaded your files with a web browser, and then go to the /config2/ subdirectory, e.g. website.com/wiki/config2/ or wiki.website.com/config2/
  9. Fill out the form.
  10. Move the "LocalSettings.php" from the config folder up to it's parent folder.
  11. Put a 135x135px PNG logo in the images/ subdirectory, and add $wgLogo = "/images/FILENAME.png"; to your LocalSettings.php file.
  12. Your wiki might be ready to go!

URL shortening

If you want to employ the super-1337 URL shortening techniques, then add the following to your .htaccess file which you created earlier[3]:

DirectoryIndex index.php
RewriteEngine On
RewriteRule ^(.*)\&(.*)$ $1\%26$2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.php?title=$1 [L,QSA]
RewriteRule ^$ /Main_Page [R]

You can also try this code instead:

DirectoryIndex index.php
RewriteEngine On
RewriteRule (images|skins)/ - [L]
RewriteRule \.php$ - [L]
RewriteRule ^$ /Main_Page [R]
RewriteRule ^/?(.*)$ /index.php?title=$1 [L,QSA]

Or you can also get some more help on wiki URL shortening.

In addition, you'll want to add the following to your "LocalSettings.php" file[3]:

$wgScriptPath = "";
$wgArticlePath = "$wgScriptPath/$1";


Notes:

  1. On dial-up!
  2. like when you rename the /config directory to /config2 so you can actually access the installer
  3. 3.0 3.1 they may have to be modified if you installed your wiki in a subdirectory on your website, e.g. /wiki/