[svn-inject] Installing original source of suphp
[manu/suphp.git] / doc / en / apache / INSTALL
1 ===========================
2 == suPHP Apache module   ==
3 ===========================
4
5 Installation
6 ------------
7
8 1. Introduction
9
10 The suPHP Apache module together with suPHP itself provides an easy way to
11 run PHP scripts with different users on the same server.
12
13 It provides security, because the PHP scripts are not run with the rights of
14 the webserver's user.
15 In addition to that you probably won't have to use PHP's "safe mode", which
16 applies many restrictions on the scripts.
17
18 Please be sure to have read the README file in this directory and both the
19 README and the INSTALL file in the main directory of the suPHP distribution.
20
21
22 2. The simple facts
23
24 In this part, I'll give the most important information for people who know
25 how to compile the Apache Server with additional modules.
26 If you aren't familiar with doing this, you'll find a step-by-step guide in
27 the third part of this manual.
28
29 mod_suphp only consists of one file, called "mod_suphp.c".
30 If the suphp binary is not in the default path (/usr/sbin/suphp) you'll have
31 to modify the corresponding line in mod_suphp.c before adding it to your
32 Apache sources with the "configure" script of Apache.
33  
34 The easiest way to install mod_suphp is to compile it as a dynamically
35 loadable module (DSO). If your Apache was compiled with DSO support and
36 "apxs" is either in your path or you specified the path to it when running
37 "configure", mod_suphp will automatically be compiled when doing "make" and
38 installed to your Apache server (when doing "make install").
39
40 Information on how to configure mod_suphp can be found in the "CONFIG" file
41 in this directory.
42
43 Please note that mod_suphp was developped for Apache 1.3.2x and Apache
44 2.0.x. It might not work with other version.
45
46 suPHP was developped for Linux, perhaps it'll also work with some other
47 *NIX-systems. I have heard that there is a suPHP port for FreeBSD, however
48 as I do not have running FreeBSD on any system at the moment I cannot test
49 which modifications have to be made to the current version to run it on
50 suPHP. If you know, tell me and a will try to modify the GNU autoconf
51 scripts to make decisions automatically.
52
53 If you have tested it with another system and it works, please tell me.
54
55
56 3. Step-by-step guide
57
58 If you have already running Apache with mod_so (DSO-support), mod_suphp
59 should have been installed to your Apache server automatically.
60
61 It it is not working look for the two lines
62  LoadModule suphp_module       /usr/lib/httpd/mod_suphp.so
63 and
64  AddModule mod_suphp.c
65 in your "httpd.conf".
66
67 Sometimes "apxs" adds this lines at the wrong locations. In this case you
68 will have to move them to the appropriate position (see the Apache
69 documentation for details).
70
71 To compile Apache from scratch with mod_suphp (statically) proceed with the 
72 following steps:
73
74 If necessary change the path to the suPHP executable in "mod_suphp.c".
75
76 Get the Apache sources from http://www.apache.org and unpack them.
77 Now go into the newly created directory. And run "./configure --help" which
78 will output some really useful information about the configure-script.
79
80 Now run the configure script with the parameters that match your needs but
81 add the option "--add-module=/path/to/mod_suphp.c".
82
83 This will copy mod_suphp.c to the Apache sources and activate it.
84
85 Now you can "make" Apache and install it using "make install".
86
87 Please note that suPHP will probably not work if you also compile in mod_php.
88
89 To use suPHP to parse PHP-Files the only thing you have to is to add a line
90 like
91
92 AddHandler x-httpd-php .php
93
94 to your Apache configuration and to activate mod_suphp for the appropriate
95 VHosts.
96
97 You can turn mod_suphp on by adding the line
98
99 suPHP_Engine on
100
101 to your global Apache-configuration.
102 This will activate mod_suphp for all VirtualHosts.
103
104 Information about additional options can be found in the "CONFIG"-Readme.
105
106 4. Additional information
107
108 Please note, that mod_suphp in most cases will *NOT* work, when mod_php is 
109 installed and used in your Apache server because both use the same mime type
110 "x-httpd-php". I have heard of users concurrently running both, but it is
111 probably trivial to do so. Therefore I will not answer any questions on how
112 to run both mod_php and mod_suphp concurrently.
113
114
115 ===================================
116 (c)2002-2004 by Sebastian Marsching
117 <sebastian@marsching.com>
118 Please see LICENSE for
119 additional information