The logout_above_text hook was misplaced. Got it back where it should be.
[squirrelmail.git] / INSTALL
1 Installing SquirrelMail
2 =======================
3
4 Table of Contents:
5 1. (PHP4) Configure your webserver to work with PHP4
6 2. (IMAP) Setting up IMAP (not covered)
7 3. (INSTALL) Obtaining and installing SquirrelMail
8 4. (RUN) Running SquirrelMail
9 5. (CHARSETS) Russian Charsets
10
11
12
13
14 1. CONFIGURE YOUR WEBSERVER TO WORK WITH PHP4
15 ---------------------------------------------
16
17 If your webserver does not already have PHP4 you must configure it
18 to work with PHP4. SquirrelMail uses the standard suffix .php for
19 all PHP4 files. This is a quick and dirty guide to installing PHP4
20 to run as CGI under Apache. How you end up doing this is up to you
21 (your mileage may vary).
22
23 NOTE: The new plugin architecture required the use of some functions
24 which are not in all versions of PHP4. You will need at least
25 PHP4 v4.0.4. If you need to upgrade please go ahead and install the
26 latest release version of PHP4.
27
28 a. Obtaining and compiling PHP4
29
30 SquirrelMail has not been tested for use with PHP 4.3.x. The
31 development team does not recommend the use of this software with
32 PHP 4.3.x until further testing can be done.
33
34 Point your favorite webserver at http://www.php.net/version4/ and
35 download the source. Untar (tar xvfz filename-you-downloaded.tgz)
36 the source, cd into the directory and run configure. To make PHP4
37 work with SquirrelMail a commandline like this should do:
38
39 ./configure --enable-track-vars --enable-force-cgi-redirect --with-gettext
40
41 If you have a database like MySQL you might want to add something
42 like --with-mysql to get database functionality.
43
44 If you're going to use LDAP in the addressbook, you must compile PHP4
45 with --with-ldap (see the PHP4 docs for more information).
46
47 Run make to build the binary file. This will generate a binary file
48 called "php". Move this file into a CGI-directory.
49
50 You might also want to read the INSTALL file in the PHP-distribution
51 :-)
52
53 b. Changing php.ini
54
55 PHP defaults to look for php.ini (PHP's configuration file) in
56 /usr/local/lib. However, for security reasons, it is suggested
57 that the location of this file is changed to someplace else. This
58 can be done at configure time with the configuration directive
59 --with-config-file-path=PATH.
60
61 Edit the php.ini file and make sure session.use_cookies is 1. Also
62 be sure to change the session.save_path to someplace that can only
63 be read and written to by the webserver. session.save_path is the
64 location that PHP's session data will be written to.
65
66 SECURITY WARNING - If a user has access to write PHP scripts on your
67 system and knows the location where PHP stores session data, he
68 could get a listing of the sessions being used and then read a given
69 session's data with his own PHP script. Caution should be used when
70 setting up permissions and locations of php.ini and the session data.
71
72 FILE UPLOADS - Note that sending attachments will not work if your
73 "file_uploads" setting is "Off". Squirrelmail requires that setting
74 enabled in order to be able to attach files.
75
76 c. Setting up .php files to use PHP4
77
78 You need to create a .htaccess file in you SquirrelMail directory
79 that looks something like this:
80
81 AddType application/php4script .php
82 Action application/php4script /cgi-bin/php
83
84 You could also add these lines to your Apache configuration file.
85
86 d. Running into trouble
87
88 Setting up Apache with PHP4 can be a non-trivial task. Read the PHP4
89 and Apache documentation carefully if you run into trouble. If you
90 have an experienced system administrator around ask her/him to help
91 you.
92
93 2. SETTING UP IMAP
94 ------------------
95
96 This is not covered here :-/
97
98 3. OBTAINING AND INSTALLING SQUIRRELMAIL
99 ----------------------------------------
100
101 SquirrelMail is still under development. Therefore you should always
102 get the newest version around. Look at
103 http://www.squirrelmail.org/index.php3?page=5 to see what it
104 is. If you want to be bleeding edge you might want to consider using
105 the latest CVS version (with the latest and most fashionable of
106 bugs).
107
108 a. Download SquirrelMail
109
110 Get SquirrelMail from the address above if you do not have it or are
111 uncertain if you have the newest version. Untar (again tar xvfz
112 filename.tgz) SquirrelMail in a directory that is readable for your
113 webserver.
114
115 b. Setting up directories
116
117 SquirrelMail uses two directories to store user configuration and
118 attachments that are about to be sent. You might want to have these
119 directories outside of your web tree.
120
121 The data directory is used for storing user preferences, like
122 signature, name and theme. When unpacking the sources this directory
123 is created as data/ in your SquirrelMail directory. This directory
124 must be writable by the webserver. If your webserver is running as
125 the user "nobody" you can fix this by running:
126
127 $ chown -R nobody data
128 $ chgrp -R nobody data
129
130 Keep in mind that with different installations, the web server could
131 typically run as userid/groupid of nobody/nobody, nobody/nogroup,
132 apache/apache or www-data/www-data. The best way to find out is to read
133 the web server's configuration file.
134
135 There also needs to be a directory where attachments are stored
136 before they are sent. Since personal mail is stored in this
137 directory you might want to be a bit careful about how you set it
138 up. It should be owned by another user than the webserver is running
139 as (root might be a good choice) and the webserver should have write
140 and execute permissions on the directory, but should not have read
141 permissions. You could do this by running these commands (still
142 granted that the webserver is running as nobody/nobody)
143
144 $ cd /var/some/place
145 $ mkdir SomeDirectory
146 $ chgrp -R nobody SomeDirectory
147 $ chmod 730 SomeDirectory
148
149 If you trust all the users on you system not to read mail they are
150 not supposed to read change the last line to chmod 777 SomeDirectory
151 or simply use /tmp as you attachments directory.
152
153 If a user is aborting a mail but has uploaded some attachments to it
154 the files will be lying around in this directory forever if you do not
155 remove them. To fix this, it is recommended to create a cron job that
156 deletes everything in the attachment directory. Something similar
157 to the following will be good enough:
158
159 $ cd /var/attach/directory
160 $ rm -f *
161
162 However, this will delete attachments that are currently in use by people
163 sending email when the cron job runs. You can either (1) make sure that
164 the cron job runs at an obscure hour and hope that nobody gets upset, or
165 (2) you can run a modified version of the commands above. Check out the
166 man pages for other commands such as 'find' or 'tmpreaper'.
167
168 One sample script you could set up that would erase all attachments, but
169 wouldn't erase preferences, address books, or the like (just in case your
170 attachment directory is the same as your data directory) might look like
171 this:
172
173 $ rm `find /var/attach/directory -atime +2 | grep -v "\." | grep -v _`
174
175 Remember to be careful with whatever method you do use, and to test out
176 the command before it potentially wipes out everyone's preferences.
177
178 c. Setting up SquirrelMail
179
180 There are two ways to configure Squirrelmail. In the config/ directory,
181 there is a perl script called conf.pl that will aid you in the
182 configuration process. This is the recommended way of handling
183 the config.
184
185 You can also copy the config/config_default.php file to config/config.php
186 and edit that manually.
187
188 4. RUNNING SQUIRRELMAIL
189 -----------------------
190
191 Point your browser at the URL at which SquirrelMail is installed. A
192 possible example of this is:
193 http://www.yourdomain.com/squirrelmail
194
195 It should be pretty straight forward to use. Some more documentation
196 might show up one day or another.
197
198
199 5. RUSSIAN CHARSETS
200 -------------------
201
202 For information on how to make SquirrelMail work with Russian
203 Apache, see the README.russian_apache in the doc/ subdirectory.