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