]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - doc/INSTALL.MacOSX
Fxed typo in "nice" url example, added theme info to Apache alias settings. Minor...
[SourceForge/phpwiki.git] / doc / INSTALL.MacOSX
1
2 Using PhpWiki 1.3 with Mac OS X / Darwin
3
4 PhpWiki works quite well and retains almost complete functionality
5 when used with a default installation of Mac OS X 10.1 (or greater),
6 with only a few minor exceptions as noted below. Setting up a database
7 for the Wiki backend is probably the most difficult part of the
8 PhpWiki installation as it will require use of the Terminal utility;
9 therefore it is recommended that you at least have some familiarity
10 with the unix command prompt. However, the setup is straightforward
11 and you should be able to complete the install by following the
12 instructions in the INSTALL document included with the PhpWiki
13 download.
14
15 If you intend to compile the required database software or PHP module
16 yourself you should download and install the Developer tools from
17 Apple, which includes the necessary cc compiler, and at least
18 temporarily activate the superuser (root) account. The steps necessary
19 to do this are relatively more complicated and are beyond the scope of
20 this document.
21
22 In any case you may find Project Builder to be an attractive
23 alternative to TextEdit, especially if you are intent on heavily
24 customizing PhpWiki, working with PHP or doing any other code
25 development. Among other niceties it provides multiple undos (even
26 beyond the last file save), line numbering and syntax coloring;
27 however it doesn't always properly handle coloring for strangely
28 nested \"escaped quotes\" which are frequently called for in PHP when
29 generating HTML code.  \\" <--(kludge for broken syntax coloring)
30
31 Instructions for using Project Builder with PhpWiki can be found at
32 the bottom of this document.
33
34
35 Database
36 --------
37
38 A suitable database for PhpWiki is not included with Mac OS X 10.1. If
39 you decide to use one of the more popular (and free) database packages
40 such as mySQL or PostgreSQL with PhpWiki, fortunately there are
41 precompiled versions of the software available. Some distributions
42 even come with Mac OS X installers which will significantly reduce the
43 amount of work you will have to do in the unix environment.
44
45 The MySQL 3.23.46 binary installation works well with Mac OS X 10.1
46 and PhpWiki. After you install and test mySQL follow the instructions
47 given in INSTALL.mysql to prepare a new database for use with PhpWiki.
48
49
50 Apache PHP Module
51 -----------------
52
53 The default PHP module for Apache as supplied by Apple does work with
54 PhpWiki but is missing support for the zlib and GD libraries. Wiki
55 will still produce a valid ZIP file when an administrator saves a ZIP
56 dump of the database but it will not use any compression.
57
58 If you want compressed ZIP dumps you will have to install a version of
59 PHP which does support the zlib library, or compile PHP yourself and
60 replace the default /usr/libexec/httpd/libphp4.so (part of the
61 Apple-supplied Apache installation).
62
63 PHP with GD library support is required to use "text2png", an
64 experimental plugin for Wiki 1.3.
65
66 PhpWiki 1.3 already knows where to find the required PEAR.php on Mac
67 OS X systems. However if you need to use PEAR with other PHP
68 applications, edit or create the file /usr/local/lib/php.ini then add
69 the following line:
70
71 include_path = ".:/System/Library/PHP";
72
73 If you compiled a version of PHP yourself (perhaps newer than the
74 4.0.6 version included by Apple) the path will already be included in
75 the php.ini file. In that case you shouldn't have to change the path,
76 unless you installed PHP into a location other than the default
77 /usr/local/ prefix.
78
79
80 Obtaining and Installing mySQL and libphp4.so
81 ---------------------------------------------
82
83 Mark Liyanage has graciously provided precompiled Mac OS X versions of
84 mySQL, an updated PHP module for Apache and some installation
85 instructions on his web site. He has also written some tips if you
86 want to compile these programs for yourself.
87
88     <http://www.entropy.ch/software/macosx/>
89
90 Note that whether you use the built-in PHP module or another PHP
91 module, it must be activated in Apache's httpd.conf before you can use
92 PHP. Take a look at Mark's PHP installation instructions or read the
93 Apache documentation for more information.
94
95 A good place to find other distributions of mySQL or PostgreSQL which
96 can be used with Mac OS X are listed at:
97
98     <http://versiontracker.com/macosx/>
99
100
101 PHP 4.1 and Mac OS X
102 --------------------
103
104 The version of PHP 4.1 from Mark Liyanage's web site requires an
105 updated PEAR library. PhpWiki seems to work anyway but it will produce
106 warnings about a depreciated user function with each page load.
107
108 1.  Move the current contents of '/System/Library/PHP' into a backup
109     folder, such as '/System/Library/PHP/PEAR-4.0.6'.
110
111 2.  Take the contents of the 'pear' folder from the official PHP 4.1
112     tarball (php-4.1.0.tar.gz) and move it into '/System/Library/PHP'.
113
114 A precompiled PHP 4.1 module for Apache and the PearDB support files
115 are also available at:
116
117     <http://homepage.mac.com/carstenklapp/>
118
119
120 PhpWiki Configuration Notes
121 ---------------------------
122
123 Move the phpwiki folder into the directory used by the web server. In
124 Mac OS X 10.1 this folder will be "/Library/WebServer/Documents"
125 (unless you previously changed it to somewhere else in the config file
126 "/private/etc/httpd/httpd.conf").
127
128 Follow the generalized installation instructions described in INSTALL
129 but with the changes to sections 1 and 2 listed below.
130
131 Section 1
132
133 The Mac OS X Apache web server runs as user "www" and this works fine
134 with PhpWiki so long as "Everyone" has at least read-only access in
135 the phpwiki folder's Get Info.
136
137 If you want to perform serial dumps instead of ZIP dumps you need to
138 set at least one directory to be accessible read-write by the http
139 server. The easiest solution is probably to create a new folder called
140 "dumps" inside the phpwiki folder, then give the user "www" read-write
141 access to it in the terminal:
142
143 sudo chown www:www /System/Library/phpwiki/dumps
144 sudo chmod u+wrx /System/Library/phpwiki/dumps
145
146 Section 2
147
148 A few lines need to be inserted into Apache's configuration in order
149 to use "nice" URLs with PhpWiki such as:
150
151     "http://somehost/wiki/GoodStyle"
152
153 Open the terminal and type in the following to edit the web server
154 configuration file (enter your administration password when prompted):
155
156 sudo pico /etc/httpd/httpd.conf
157
158 Scroll down to the <IfModule mod-alias.c> section. Copy the comment
159 line "#PhpWiki 1.3 aliases" and the four lines below it, then paste it
160 into the mod_alias section as shown below.
161
162 <IfModule mod_alias.c>
163
164     #
165     # Note that if you include a trailing / on fakename then the server will
166     # require it to be present in the URL.  So "/icons" isn't aliased in this
167     # example, only "/icons/".  If the fakename is slash-terminated, then the 
168     # realname must also be slash terminated, and if the fakename omits the 
169     # trailing slash, the realname must also omit it.
170     #
171     Alias /icons/ "/usr/share/httpd/icons/"
172
173 #PhpWiki 1.3 aliases
174     Alias /wiki/images/ "/Library/WebServer/Documents/phpwiki/images/"
175     Alias /wiki/images "/Library/WebServer/Documents/phpwiki/images"
176     Alias /wiki/themes/ "/Library/WebServer/Documents/phpwiki/themes/"
177     Alias /wiki/themes "/Library/WebServer/Documents/phpwiki/themes"
178     Alias /wiki/ "/Library/WebServer/Documents/phpwiki/index.php/"
179     Alias /wiki "/Library/WebServer/Documents/phpwiki/index.php"
180
181
182 To save your changes and exit, press 'control-x', then 'y' followed by
183 the 'return' key.
184
185 Restart the Web Sharing server from the System Preferences "Sharing"
186 control panel or from the terminal:
187
188 sudo apachectl graceful
189
190 Next, edit the following lines in part five of index.php to match the
191 following:
192
193 define('DATA_PATH', '/wiki');
194 define('USE_PATH_INFO', true);
195 define('VIRTUAL_PATH', '/wiki');
196
197 Section 3
198
199 To retain your PhpWiki logs between system restarts you should specify
200 a non-temporary directory. I recommend you use the same folder where
201 the web-server stores it's logs. Change the following (line 73) in
202 index.php from:
203
204 define('ACCESS_LOG', '/tmp/wiki_access_log');
205
206 to something like:
207
208 define('ACCESS_LOG', '/private/var/log/httpd/wiki_access.log');
209
210 Note that the automatic /etc/daily and weekly cron cleanup routines
211 will not touch the Wiki log file--even if it is in the same directory
212 as the httpd logs--it will be up to you to Trash it once in a while or
213 write your own /etc/daily.local file to include it as part of a server
214 log rotation.
215
216
217 Using Apple's Project Builder with PhpWiki
218 ------------------------------------------
219
220 A PB project file is available on the SourceForge CVS server to allow
221 you to easily edit PhpWiki's source code using Apple's Project
222 Builder. If you have not yet updated to PB 1.1.1 (Dec 2001 DevTools)
223 it is highly recommended you do so because the PhpWiki source are
224 written in ISO-8859-1, and some of the bug fixes are pertinent to file
225 encoding.
226
227 PB 1.1 has some bugs which makes it impossible to select the correct
228 character encoding in the GUI for any pre-existing source code
229 files. By using this project file you will find the PhpWiki source
230 files are already preset to use the correct ISO-8859-1 (Western
231 Latin-1) encoding.
232
233 Also by using this file, if you are updating or adding a tranlastion
234 to the './phpwiki/locale/po/' files, you do not have to run 'make'
235 from the terminal window. The Build Target settings have been
236 preconfigured to automatically build the project with a "legacy
237 Makefile", by invoking '/usr/bin/gnumake' in the folder
238 './phpwiki/locale'. Just click the build button in the toolbar.
239
240 To download the phpwiki.pbxproj bundle, use CVS to checkout the module
241 named "phpwiki.pbxproj" then place it into the same folder which
242 contains your "phpwiki" folder.
243
244
245 How to use SSH with Project Builder
246 -----------------------------------
247
248 Project Builder 1.1.1 (December 2001 Dev Tools) can be used with
249 SourceForge's CVS but a little work is needed to get it set up the
250 first time. The following instructions were based on a tip from
251 macosxhints.com.
252
253 Preparation
254
255 Make sure that your ssh keys have been uploaded to your account at
256 SourceForge and that you can sucessfully ssh into your account. Next,
257 ensure that you can check out your project from SourceForge using the
258 unix command-line based CVS tools provided by Mac OS X.
259
260 Instructions
261
262 1.  Download and install "keychain" from:
263
264     <http://www.gentoo.org/projects/keychain.html>
265
266 The Keychain script acts as a front-end to ssh-agent, allowing you to
267 easily have one long-running ssh-agent process per system, rather than
268 per login session. This dramatically reduces the number of times you
269 need to enter your passphrase, from once per new terminal window
270 session to once every time your local machine is rebooted. It also
271 allows you to use Project Builder with SSH instead of RSH. SSH is
272 required if you want to commit files to a CVS repository at
273 SourceForge.
274
275 2.  If you use the default tcsh shell or csh, add the following to your
276     .cshrc file:
277
278 setenv CVS_RSH 'ssh'
279 # Keychain is an OpenSSH key manager
280 # This will add my SSH1 and SSH2 key
281 /usr/bin/keychain ~/.ssh/id_rsa ~/.ssh/id_dsa
282 source ~/.ssh-agent-csh-${HOST}
283 # Alias to servers via SSH
284 alias sshsf 'ssh mysfuserid@phpwiki.sourceforge.net'
285
286     If you use bash instead, add following lines to the .bashrc file:
287
288 CVS_RSH=ssh; EXPORT CVS_RSH
289 # Keychain is an OpenSSH key manager
290 # This will add my SSH1 and SSH2 key
291 /usr/bin/keychain ~/.ssh/id_rsa ~/.ssh/id_dsa
292 source ~/.ssh-agent-${HOSTNAME}
293 alias sshsf='ssh mysfuserid@phpwiki.sourceforge.net'
294
295 3.  Close the terminal window then open a new one. Keychain will
296     activate ssh-agent which will ask for your ssh key password. It
297     keeps running in the background and won't ask for your password
298     again until you log out or restart.
299
300 4.  From now on, YOU MUST open Project Builder from the Terminal shell
301     for it's CVS to work with SSH. This is why we created a command
302     alias in .cshrc to launch Project Builder. If it is already
303     running because you double-clicked the PB icon, quit it, then
304     launch it from the terminal by typing pb. <em>Once PB is running
305     you can safely double-click a project file to open it</em>.
306
307 Using the above method, ProjectBuilder will successfully connect to
308 the Sourceforge CVS with SSH. Any other server which requires cvs
309 connections to be made cia ssh instead of rsh should now work too.
310
311 Note: Renaming /usr/bin/rsh to something else and replacing it with
312       ssh doesn't seem to work; Project Builder simply MUST be
313       launched from the command line for it to work at all with ssh.
314
315 Hopefully Project Builder's integrated CVS will be improved in the
316 future to directly support SSH. To let Apple know that full support
317 for SSH in Project Builder is important, send an email to:
318
319       <macosx-tools-feedback@group.apple.com>
320
321
322 Emacs Key Bindings for Project Builder
323 --------------------------------------
324
325 Emacs Users: You can add custom Alt-key bindings to Project Builder
326 for some common Emacs stuff: *Note the wrapped url!
327
328 <http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/
329 ProgrammingTopics/TextDisplay/Tasks/TextDefaultsAndBindings.html>
330
331
332 If you have problems after all of this, try contacting the
333 phpwiki-talk list at phpwiki-talk@lists.sourceforge.net.
334
335 Carsten Klapp
336 carstenklapp@mac.com
337
338 $Id: INSTALL.MacOSX,v 1.12 2002-01-01 22:57:34 carstenklapp Exp $