Howto:Install MediaWiki on 1and1: Difference between revisions

From ChrisWiki
Jump to navigationJump to search
m (bah, square brackets)
(Update really outdated website links, add note that many peculiarities no longer exist, add more .htaccess magic)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Howto:Install MediaWiki on 1&1=
=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<ref>On dial-up!</ref>, 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<ref>like when you rename the /config directory to /config2 so you can actually access the installer</ref>, then going through the hassle to shorten the URLs through more .htaccess hacks so you don't end up with URLs like <code>http://wiki.chrisretlich.com/wiki/index.php?title=Main_Page</code>, I finally have the wiki set up in a half-way decent fashion that appears to work now.
After hours of toil to download a 3.8MB wiki software zip file, uploading 12MB of the uncompressed files<ref>On dial-up!</ref>, 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<ref>like when you rename the /config directory to /config2 so you can actually access the installer</ref>, then going through the hassle to shorten the URLs through more .htaccess hacks so you don't end up with URLs like <code>http://wiki.chrisretlich.com/wiki/index.php?title=Main_Page</code>, 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=
=How to ''Really'' install MediaWiki on 1&1=
# Download the [http://sourceforge.net/projects/wikipedia zip file] for MediaWiki (I used the 1.9.3 stable release).
# Download the [https://www.mediawiki.org/wiki/Download zip file] for MediaWiki (I used the 1.9.3 stable release).
# Unzip the files somewhere.
# Unzip the files somewhere.
# Rename the "config" folder to "config2".
# Rename the "config" folder to "config2".
# Create a new folder named "config".
# Create a new folder named "config".
# Create a file named ".htaccess" and put it in the root folder of the unzipped files, this file should contain the text <code>AddType x-mapp-php5 .php</code>
# Create a file named ".htaccess" and put it in the root folder of the unzipped files, this file should contain the text <code>AddType x-mapp-php5 .php</code>
# Upload the files to your webspace using [http://filezilla.sf.net/ some kind of FTP program].  Use a separate folder for your files, such as /wiki/, and/or a different subdomain.
#* You may also want to add <code>RewriteEngine On</code> and <code>RewriteRule ^(.*)\&(.*)$ $1\%26$2</code> to allow URLs which contain the ampersand character (&).
# Create a new MySQL database using the [https://admin.1and1.com 1&1 control panel]
# Upload the files to your webspace using [https://filezilla-project.org/ some kind of FTP program].  Use a separate folder for your files, such as /wiki/, and/or a different subdomain.
# Create a new MySQL database using the [https://my.ionos.com/ 1&1 control panel]
## Copy the password, username, and server that you get on the confirmation screen
## Copy the password, username, and server that you get on the confirmation screen
## You may want to change the password to something better
## You may want to change the password to something better
Line 21: Line 24:
==URL shortening==
==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<ref name="wikidirectory">they may have to be modified if you installed your wiki in a subdirectory on your website, e.g. /wiki/</ref>:
If you want to employ the super-1337 URL shortening techniques, then add the following to your .htaccess file which you created earlier<ref name="wikidirectory">they may have to be modified if you installed your wiki in a subdirectory on your website, e.g. /wiki/</ref>:
DirectoryIndex index.php
RewriteEngine On
RewriteRule ^(.*)\&(.*)$ $1\%26$2
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-d
Line 26: Line 32:
  RewriteRule ^$ /Main_Page [R]
  RewriteRule ^$ /Main_Page [R]
You can also try this code instead:
You can also try this code instead:
DirectoryIndex index.php
RewriteEngine On
  RewriteRule (images|skins)/ - [L]
  RewriteRule (images|skins)/ - [L]
  RewriteRule \.php$ - [L]
  RewriteRule \.php$ - [L]
  RewriteRule ^$ /Main_Page [R]
  RewriteRule ^$ /Main_Page [R]
  RewriteRule ^/?(.*)$ /index.php?title=$1 [L,QSA]
  RewriteRule ^/?(.*)$ /index.php?title=$1 [L,QSA]
Or you can also get some more help on [http://meta.wikimedia.org/wiki/Using_a_very_short_URL  wiki URL shortening].
Or you can also get some more help on [https://www.mediawiki.org/wiki/Manual:Short_URL wiki URL shortening].


In addition, you'll want to add the following to your "LocalSettings.php" file<ref name="wikidirectory" />:
In addition, you'll want to add the following to your "LocalSettings.php" file<ref name="wikidirectory" />:

Latest revision as of 23:45, 26 June 2019

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/