• No results found

How to Install MediaWiki on Windows Server 2003

N/A
N/A
Protected

Academic year: 2021

Share "How to Install MediaWiki on Windows Server 2003"

Copied!
20
0
0

Loading.... (view fulltext now)

Full text

(1)

How to Install MediaWiki on Windows Server 2003

Larry Kahm

This article describes how you can install MediaWiki on Windows Server 2003 so that you can provide a wiki for your intranet users.

According to the project’s web page (http://www.mediawiki.org), “MediaWiki is a free software wiki package written in PHP, originally for use on Wikipedia. It is now used by several other projects of the non-profit Wikimedia Foundation and by many other wikis.”

The process for installing MediaWiki includes the following activities:  Installing PHP with FastCGI

 Installing MySQL  Installing MediaWiki

Each activity requires you to install the appropriate component, configure it, and then verify the installation. This article also includes a section that describes some common errors and the steps you can take to correct them.

The screen images that accompany this article were taken from a Windows Server 2003 session running in Microsoft Virtual PC 2007.

File requirements

You will need the following components, so take a moment to download the files before you begin.

PHP from http://www.php.net/downloads.php (Windows Binaries zip package) FastCGI from

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=2d481579-9a7c-4632-b6e6-dee9097f9dc5

MySQL from http://dev.mysql.com/downloads/mysql/5.0.html#win32 (Windows ZIP/Setup.EXE)

MySQL GUI Tools from http://dev.mysql.com/downloads/gui-tools/5.0.html

MediaWiki from http://www.mediawiki.org/wiki/Download

You will require an unzip utility to process the MediaWiki file (the one built in to Windows Server 2003 does not recognize .gz files). One freely available utility is 7-Zip from

http://cleansofts.org/download/7-zip.html.

(2)

Installing PHP with FastCGI

Download the latest version of the PHP Windows Binaries.

Note: For this procedure, use the zip package rather than the installer.

Double-click the .zip file to open it. Click File, Extract All… to invoke the Windows Extraction Wizard.

Click Next, change the destination folder to C:\php and click Next. Windows will extract all of the files and prompt you if you want to see the files (you do). Click Finish. Close the .zip file. Note: If you prefer to use the .msi file, instead of the .zip package, make sure you:

 Select IIS FastCGI as the Web Server

 Install the MySQL Extensions (you may wish to select other extensions as well) While you have the C:\php folder open, set the appropriate permissions for using PHP on the server. Click the Up arrow to go up one level. Right-click the php folder and select Security and Sharing. In the php folder Properties window, select the Security tab.

(3)

Figure 1. PHP folder security settings

Click Apply, if necessary. Click OK to close this window, and then click OK to close the Properties window.

Close the C:\php folder.

Install FastCGI

Download the FastCGI file.

Double-click the .msi file to begin the installation routine. On the FastCGI x86 Setup Wizard window, click Next.

(4)

Open your Server, select Web Sites, and then select Default Web Site. Right-click the Default Web Site and select Properties as shown in Figure 2.

Figure 2. IIS Manager

(5)

Figure 3. Default Web Site properties

In the Application Settings portion of the window, make sure you select “Scripts only” under Execute Permissions. Then click Configuration…

(6)

Figure 4. Add/Edit Application Extension Mapping window

Set the executable to C:\Windows\system32\inetsrv\fcgiext.dll and set the extension to .php (you must include the dot).

Click OK, and then click OK again.

Select the Documents tab, and click Add…

Add index.php to the list and Click OK. Use the Move Up button to move this entry to the top

of the list.

Click OK to close the Default Web Site Properties dialog box. Note: When prompted about overriding any properties, click OK.

Configure FastCGI and PHP

Open a Windows Command Prompt and navigate to C:\Windows\system32\inetsrv\. Use the dir command to make sure you have the file fcgiconfig.js. Then invoke the following command:

cscript fcgiconfig.js –add –section:"PHP" –extension:php – path:"C:\php\php-cgi.exe"

The utility function will issue a success message, as shown in Figure 5.

Figure 5. FastCGI configuration

(7)

You have configured Windows Server 2003 to run PHP under IIS.

Test PHP

Test your PHP installation before you continue.

Using Windows Explorer, navigate to your web’s root directory, which is C:\Inetpub\wwwroot. Create a new file called phpinfo.php and include the following line of text:

<?php phpinfo(); ?>

Save the file.

Open Internet Explorer and type the following URL in the Address bar,

http://localhost/phpinfo.php. After you press Enter, you should see something similar to the display shown in Figure 6.

Figure 6. PHP verification page

(8)

Installing MySQL

Download the MySQL Community Server Windows Install package. Double-click the .msi file to begin the installation.

The MySQL Server Setup Wizard window is displayed. Click Next.

Select the Complete setup type and click Next, then click Install. The installation wizard will copy the appropriate files to your server.

After the Setup Wizard completes, click Next twice. The wizard indicates that it is complete and there is a check mark next to Configure the MySQL Server now. Click Finish.

The MySQL Server Instance Configuration Wizard is launched. Click Next.

This configuration set up process requires you to provide responses to almost one dozen screens. Below is a concise summary of the actions to take:

Accept the default option, Detailed Configuration, and click Next. Select Server Machine and click Next.

Accept the default option, Multifunctional Database, and click Next. Select \MySQL DataFiles\ from the drop-down list and click Next. Select Online Transaction Processing (OLTP) and click Next. Accept the default options for TCP/IP Networking and click Next. Accept the default option, Standard Character Set, and click Next.

Accept the default option, Install as a Windows Service, but select the name you wish to use for the service; in addition, select Include Bin Directory in Windows PATH and click Next.

Create the New root password and Confirm it (leave the Current root password blank), and click Next.

Note: You will need this password to create your MediaWiki database.

You have provided all of the settings, so click Execute to perform the configuration routine. Click Finish when the configuration has completed successfully.

If you encounter any errors during configuration, refer to “Error detection and correction” on page 15.

Test MySQL

Test your MySQL installation before you continue.

Open a Windows Command Prompt and enter the following command:

(9)

where password is the password you established during the configuration process.

Note: There is no space between –u and root; nor is there a space between –p and password. The MySQL command processor responds with a welcome message, as shown in Figure 7.

Figure 7. MySQL welcome message

Notice the password appears in clear text (i.e., it is not hidden); in fact, it also appears in the title bar of the Command Prompt.

Now enter the following command. Make sure you end the command with a semi-colon.

status;

(10)

Figure 8. MySQL status command results

Type exit; to end the MySQL session.

Close the Windows Command prompt.

Install MySQL GUI Tools

With MySQL successfully installed, you will need some assistance to create the appropriate environment before you install MediaWiki.

Download the MySQL GUI Tools.

Double-click the .msi file to begin the installation. Click Next.

Accept the terms of the license agreement and click Next. Click Next.

Select Complete setup and click Next. Click Install.

(11)

You will use the MySQL GUI Tools to create the default MediaWiki database and user in another step.

Configure php.ini

Use Windows Explorer and open the C:\php folder. Rename the php.ini-recommended file to php.ini.

Edit php.ini in Notepad.

Find the line that has the string: php_mysql.dll and make sure it is uncommented (no leading

semi-colon).

Scroll to the top of the file and find the line that has the string, extension_dir, and make sure it

is uncommented. Then, set it to C:\php\ext.

Save the changes and close the file. Close the Windows Explorer window.

Open IIS and restart the web server. To do this, right click on the Default Web Site and select Stop. Wait a moment, then right click and select Start.

Open Internet Explorer and browse your test php file again to make sure that PHP is still working.

Installing MediaWiki

(12)

Figure 9. MySQL Administrator window

In the MySQL Administrator window, click Catalogs

Right-click in the white space under the list of Schemata and select Create New Schema from the menu.

Name the new schema wikidb (this is the default value expected by MediaWiki; however, you can enter any name you wish) and click OK. The wikidb database now appears in the list. Click User Administration and click Add new user.

Create a new user. In this case, name the new user wikiuser (this is the default value expected by MediaWiki; however, you can enter any name you wish). Enter a password and click Apply changes. This password should not be the same as the root ID’s password!

(13)

Select the schema you just created (wikidb) and click the double left-facing chevrons (<<) to grant all privileges to this new user (wikiuser).

Click Apply changes.

Close the MySQL Administrator window.

Install MediaWiki

Download the most recent MediaWiki distribution file. This file is a tar.gz, which cannot be opened by the native Windows unzip utility.

If you have installed 7-Zip, right click the file. Select Open archive. You will see a .tar file. Click Extract and copy the file to a temporary folder, then click OK.

Use Windows Explorer and navigate to the temporary folder. Right click the .tar file and select Open archive. Click Extract and save the file to the C:\ drive with the saved folder name. Close the 7-Zip utility.

Using Windows Explorer, locate the folder, mediawiki-1.nn.m (which corresponds to the version of MediaWiki that you downloaded). Copy this folder to the root folder of your web site

(C:\Inetpub\wwwroot).

Rename the folder to wiki. You will have the following folder hierarchy: C:\Inetpub\wwwroot\wiki.

With the Windows Explorer window still open, set the permissions on these folders for IUSR_<machine_name> as you did for PHP earlier.

Right click the wiki folder and select Properties. Select the Security tab, and (if necessary Add) the Internet Guest Account. Make sure you select Read & Execute, List Folder Contents, and Read. Click OK.

Expand the wiki folder and right-click the config folder, and then navigate to the Security tab. Allow the IUSR_<machine_name> account Full Control. It is necessary to do this because MediaWiki will attempt to create a new file in that folder. You will delete this folder after MediaWiki successfully creates the file.

Configure MediaWiki

(14)

Click on the link to set up the wiki. Figure 10 shows the resulting web page.

Figure 10. MediaWiki configuration/installation page

The top portion of the page indicates the status of your site as determined by MediaWiki. You may wish to enhance some of these characteristics later, if you so desire.

Scroll down the page.

You must provide the name of your wiki and choose a password for the WikiSysop account. Write down this password and keep it along with the others!

Type in the name of the database you created earlier (wikidb), the database user name (wikiuser), and the user’s password. Click Install MediaWiki.

MediaWiki runs the appropriate configuration routines and redirects you to the homepage of your new wiki.

At the bottom of the resulting page is the “success” message. It also contains one final action that you must take.

(15)

You can now delete the config folder.

Finally, open MediaWiki to begin documenting your internal business processes. Enter the following URL in Internet Explorer: http://localhost/wiki/index.php. Figure 11 shows the resulting web page.

Figure 11. MediaWiki installed and ready for use

Congratulations on a job well done!

Take a few moments to read some of the information available via the links on this page. Then get ready to roll out your new wiki for your intranet users.

If you encounter any errors during configuration, refer to “Error detection and correction.”

Error detection and correction

(16)

MySQL errors

The MySQL configuration routine fails at the Start Service step, as shown in Figure 12.

Figure 12. MySQL Server configuration error

Perform the following diagnostic steps. Review the MySQL installation log.

Open Windows Explorer and select Tools, Folder Options...

Click the View tab and select the option Show hidden files and folders. Click OK.

Navigate to C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data

Open the <machine_name>.err file in Notepad.

This log file, from my experience, will have either a success message or an error message.

Success message

The success message looks similar to the following:

(17)

090331 9:24:56 [Note] Event Scheduler: Loaded 0 events

090331 9:24:56 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: ready for connections.

Version: '5.1.32-community' socket: '' port: 3306 MySQL Community Server (GPL)

To complete the installation, perform the following steps. Close Notepad.

Close Windows Explorer.

In the MySQL Server Instance Configuration Wizard window, click Back.

Click Start, Administrative Tools, Services (alternatively, Start, Run, services.msc), then scroll down to the MySQL service. Right-click the service and select Stop to stop it.

Close the Services Window.

Open a Windows Command Prompt and enter the following command:

sc delete mysql

After you see the “[SC] Delete Service SUCCESS” message, close the Windows Command Prompt.

Click Next to resume the MySQL Wizard configuration, then click Execute. The MySQL Configuration Wizard should complete successfully.

Make sure you test your MySQL installation.

Failure message

The failure message looks similar to the following:

InnoDB: Error: log file .\ib_logfile0 is of different size 0 10485760 bytes InnoDB: than specified in the .cnf file 0 16777216 bytes!

090331 9:24:56 [ERROR] Default storage engine (InnoDB) is not available 090331 9:24:56 [ERROR] Aborting

090331 9:24:56 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Shutdown complete

To complete the installation, perform the following steps. Close Notepad.

In the MySQL Server Instance Configuration Wizard window, click Back.

Click Start, Administrative Tools, Services (alternatively, Start, Run, services.msc), then scroll down to the MySQL service. Right-click the service and select Stop to stop it.

Close the Services Window.

(18)

After you see the “[SC] Delete Service SUCCESS” message, close the Windows Command Prompt.

In Windows Explorer (you should still be in C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data), delete the following files:

 ib_logfile0  ib_logfile1

 <machine_name>.err  <machine_name>.pid

Navigate to the folder in which you stored the database; in this case, it was C:\MySQL DataFiles. Delete the following file:

 ibdata1

Navigate to C:\Program Files\MySQL\MySQL Server 5.1. Open the my.ini file in Notepad

Change the value of the innodb_log_file_size parameter to 10M. Save the file. Close Notepad.

Close Windows Explorer.

Close any other open window except the MySQL Wizard.

Click Next to resume the MySQL Wizard configuration, then click Execute. The MySQL Configuration Wizard should complete successfully.

Make sure you test your MySQL installation.

MediaWiki errors

(19)

Figure 13. Internet Explorer generic error message

This means that Internet Explorer has encountered an error; however, you cannot see it because the settings default to show “friendly messages.”

Click Tools and select Internet Options. Select the Advanced tab. Scroll down the list and remove the check mark next to Show friendly HTTP error messages. Click OK.

Refresh the page in the browser to obtain the actual error message. After you refresh the page, you receive the following message:

PHP Warning: fopen(LocalSettings.php) [function.fopen]: failed to open stream: Permission denied in C:\Inetpub\wwwroot\wiki\config\index.php on line 1136

Take the following remedial actions:

Double-check to see that the config folder has the appropriate permissions for the Internet Guest Account. If it does, retry the MediaWiki installation.

(20)

If it still fails, give the Internet Guest Account Full Control to the entire wiki folder and propagate the rules to the sub-folders. You can alter these settings after the configuration is complete.

Summary

To recap, you downloaded and installed PHP, MySQL, a MySQL Administration tool, and MediaWiki.

You configured each of the components and tested each of them to ensure the installations were successful.

Finally, you enabled MediaWiki to serve as a wiki on your Windows Server 2003 server.

About the Author

Larry Kahm is president of Heliotropic Systems, Inc., an IBM Business Partner located in Fort Lee, N.J., which provides computer systems analysis and design solutions for small businesses. He has 20 years of experience evaluating and deploying productivity tools and advocating their use. His areas of expertise include change management (methodology and software solutions), application development technical support, database development, and technical writing. You can contact him via e-mail at lkahm@heliotropicsystems.com.

Copyright © 2009 Heliotropic Systems, Inc.

References

Related documents

Whether you are installing Citrix MetaFrame Presentation Server 3.0 on Windows 2000 Server or on Windows Server 2003, you need to install the Terminal Services Licensing component on

If you are installing on a computer that has Terminal Services or Terminal Server installed (typically, Windows 2000 Server or Windows Server 2003), the Terminal Server

This training will include a basic guide for how to install and setup Microsoft Windows 2003 DNS server to support Microsoft Active Directory.. Training Installing

Exchange between the pcl file on php to same line quote style guide was successful in the same file format.. See the

1 If you cannot access the web configurator using Internet Explorer in Windows XP or Windows Server 2003, make sure you allow pop-up windows, JavaScripts and Java permissions or

If you cannot access the web configurator using Internet Explorer in Windows XP or Windows Server 2003, make sure you allow pop-up windows, JavaScripts and Java permissions or set

If you are installing Web Interface for Microsoft Internet Information Services on a 64-bit version of Windows Server 2003, ensure that you install the Web Interface prior

Before installing the Router, make sure your PC is connected to the Internet through the broadband service successfully. After that, please install the