在Windows Server2003 搭建mediawiki

系统要求

  • 下载 MediaWiki
  • Web 服务器 例如 IIS
  • PHP 5.0 或更高版本
  • 数据库服务器
    • MySQL 4.0 或更高版本

 

1.下载所需软件:

mediawiki-1.18.0

[http://www.mediawiki.org/wiki/Download/zh]

mysql-essential-5.0.24-win32.msi

[http://dev.mysql.com/downloads/mysql/5.1.html]

php-5.3.8-Win32-VC9-x86.msi

[http://windows.php.net/download/]

fcgisetup_1.5_rtw_x64.msi

[http://www.iis.net/download/fastcgi]

Navicat_for_MySQL.exe (MySql数据库可视化客户端)

 

具体安装过程参考安装指南:

Installing MediaWiki on Windows Server 2003

[http://www.mediawiki.org/wiki/Manual:Installing_MediaWiki_on_Windows_Server_2003]

注意:若安装完成后无法访问Wiki,在IIS中网站Wiki右键权限,添加everyone的读取运行权限。

 

This guide shows how to install MediaWiki on a computer running Windows Server 2003 SP2. This should also work onWindows XP Professional if Internet Information Services (IIS) is installed (see Control Panel, Add/RemovePrograms, Add/Remove Windows Components).

The WIMP stack usedfor this installation:

§  Windows Server 2003

§  IIS 6

§  MySQL 5.0.24 (There are problems with MySQL 5.0.26 andhigher as of Nov. 22, 2006)

§  I have MySQL5 and PHP5 running under Win2K AdvancedServer SP4, no problem. I also have SMF 1.1RC3 working fine. - Slamlander 23:04, 25 November 2006 (UTC)

§  PHP 5.2.3

§  MediaWiki 1.10

Contents

  [hide

·         1 Ingredients:

o    1.1 MediaWiki (latest stable version)

o    1.2 PHP 5.2.5

o    1.3 MySQL 5.0.24

o    1.4 DBTools 3.03 (optional)

·         2 Preparation:

o    2.1 Install MySQL 5.0.24

o    2.2 Install PHP 5.2.3 [Recommended]

§  2.2.1 Install Pear

o    2.3 Install MediaWiki in IIS

o    2.4 Verification

o    2.5 Install MySQL 4.1

o    2.6 force MySQL to use 16-byte password encryption

o    2.7 Install MediaWiki by visiting the virdir previously created

o    2.8 Create LocalSettings.php in root directory of mediawiki

o    2.9 change the root password of the MySQL instance!

o    2.10 Fix the script error

·         3 Troubleshooting

o    3.1 a. Fix Access to page when hosted on a Windows 2003 Domain Controller

o    3.2 b. Fix Email problem when using IIS SMTP Relay / Exchange

o    3.3 c. Permission Denied issue on IIS (Windows XP)

o    3.4 d. Error in my_thread_global_end(): 1 threads didn't exit

o    3.5 e. Error "There is a problem with this Windows Installer package. A script required .." when installing PHP from msi package

o    3.6 f. PHP 5.2.9 Lockup in IIS

o    3.7 g. Impossible to upload images with non standard characters

o    3.8 h. IIS returns a 404 error page instead of MediaWiki default error page

o    3.9 i. Other Problems?

[edit]Ingredients:

[edit]MediaWiki (latest stable version)

The latest stable release can be downloaded from theDownload page.

[edit]PHP 5.2.5

Latest version: [1]
older version:
 PHP 4.3.12

§  NOTE: PHP 5.2.6 DOES *NOT* WORK WITH Postgres (DependencyIssue with php_pgsql.dll)

This version is not available anywhere on internet. Whichother latest version can work on 32-bit windows server 2003 ????

I managed to get PHP 5.3.3 working on 32-Bit WindowsServer 2003.
To install PHP on IIS you need to firstly install the Microsoft FastCGIExtention 1.5 for IIS6 and 5.1.
You are also going to need Microsoft Visual C++ 2005 Redistributable Package(x86) prior to 'installing' wiki.

[edit]MySQL 5.0.24

MySQL 5.0.24

[edit]DBTools 3.03 (optional)

§  DBTools 3.03

§  MySQL db Administration

[edit]Preparation:

[edit]Install MySQL 5.0.24

Install MySQL to the default directory using the defaultoptions:

1.     Complete the installation by pressing "Next"all the way thru

2.     Select “Detailed Configuration”

3.     Choose “Developer Machine”

4.     Choose “MultiFunctional Database”

5.     Select path for Data, this configuration used the defaultlocation.

6.     Choose “Decision Support (DSS)/OLAP

7.     Enable TCP/IP Networking on 3306 and Enable Strict Mode

8.     Enable standard character set

9.     Install as a Windows Service and set to launchautomatically, check “Include Bin Directory in Windows PATH”

10.  Enter a Root Password

11.  Create the setup

12.  You may need to edit the Windows Firewall settings toallow for TCP port 3306 to be opened for the installation to complete.

[edit]Install PHP 5.2.3 [Recommended]

1.     Change the install folder to C:\PHP (do this byclicking Browse when thetree list of items to install is shown)

2.     Select IIS CGI from the list of WebServers

3.     Expand Extensions and select “MySQL” to install, but noteother extensions may be useful but can be added later. Hint: If you plan onusing Active Directory authentication later on, be sure to select “LDAP”,“OpenSSL” and “MCrypt” now. If you add them later, not all necessary files arecopied. You can get these files by performing a reinstall, but this will messup your php.ini file.

4.     Install all extras (PHP Manual and PEAR)

5.     In explorer create folders C:\PHP\sessiondata and C:\PHP\uploadtemp

6.     Select both folders, right click, and choose properties.On the Security tab grant user IUSR_<servername> or IIS_WPG(<name>) Modify” rights to both folders. (On Windows XPthe Security tab is hidden by default. From any Explorer window, click Tools,Folder Options, View tab, then uncheck the last option, Use simple file sharing. This unhides the tab.)

7.     In Notepad open C:\PHP\php.ini

8.     Find the line “;cgi.force_redirect = 1” anduncomment it, change the value of “1” to “0

9.     Find the line “upload_tmp_dir="C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\php\upload"”and change to “upload_tmp_dir="C:\PHP\uploadtemp"

10.  Change the next line to read: “session.save_path="C:\php\sessiondata"

NOTE:

§  Search PHP.INI for other instances of session.save_pathand upload_tmp_dir. Comment them out, if found.

1.     Save PHP.INI

§  Verify that usershave write access to the 2folder created above. This is where cookie information is stored among otherdata. Matt 18:35, 7 April 2008 (UTC)

That's it, you're done. No reboot is necessary.

[edit]InstallPear

§   

§  Current consensus is that go-pear.bat is obsolete, andthat pear should be installed by using a .phar (http://pear.php.net/bugs/bug.php?id=18217 for the discussion). Location of .phar is here : http://pear.php.net/go-pear.phar ** The instructions below didn't work for me on Windowsserver 2008, but the .phar worked fine.

If you want your wiki to be able to email you, afteryou've installed PHP then you'll also have install pear and download the pearmodules mail and net_smtp.

1.     From Internet Explorer goto: http://pear.php.net/go-pear

2.     Copy entire webpage, and paste into file:c:\php\pear\go-pear.bat

3.     From Command Line, do the following:

c:

cd \php

.\php pear\go-pear.bat

pear install mail

pear install net_smtp

Alternate PEAR Installation Method: Try running the php script using the php engine insteadof using .bat files. Follow the steps above but save the contents of thewebsite as c:\php\pear\go-pear.php

§  Now from the command line, do the following:

c:

cd \php\pear

php go-pear.php

§  Now run the new file PEAR_ENV.reg by double-clicking itand then do the following from the same command line:

(*) pear config-set http_proxy "http://LOGIN:PASSWORD@PROXYSERVEUR:PORT"

pear install mail

pear install net_smtp

[(*) if required]

[edit]Install MediaWiki in IIS

1.     Extract MediaWiki from its downloaded file and place theentire folder in C:\Inetpub\wwwroot\mediawiki

2.     Right click on this folder. Add IUSR_<servername> to the permissions list with "Read & Execute"permissions

3.     Open IIS Manager

4.     Stop the Default Website

5.     Right click on “Web Sites” and choose New, Website

6.     Call it “MediaWiki

7.     Select the path “C:\Inetpub\wwwroot\mediawiki

8.     Allow the permissions Read and Execute

9.     Right click on MediaWiki and choose Properties

10.  On the Documents tab add “index.php” as the default content pageand move to the top of the list

11.  Save settings and exit IIS Manager

12.  Enable write permissions on the C:\Inetpub\wwwroot\mediawiki\config folder (at least during the setup process).

13.  Run “iisreset

14.  From ANOTHER MACHINE navigate to http://<servername>/mediawiki Note: My machine was a virtual Windows 2000 ProfessionalSP4 installation with the machine joined to the domain and logged on using adomain user account.

15.  Configure MediaWiki as to your needs

16.  Copy LocalSettings.php from C:\Inetpub\wwwroot\mediawiki\config to C:\Inetpub\wwwroot\mediawiki

17.  Navigate back to http://<servername>/

18.  You are good to go…

Note: This is as far as my work took me, nothing else was necessary on myinstallation in order to complete a working MediaWiki install on Windows 2003SP2. I have left the other steps in the file in case they are useful to others.

[edit]Verification

See http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5adfcce1-030d-45b8-997c-bdbfa08ea459.mspx?mfr=true for IIS v6, seehttp://support.microsoft.com/kb/172138 for earlier IIS versions.

§  Ensure that the virtual directory has the .php extensionenabled. (Note: The PHP installation should have alreadyconfigured this.) To do this,select, right click on the web site with the virdir, select Properties. In theresulting dialog, select the "Virtual Directory" tab, and finallyclick the "Configuration..." button. In the "Applicationextensions" window, scroll down to verify .php is listedand the path to php-cgi.exe is correct.

§  Ensure the default document is set to index.php. Todo this, select, right click the virdir and select Properties/ In theProperties window, select the "Documents" tab, and in the"Enable default content page" verify index.php is at the top of thelist.

Note that the menus mentioned in this section are not present on WindowsXP Professional SP2. In that case, you may safely skip this step, as therestriction you would otherwise need to disable for PHP isn't present in thefirst place. In XP Pro SP2, there is no "Web Service Extensions"folder.

Within the "Internet Information Services (IIS)Manager"

1.     Expand

§  (+) Internet Information Services

§  (+) Hostname <-- The name of your server

§  (+) Web Service Extensions

2.     Right-click and choose "Add a new Web serviceextension..."

3.     In the new window entitled "New Web Service Extension":

1.     In the "Extension name:" field, enter,"cgi" (without the quotation marks)

2.     Then click "Add..."

1.     "In the new window entitled "Add file" andin the field "Path to file:", type in "C:\PHP\php-cgi.exe"(without the quotation marks)

2.     Click "OK"

3.     Tick "Set extension status to Allowed"

4.     Click "OK"

The system should allow you to have 2 extensionsreferencing the same Required Files (C:\PHP\php-cgi.exe), but in some casespeople have reported this as something that doesn't work for them. There is nodefinitive fix for this at the time of this writing...other than to tell youthat it works for me... Possible workaround is to copy php-cgi.exe tophp-cgi2.exe and use php-cgi2.exe instead.

 

 

[edit]Install MySQL 4.1

§  Use the setup file. Perform a "Complete"installation with defaults.

§  Check the 'configure now' box and select 'detailedconfiguration'

§  Options to choose: Server, multifunction, OLTP, Latin1collation, Enable TCP/IP Networking, Disable 'strict mode', add BIN to PATHvariable, do not change accounts (mediawiki installation will gack) [NB thisprobably means mySQL will install with blank root password], start as a service

§  ensure the installation worked:

 C:\>mysqlshow -u root -p

Enter password: ***********

 +-----------+

  |Databases |

 +-----------+

  |mysql     |

  |test      |

 +-----------+

[edit]force MySQL to use 16-byte passwordencryption

§  open the file C:\Program Files\MySQL\MySQL Server4.1\my.ini

§  add the following in the [mysqld] section:

  #Useold password encryption method

 old-passwords

§  restart the MySQL service! (enter NET STOP mysql, thenNET START mysql)

NB: the reasons for this are detailed at http://dev.mysql.com/doc/mysql/en/old-client.html

Also need to run the following commands:

C:\>mysql -u root -p

Enter password: *****

 

-> UPDATE mysql.user SET Password =OLD_PASSWORD('new_password') [set this to whatever you want your root passwordto be]

-> WHERE Host = 'localhost' AND User ='root';

-> FLUSH PRIVILEGES;

[edit]Install MediaWiki by visiting the virdirpreviously created

NB: if your website cannot be addressed as localhost,then go to IIS setting, select the vroot and right click on it and select browse.

§  visit the virdir in a browser

§  sitename: demowiki

§  contact email: root@wikihost [whatever you want yourcontact email to be]

§  sysop: WikiSysop

§  pwd: S3cur3Passw0rD

§  no caching

§  MySQL SERVER: wikihost [or 'localhost']

§  dbname: wikidb

§  wikiuser S3cur3Passw0rD2

§  root pwd: S3cur3Passw0rD3 (just use whatever you set theroot mySQL password to in step 6 above)

[edit]Create LocalSettings.php in root directory ofmediawiki

§  After you visit http://<servername>/config/index.php the following will be displayed on your browser. Copyeverything between <?php ?> to a file in a root directory of yourwiki called: LocalSettings.php

Below is the start of that section:

Warning: fopen(LocalSettings.php): failed toopen stream: Permission denied inC:\Inetpub\wwwroot\wmobilewiki\mediawiki-1.5.4\config\index.php on line 687

Couldn't write out LocalSettings.php. Checkthat the directory permissions are correct and that there isn't already a fileof that name here...

Here's the file that would have been written,try to paste it into place manually:

<?php

# This file was automatically generated bythe MediaWiki installer.

# If you make manual changes, please keeptrack in case you need to

# recreate them later.

 

§  To enable image uploads, make sure the 'images' directoryis writable, then uncomment this:

$wgEnableUploads          = true;

§  Also, to enable thumbnails, follow instructions above forphp, then set this to true:

$wgUseImageResize         = true;

[edit]change the root password of the MySQLinstance!

Use the command line or DBTools.

[edit]Fix the script error

If you are getting "Undefined indexREQUEST_URI" error messages try this: This problem is a PHP for Windowsproblem. You should replace all references to the REQUEST_URI member of the_SERVER array with SCRIPT_NAME. The name of the same variable is differentbetween the Windows and UNIX versions of PHP.

Thus:

 Old: $_SERVER['REQUEST_URI']

Change to:

 New: $_SERVER['SCRIPT_NAME']

I have seen this within:

§  "includes/Setup.php", lines 90, 96, 97

§  "includes/WebRequest.php", line 284

§  "includes/Skin.php" line 574

§  "includes/GlobalFunctions.php", line 232

§  "includes/wiki.php", line 388

§  "index.php", line 228

§  "includes/HttpFunctions.php", line 33(MediaWiki 1.7.1)

Remark: You can also add $_SERVER['REQUEST_URI'] =$_SERVER['SCRIPT_NAME']; to LocalSettings.php

However, $_SERVER['SCRIPT_NAME'] isn't always equal to$_SERVER['REQUEST_URI'], especially when a rewrite module is employed and/ordirectory names are used instead of default file names. The only way to get100% Apache-compliant $_SERVER['REQUEST_URI'] is to use the ISAPI Filter andsteps listed

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值