added a bunch of patches from the patch manager
[squirrelmail.git] / INSTALL
CommitLineData
d68a3926 1Installing SquirrelMail
2=======================
3
3b3d853f 4Table 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
17cec454 141. CONFIGURE YOUR WEBSERVER TO WORK WITH PHP4
15---------------------------------------------
f8f9bed9 16
17cec454 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).
9b57e848 22
17cec454 23a. Obtaining and compiling PHP4
f8f9bed9 24
17cec454 25 Point your favorite webserver at http://www.php.net/version4/ and
26 download the source. Untar (tar xvfz filename-you-downloaded.tgz)
27 the source, cd into the directory and run configure. To make PHP4
28 work with SquirrelMail a commandline like this should do:
f8f9bed9 29
17cec454 30 ./configure --enable-track-vars --enable-force-cgi-redirect --with-gettext
f8ba9180 31
17cec454 32 If you have a database like MySQL you might want to add something
33 like --with-mysql to get database functionality.
34
45c0a3a3 35 If you're going to use LDAP in the addressbook, you must compile PHP4
36 with --with-ldap (see the PHP4 docs for more information).
37
17cec454 38 Run make to build the binary file. This will generate a binary file
39 called "php". Move this file into a CGI-directory.
40
41 You might also want to read the INSTALL file in the PHP-distribution
42 :-)
43
2a32fc83 44b. Changing php.ini
45
46 PHP defaults to look for php.ini (PHP's configuration file) in
47 /usr/local/lib. However, for security reasons, it is suggested
48 that the location of this file is changed to someplace else. This
49 can be done at configure time with the configuration directive
50 --with-config-file-path=PATH.
51
a167feaf 52 Edit the php.ini file and make sure session.use_cookies is 1. Also
53 be sure to change the session.save_path to someplace that can only
54 be read and written to by the webserver. session.save_path is the
2a32fc83 55 location that PHP's session data will be written to.
56
a167feaf 57 SECURITY WARNING - If a user has access to write PHP scripts on your
58 system and knows the location where PHP stores session data, he
59 could get a listing of the sessions being used and then read a given
60 session's data with his own PHP script. Caution should be used when
61 setting up permissions and locations of php.ini and the session data.
2a32fc83 62
63c. Setting up .php files to use PHP4
17cec454 64
65 You need to create a .htaccess file in you SquirrelMail directory
66 that looks something like this:
67
68 AddType application/php4script .php
69 Action application/php4script /cgi-bin/php
70
71 You could also add these lines to your Apache configuration file.
72
2a32fc83 73d. Running into trouble
17cec454 74
75 Setting up Apache with PHP4 can be a non-trivial task. Read the PHP4
76 and Apache documentation carefully if you run into trouble. If you
77 have an experienced system administrator around ask her/him to help
78 you.
79
802. SETTING UP IMAP
81------------------
82
83 This is not covered here :-/
84
853. OBTAINING AND INSTALLING SQUIRRELMAIL
86----------------------------------------
87
88 SquirrelMail is still under development. Therefore you should always
89 get the newest version around. Look at
429f8906 90 http://www.squirrelmail.org/index.php3?page=5 to see what it
17cec454 91 is. If you want to be bleeding edge you might want to consider using
92 the latest CVS version (with the latest and most fashionable of
93 bugs).
94
95a. Download SquirrelMail
96
97 Get SquirrelMail from the address above if you do not have it or are
98 uncertain if you have the newest version. Untar (again tar xvfz
99 filename.tgz) SquirrelMail in a directory that is readable for your
100 webserver.
101
102b. Setting up directories
103
104 SquirrelMail uses two directories to store user configuration and
105 attachments that are about to be sent. You might want to have these
106 directories outside of your web tree.
107
108 The data directory is used for storing user preferences, like
109 signature, name and theme. When unpacking the sources this directory
110 is created as data/ in you SquirrelMail directory. This directory
111 must be writable by the webserver. If your webserver is running as
112 the user nobody you can fix this by running:
65b14f90 113
390372b4 114 $ chown -R nobody data
115 $ chgrp -R nobody data
17cec454 116
117 There also needs to be a directory where attachments are stored
118 before they are sent. Since personal mail is stored in this
119 directory you might want to be a bit careful about how you set it
120 up. It should be owned by another user than the webserver is running
121 as (root might be a good choice) and the webserver should have write
122 and execute permissions on the directory, but should not have read
123 permissions. You could do this by running these commands (still
124 granted that the webserver is running as nobody/nobody)
125
390372b4 126 $ cd /var/some/place
127 $ mkdir SomeDirectory
128 $ chgrp -R nobody SomeDirectory
129 $ chmod 730 SomeDirectory
17cec454 130
131 If you trust all the users on you system not to read mail they are
132 not supposed to read change the last line to chmod 777 SomeDirectory
390372b4 133 or simply use /tmp as you attachments directory.
134
135 If a user is aborting a mail but has uploaded som attachments to it
136 the files will be lying around in this directory forever if you do not
137 remove them. To fix this, it is recommended to create a cron job that
138 deletes everything in the attachment directory. Something similar
139 to the folling will be good enough:
140
141 $ cd /var/attach/directory
142 $ rm -f *
17cec454 143
144c. Setting up SquirrelMail
145
be8e07f8 146 There are two ways to configure Squirrelmail. In the config/ directory,
147 there is a perl script called conf.pl that will aid you in the
390372b4 148 configuration process. This is the recommended way of handling
be8e07f8 149 the config.
150
390372b4 151 You can also copy the config/config_default.php file to config/config.php
be8e07f8 152 and edit that manually.
65b14f90 153
17cec454 1544. RUNNING SQUIRRELMAIL
155-----------------------
65b14f90 156
429f8906 157 Point your browser at the URL at which SquirrelMail is installed. A
158 possible example of this is:
159 http://www.yourdomain.com/squirrelmail
160
161 It should be pretty stright forward to use. Some more documentation
162 might show up one day or another.
8c086db6 163
164
1655. RUSSIAN CHARSETS
166-------------------
167
168 For information on how to make SquirrelMail work with Russian
169 Apache, see the README.russian_apache in the doc/ subdirectory.