Howto:Install MediaWiki on 1and1: Difference between revisions
(new) |
(Update really outdated website links, add note that many peculiarities no longer exist, add more .htaccess magic) |
||
(4 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 [ | # 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 [ | #* 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:// | # 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 [ | 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
- Download the zip file for MediaWiki (I used the 1.9.3 stable release).
- Unzip the files somewhere.
- Rename the "config" folder to "config2".
- 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
AddType x-mapp-php5 .php
- You may also want to add
RewriteEngine On
andRewriteRule ^(.*)\&(.*)$ $1\%26$2
to allow URLs which contain the ampersand character (&).
- You may also want to add
- 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.
- Create a new MySQL database using the 1&1 control panel
- Copy the password, username, and server that you get on the confirmation screen
- You may want to change the password to something better
- 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/
- Fill out the form.
- Move the "LocalSettings.php" from the config folder up to it's parent folder.
- Put a 135x135px PNG logo in the images/ subdirectory, and add
$wgLogo = "/images/FILENAME.png";
to your LocalSettings.php file. - 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";