Manual:Installation on Uniform Server (Windows)/yue

WAMP 系統之中，用Uniform Server，我地可以嚮 10 分鐘之內（如果練習過，又揀啱好日）、load 落兩份總共 7MB 嘅快佬就嚮各款 Windows 入面裝、設、行到一架wiki同埋佢所需嘅web同埋database伺服機.

套程式同資料庫，裝好校好都唔夠 21MB，所以放得落一塊 32MB memory card、32MB USB flash drive、PCMCIA/PC Card/CardBus 碟、LS-120 SuperDisk 或者第啲 portable media. 有咁樣一架 私伙維基都幾有用，可以用來示範、筆記、或者用份 simple copy 來超快安裝. 記住：掹支記憶出來之前一定要撳system tray 粒 "unplug/eject" 掣來停咗樣 media ！

For an alternate, possibly simpler, way to do this on a Windows system, see Manual:Wiki on a stick with WOS (Webserver on Stick).

步/Procedure
呢套步驟安裝 用來嚮 Windows 行 MediaWiki 嘅主要部份. 開波之前，睇咗先；如果你有問題，去睇下.

第種做法/Alternate Approach
You can use WOS Portable from CH Software instead of Uniform Server. WOS Portable does not need an extra drive letter and it is ready to run instantly after unzipping. It is published under the GNU GPL. You can get it from http://www.chsoftware.net/en/useware/wos/wos.htm. (See Manual:Wiki on a stick with WOS (Webserver on Stick) for instructions.)

安裝伺服機/Install the servers

 * Run . This is a self-extracting compressed file that contains the Apache and MySQL server files for the wiki.  During the extraction you will be asked for a destination folder.  Click the browse button and find the storage device you want to use for the wiki.

The extraction creates a folder called " ". This folder contains a sub-folder called " ", which is the top of the folder tree that will become a drive letter. You can rename " " if the name offends you. Do not rename " " unless you want to spend a lot of time changing the references to that directory.

Edit two text files to configure the servers
Edit the config file for the Apache server by following these steps:
 * 1) If it is not already there, create a sub-folder under   called " ".
 * 2) Open the file   in a text editor (such as WordPad).
 * 3) Search for " " and change   to  .  The lower number of threads is better for testing.
 * 4) Search for " " and change it to " " - this restricts access to the local computer. You will also see the local computer called the " " in some of these instructions.
 * 5) Save and close this file

Edit the config file for the MySQL server by following these steps:
 * 1) Open a text editor, such as Notepad, and set the file type to show all files. Open   .  If you try to find the file the usual way to double-click and open it, Windows Explorer shows this file as a shortcut named   and will not open it in the text editor.  If you have problems opening this file, try dragging the my-small icon into an open text editor window.
 * 2) Search for " ".  Insert one line under " " and type this text onto that line:
 * 3) Save and close this file

裝 MediaWiki程式
Mediawiki is a compressed file that can be uncompressed by most "Zip" utilities. One free Windows tool to uncompress zip files is 7-zip. There exists a command line version for linux called p7zip.

If you use WinZip, you must turn off the "TAR file smart CR/LF conversion" (look under Options|Configuration|Miscellaneous), to prevent corruption of the configuration file. Also be sure that the "Use Folder Names" option is selected.

Depending on the decompression tool, you may need to do a second decompression for the  file that is inside the   file. Look in the folder after the first decompression: if all you see is the  file, uncompress it.


 * 1) Uncompress the MediaWiki zip file into the sub-folder.
 * 2) Unpacking creates a sub-folder called " ", where "x.y.z" is the version number of the wiki software.  This folder will contain your wiki.  The folder name is part of the URL for the wiki.
 * 3) These instructions use the folder name " ". It is easier to follow the instructions if you rename " " to " " until you have the wiki working.  Then you can rename the folder to whatever you want.

校架維基
The installation at this point is 39 MB. How do you reduce the size of the installation? One option is to check the MediaWiki languages subdirectory, which is about 4.25Mb. You can get it down to 150Kb by deleting all of the Language??.php and Messages??.php files you're not using (but don't delete LanguageUtf8.php). This still only gets the installation down to 35 MB. It is not explained sufficiently in the article how to get it down to the 21 MB.

畀個 drive letter
Windows uses drive letters, not names. Most systems will have a C: drive, and may have a D: and E: or even more. Any hard drives, CD/DVD drives and USB storage devices will have their drive letter automatically assigned. The Wiki "server-start.bat" file sends a command to Windows that makes Windows act as if the Wiki directories on the memory stick are on a hard drive of their own.

These instructions use "w" as the drive letter. To make sure this is a valid drive letter, look at "My Computer" and see which letters have been assigned to local and network hard drives. In the example below, a typical Windows installation, drives C, D, and E are assigned.



NB: If the drive letter is changed from "w", the Uniform Server administration configuration file must also be updated, or the Admin Panel won't be accessible. Search for " " and specify the correct drive letter.

改 Uniform Server start-up script （可以唔做）
The script used to start the Uniform Server has the following syntax:

Comments:
 * If no drive letter is specified, &quot;w&quot; is used by default.
 * Specifying &quot; &quot; as the second argument will make MySQL start automatically.
 * Specifying &quot; &quot; as the third argument will leave the console window open after the servers have been started.

In order to remove the need for supplying command line arguments to the start-up script, it can be modified as follows:


 * 1) Open   in a text editor
 * 2) Find this line:
 * 3) Replace   with   to set &quot;k&quot; as the default drive.
 * 4) Find the line starting with:
 * 5) Remove the IF statement, leaving only
 * 6) Save and close the file

整捷徑同埋停個伺服器/Creating shortcuts for starting and stopping the servers

 * Right-click on	Server_Start.bat and drag it to your desktop. Select &quot;Create Shortcuts Here&quot;.  Label the shortcut &quot;Start Wiki Servers&quot;
 * Right-click on	stop.bat and drag it to your desktop. Select &quot;Create Shortcuts Here&quot;.  Label the shortcut &quot;Stop Wiki Servers&quot;

開着架維基伺服器/Starting the Wiki Servers
 Doubleclick the &quot;Start Wiki Servers&quot; shortcut icon to start the servers. This starts the 	servers' admin page in your web browser. You may get an error the first time due to timing. Click OK on any error messages. A refresh should confirm the server is running.If you see a blue screen that resembles this, the Apache server is working.

Successful server start.

 Run MySQL on the left side of the Uniform Server window

整好啲維基變量/Configuring the Wiki Variables
 With your browser, open this file by typing or pasting this URL: http://localhost/wi/config/index.php  Fill in the variables on that page.</P> </OL> <OL> <OL> <UL> The warning about register_globals can be ignored. You will fix it in the next step.</P> If you use lower case for the first letter of the site name, it will be capitalised on most of the wiki pages.</P> Leave &quot;MySQL server&quot; as localhost</P> Set &quot;DB root password&quot; to <I>root</I> (Yes, it's BAD from a security standpoint, but it won't work with a proper password) the name has also to be set to root</P> </UL> </OL> </OL> Click the Install button at the bottom of the page. <BR><BR>This writes the file LocalSettings.php and creates the <I>wikidb</I> database, with one initial user (<I>WikiSysop</I>). An empty page is displayed.</P> Problems probably MySQL is not running. run \Uniform Server\diskw\usr\local\mysql\mysqlrun.bat

Something wrong here - error message MySQL server localhost "Couldn't connect to database". on the apachel panel page (localhost\apanel) click Start MySQL on the left hand of "Uniform Server" table of contents.

</OL>

Configuring	PHP Variables
As instructed in the web page, move the file named  from   up one level to

Optional wiki features
These can also be configured later.

Before editing configuration files:
 * Stop the servers: in the Uniserver folder, click
 * Make backup copies of the configuration files

Uploads
Uploads are disabled by default. To enable them: Uploads will then go into the directory  by default.
 * 1) Open   in any text editor (e.g. notepad)
 * 2) Find " ", and remove the " " in front of it (you may need to change "false" to "true")
 * 3) Save and close the file

'''Problems: Try uncommenting $wgDisableUploads (Line 66)

Email
If you do not have a SMTP server running on the local computer, pages that generate email will display an error. To use another SMTP server:
 * 1) Get the name or IP address of the SMTP server on your LAN or at your ISP
 * 2) Open   in any text editor (e.g. notepad)
 * 3) Change the line " " to use the actual SMTP server instead of " ".
 * 4) Optionally change the line " " to use an actual email address instead of " " for receiving bounces from inter-user email
 * 5) Save and close the file

Default skin
To set a different default skin:
 * 1) Open   in any text editor (e.g. notepad)
 * 2) Find " ", and remove the " " in front of it, and change " " to " " (or " " or " ") &mdash; see
 * 3) Save and close the file

Other default user settings
Other default user settings can be changed in:
 * if using English and you wish to allow users to choose their date preferences, add the line
 * search for the array  which can be modified (for other option names that can be added to the array, see the array  )
 * search for the array  which can be modified (for other option names that can be added to the array, see the array  )
 * search for the array  which can be modified (for other option names that can be added to the array, see the array  )

Performance
Performance can be improved and memory stick life extended by adding some of these lines to : If a hard disk drive is being used for the storage instead of a memory stick, also add:

Tidy up

 * 1) Start the servers again:
 * 2) (Everything should now be working, but the following steps can be done immediately.)
 * 3) In your webbrowser, open
 * 4) Login as
 * 5) In your webbrowser, open
 * 6) Edit the sub-title (keep it short)
 * 7) Press the "Save" button. (The sub-title is shown in the Cologne Blue skin, but not in the Classic or Nostalgia skins.)
 * 8) In your webbrowser, open
 * 9) Type (or copy & paste):
 * 10) Press the "Save" button
 * 11) In your webbrowser, open
 * 12) Type (or copy & paste):
 * 13) Press the "Save" button
 * 14) If you didn't choose GFDL as the license during wiki configuration, open
 * 15) Edit the page to match the license
 * 16) Press the "Save" button

Other pages to edit soon
These empty pages are already linked to from other pages in various skins, so you should edit them soon.


 * Pages in the default namespace:
 * 
 * 


 * Pages in your site's namespace (these are listed in Special:Allmessages where you see  ):
 * (linked from Special:Statistics)
 * (linked from Special:Preferences) &mdash; could redirect to m:Help:Preferences
 * (linked from Special:Preferences) &mdash; could redirect to m:Help:Preferences
 * (linked from Special:Preferences) &mdash; could redirect to m:Help:Preferences
 * (linked from Special:Preferences) &mdash; could redirect to m:Help:Preferences
 * (linked from Special:Preferences) &mdash; could redirect to m:Help:Preferences
 * (linked from Special:Preferences) &mdash; could redirect to m:Help:Preferences
 * (linked from Special:Preferences) &mdash; could redirect to m:Help:Preferences
 * (linked from Special:Preferences) &mdash; could redirect to m:Help:Preferences
 * (linked from Special:Preferences) &mdash; could redirect to m:Help:Preferences


 * You may also want to add a "sitename:Sandbox" to assist new users.

Components
See also:

Uniform Server v3.2a
Uniform Server v3.2a is a quick, easy and small installation containing the servers and platform software for MediaWiki. It includes:
 * web-server Apache 2 (v2.0.54)
 * scripting engine PHP 5 (v5.0.4) with libraries (inc. zlib, libxml2, iconv) and extensions (sockets, mysql, GD2)
 * database administration phpMyAdmin (v2.6.3-rc1)
 * databaser server MySQL 4 (v4.1.12a)
 * command scripting ActiveState Perl 5 (v5.8.7.813)

Uniform Server v3.3
Released 2005-12-26, Uniform Server v3.3 "includes the latest versions of Apache2, Perl5, PHP5, MySQL5, phpMyAdmin and ..."

MediaWiki v1.3.7
MediaWiki v1.3.7 is the same wiki software seen here, and consists of PHP web scripts and libraries (including PHPTAL "non-PEAR-users" v0.7.0 and optional memcached v1.0.10 support), and a database schema, data, and interfaces.

要求/Requirements
These are the requirements and related work-arounds for this procedure.

Windows
This procedure may work on any 32-bit/64-bit Windows, but initial testing of this procedure has only been done on Windows 2000 SP4. This procedure has also been tested with success on both Windows XP (Professional Edition) and Windows 98. Testing on Windows XP pro 64-bit edition shows no problems.

Exceptions and any work-arounds are: If you are using USB removable media, Windows 95 needs to be the OSR2 edition, and may need extra drivers.
 * Windows 95 : Ensure that the latest TCP/IP update (winsock2) has been applied.
 * Windows 98 : If you are using USB removable media, extra media drivers may be needed.
 * You may need to comment out the eighth line of the START.BAT file to allow this script to work, especially if you have any instance of the Apache web server installed anywhere on your hard drive(s).


 * Windows NT 4 : Possible server-control problem.

For non-Windows operating systems, see Manual:Installation.

碟空間/Disk space

 * 7MB for the downloads
 * 21MB for the initial installation and configuration
 * Additional space as the wiki database grows with edits and uploads

磁碟字母/Drive letter
This procedure assumes that the drive letter  is unused. Otherwise use a different unused letter where you see the italicised letter.

HTTP TCP port
This procedure assume that the HTTP TCP port (80) is unused. To check, run:

If the output shows  or , you need to either stop the current web server or use a different TCP port in this procedure. See.

無第啲 Apache.exe
If another Apache is installed and running on the same computer, with the exact name "Apache.exe", then:
 * Rename  in the folder   to
 * Change " " to " " inside these files:  (2&times;),   (1&times;),   (1&times;; old version),   (1&times;; new version)

Troubleshooting & support resources

 * These log files may contain clues if errors seem to be happening:
 * PHP can be configured to log errors to the Application event log (but not under Windows 95). Edit  :
 * set " "
 * PHP can be configured to log errors to the Application event log (but not under Windows 95). Edit  :
 * set " "
 * set " "


 * set " "
 * to include "notice"-level logging, set " "
 * MediaWiki can be configured to log errors, by adding lines to.
 * MediaWiki can be configured to profile/trace, by adding lines to.
 * There is a formal user guide
 * There are MediaWiki mailing lists with archives
 * has an IRC channel called  and.
 * Skype will keep Wiki on a stick from starting! Just shutdown Skype.
 * Uniform Server's Support Forum
 * has an IRC channel called  and.
 * Skype will keep Wiki on a stick from starting! Just shutdown Skype.
 * Uniform Server's Support Forum

點樣氹咗架維基重新來過/How to throw away the wiki and start again

 * 1) In your webbrowser, open
 * 2) Click the "Drop" tab to remove the selected wikidb database
 * 3) Click the "<= Uniform Server" link
 * 4) Stop the servers by clicking the "Shutdown the server" link
 * 5) Delete   from the   sub-folder
 * 6) Follow the instructions again from

點樣氹曬佢重新來過/How to throw it all away and start again

 * 1) Stop the servers using
 * 2) Delete the top folder
 * 3) Follow the instructions again from

Software limitations
<tt>CORE_RL_Magick++_.dll</tt> <tt>CORE_RL_bzlib_.dll</tt> <tt>CORE_RL_jbig_.dll</tt> <tt>CORE_RL_jpeg_.dll </tt> <tt>CORE_RL_lcms_.dll</tt> <tt>CORE_RL_libxml_.dll</tt> <tt>CORE_RL_magick_.dll</tt> <tt>CORE_RL_png_.dll</tt> <tt>CORE_RL_tiff_.dll</tt> <tt>CORE_RL_ttf_.dll</tt> <tt>CORE_RL_wand_.dll</tt> <tt>CORE_RL_xlib_.dll</tt> <tt>CORE_RL_zlib_.dll</tt> <tt>X11.dll</tt> <tt>convert.exe</tt>
 * No monobook skin, as MediaWiki automatically disables it due to its included PHPTAL library being incompatible with Uniform Server's included PHP v5 PHPTal is no longer used.
 * No maths markup, due to lack of texvc, LaTeX, dvips, and ImageMagick software
 * Avoid <tt>texvc</tt>. Look at the alternative method of using math without <tt>texvc</tt>. You can use LaTeX, dvips from a Miktex distribution (be sure to copy the dlls into the folder <tt>/usr/bin</tt>)
 * Image resizing may not support certain formats, due to lack of ImageMagick software (but PNG, GIF, JPG, XBM and WBMP formats should be okay).
 * Image resizing may result in ugliness, due to lack of ImageMagick software
 * Download ImageMagick from http://www.imagemagick.org/download/binaries/ImageMagick-6.2.8-0-Q16-windows-dll.exe and install it. From <tt>C:\Program Files\ImageMagick-6.2.8-Q16\</tt> copy the following files to your <tt>/usr/bin</tt> (i.e. <tt>diskw/usr/bin/</tt>). Also set the correct path to <tt>convert.exe</tt> in <tt>LocalSettings.php</tt>
 * Edit conflicts do not automatically merge, due to lack of diff3 software (available from inside )
 * The  folder may gain small " " files, which can be deleted when the servers are stopped

Procedure limitations

 * The servers only run while you are logged-in

Other limitations

 * Running the wiki from portable writable media, while convenient, is slow.
 * Perhaps this limitation can be overcome by running a copy of Wikiwyg.org instead.

保安嘅考慮
The procedure only allows access to the web-server from the local machine. Once this changes, other aspects need to be considered for security.

Wiki security model
... overview & links ...

用者嘅類

 * Anonymous : ...
 * Registered : ... The initial  user has the user rights   and  .  For more information on user rights, see Help:User rights.

維基 access

 * Connecting to the wiki : ...
 * Reading the wiki : ...
 * Becoming a registered user : ...
 * Editing the wiki : ...
 * Special privileges (e.g. deletion) : ...

維基 access 嘅款
Combining the types of user and types of access gives a security policy or access model. Common examples are:

私隠

 * Internet : ... server certificates, caches ...
 * Web browser : ... cookies, cache, history, auto-completion, passwords ...

伺服器
Uniform Server, like all WAMP packages, gets fixed slowly compared to its individual components. This makes these packages a security risk. Do not even think about making these servers accessible from the Internet without extra front-end authentication (e.g. by using a VPN).

... httpd IP address and port, mysql IP address ...

See also: MySQL Manual: 5.4 General Security Issues

一般嘢
... mention firewalls/NAT/packet-filters, passwords, config folder, test database ...

點由第啲電腦駁去架維基
edit these files:

UniServer3_2a\diskw\usr\local\Apache2\conf\httpd.conf:

Listen on the appropriate interfaces: to accept connections from all networks: Listen 80

or to accept connections from localhost and for example 192.168.100.0: Listen 127.0.0.1:80 Listen 192.168.100.0:80

to make self references to your apache work you will have to edit the ServerName entry: put your DNS name there or your IP ServerName 192.168.11.100:80

Give the appropriate rights in your .htaccess files: UniServer3_2a\diskw\www\.htaccess Order Deny,Allow Deny from all Allow from 127.0.0.1 Allow from 192.168.11.0

if there is already a webserver active on port 80 you can switch to another port, for example 81. Then exchange :80 for :81 in Listen and ServerName. additionally you will have to edit the setup of phpmyadmin:

UniServer3_2a\diskw\home\admin\WWW\phpMyAdmin-2.6.3-rc1\config.inc.php $cfg['PmaAbsoluteUri'] = 'http://localhost:81/a/phpMyAdmin-2.6.3-rc1/';

If you want to have access to phpmyadmin from the network you will also have to give access to this directory in the corosponding .htacces file: UniServer3_2a\diskw\home\admin\WWW\.htaccess Order Deny,Allow Deny from all Allow from 127.0.0.1 Allow from 192.168.11.0

幾架維基
Since the mysql-database for the wiki on a stick wiki runs locally, there is no limit on the number of databases which can be stored. To have several independent wikis on the same apache and mysql, just put them in distinct directories below UniServer3_2a\diskw\www and let each run it's install.php routine. Give different database names in the install.php routine. you can share the mysql-wiki user amongst different wikis, but it might be good to give each wiki its own mysql-user.

directory layout (example) UniServer3_2a\diskw\www\TestWiki UniServer3_2a\diskw\www\Wikim\mediawiki-1.4rc1 (for testing) UniServer3_2a\diskw\www\Wikim\Wiki (stable for production)

用一部伺服器、同一資料庫裝幾架維基
Here is how to install the Mediawiki software just once, but use it to power more than one wiki, keeping the tables for all the wikis in a single database-- including step-by-step instructions for a Unix-type of installation. This solution should work for most shared-hosting servers, too. Level of difficulty: Novice. See the instructions on this site.

國際化/Internationalisation
... phpAdmin, multiple wikis ...

牌/Licensing
Despite the variety of licenses, all components can be copied, modified, installed and run for free for private, public or corporate use. Source code is freely available for all binary components. Restrictions may apply if you wish to claim ownership of, sell, or relicense the components. Read the licenses for the actual terms.


 * Uniform Server v3.2a: BSD-revised-style license
 * ActiveState Perl 5.8.7.813: ActiveState Community License
 * Perl 5: choose one of the Artistic License or the GNU General Public License (GPL v2)
 * Apache v2.0.54: Apache License v2.0.
 * MySQL 4.1.12a: GPL v2
 * PHP 5 v5.0.4: PHP License v3.0
 * Zend Engine 2: Zend Engine License v2.00
 * phpAdmin v2.6.3-rc1: GPL v2
 * FPDF v1.51: "freeware" (public domain)
 * PHPFM v0.2.3 (plugin): GPL v2
 * go-pear v1.57 (plugin): choose one version of these PHP Licenses: v2.0 or v3.0
 * blowfish (library): GNU Library General Public License
 * profiling (library): Mozilla Public License (MPL) (the version does not seem to be specified, and could be v1.0 or v1.1)


 * MediaWiki v1.3.7: GPL v2
 * PHPTAL-NP-0.7.0: GNU Lesser General Public License v2.1 (GLGPL or LGPL)
 * pear v1.1: PHP License v2.0

Also, some documentation files may be covered by the GNU Free Documentation License (GFDL) v1.1 or v1.2. Some software library files may be covered by a GLPL: GNU Library General Public License or GNU Lesser General Public License. Some library files do not contain license information, some of which do contain copyright notices and/or attributions.

睇埋

 * Manual:Installation
 * Running MediaWiki on Windows
 * Wiki on a Stick - http://stickwiki.sourceforge.net/ - Open source, self-contained single wiki file (JavaScript, DHTML), currently (2006.05.06) works on Firefox and MS-IE (Alpha).
 * Codev/TWikiForWindowsPersonal - TWiki for Windows on a stick