We don't support PHP 4.0.x anymore; update the docs to reflect that and
[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
17cec454 121. CONFIGURE YOUR WEBSERVER TO WORK WITH PHP4
13---------------------------------------------
f8f9bed9 14
17cec454 15 If your webserver does not already have PHP4 you must configure it
16 to work with PHP4. SquirrelMail uses the standard suffix .php for
17 all PHP4 files. This is a quick and dirty guide to installing PHP4
18 to run as CGI under Apache. How you end up doing this is up to you
19 (your mileage may vary).
9b57e848 20
abd74f7d 21 You will need at least PHP v4.1.0. If you need to upgrade please go
8905fa13 22 ahead and install it now.
eb0a8c50 23
17cec454 24a. Obtaining and compiling PHP4
f11c804f 25
e9c378fe 26 SquirrelMail has not been extensively tested for use with PHP 4.3.x.
27 See the ReleaseNotes file.
f8f9bed9 28
60090c1c 29 Point your favorite web browser at http://www.php.net/downloads.php/ and
17cec454 30 download the source. Untar (tar xvfz filename-you-downloaded.tgz)
31 the source, cd into the directory and run configure. To make PHP4
32 work with SquirrelMail a commandline like this should do:
f8f9bed9 33
17cec454 34 ./configure --enable-track-vars --enable-force-cgi-redirect --with-gettext
f8ba9180 35
17cec454 36 If you have a database like MySQL you might want to add something
37 like --with-mysql to get database functionality.
38
45c0a3a3 39 If you're going to use LDAP in the addressbook, you must compile PHP4
40 with --with-ldap (see the PHP4 docs for more information).
41
17cec454 42 Run make to build the binary file. This will generate a binary file
43 called "php". Move this file into a CGI-directory.
44
45 You might also want to read the INSTALL file in the PHP-distribution
46 :-)
47
2a32fc83 48b. Changing php.ini
49
50 PHP defaults to look for php.ini (PHP's configuration file) in
51 /usr/local/lib. However, for security reasons, it is suggested
52 that the location of this file is changed to someplace else. This
53 can be done at configure time with the configuration directive
54 --with-config-file-path=PATH.
55
a167feaf 56 Edit the php.ini file and make sure session.use_cookies is 1. Also
57 be sure to change the session.save_path to someplace that can only
58 be read and written to by the webserver. session.save_path is the
2a32fc83 59 location that PHP's session data will be written to.
60
a167feaf 61 SECURITY WARNING - If a user has access to write PHP scripts on your
62 system and knows the location where PHP stores session data, he
63 could get a listing of the sessions being used and then read a given
64 session's data with his own PHP script. Caution should be used when
65 setting up permissions and locations of php.ini and the session data.
2a32fc83 66
76911253 67 FILE UPLOADS - Note that sending attachments will not work if your
1067414d 68 "file_uploads" setting is "Off". Squirrelmail requires that setting
76911253 69 enabled in order to be able to attach files.
1067414d 70
2a32fc83 71c. Setting up .php files to use PHP4
17cec454 72
73 You need to create a .htaccess file in you SquirrelMail directory
74 that looks something like this:
75
76 AddType application/php4script .php
77 Action application/php4script /cgi-bin/php
78
79 You could also add these lines to your Apache configuration file.
80
2a32fc83 81d. Running into trouble
17cec454 82
83 Setting up Apache with PHP4 can be a non-trivial task. Read the PHP4
84 and Apache documentation carefully if you run into trouble. If you
85 have an experienced system administrator around ask her/him to help
86 you.
87
882. SETTING UP IMAP
89------------------
90
91 This is not covered here :-/
92
933. OBTAINING AND INSTALLING SQUIRRELMAIL
94----------------------------------------
95
ef1932a4 96 SquirrelMail is constantly being improved. Therefore you should always
97 get the newest version around. Look at http://www.squirrelmail.org/
98 to see what it is. If you want to be bleeding edge you might want to
99 consider using the latest CVS version (with the latest and most
100 fashionable of bugs).
17cec454 101
102a. Download SquirrelMail
103
104 Get SquirrelMail from the address above if you do not have it or are
105 uncertain if you have the newest version. Untar (again tar xvfz
106 filename.tgz) SquirrelMail in a directory that is readable for your
107 webserver.
108
109b. Setting up directories
110
111 SquirrelMail uses two directories to store user configuration and
112 attachments that are about to be sent. You might want to have these
113 directories outside of your web tree.
114
115 The data directory is used for storing user preferences, like
116 signature, name and theme. When unpacking the sources this directory
b731cd83 117 is created as data/ in your SquirrelMail directory. This directory
17cec454 118 must be writable by the webserver. If your webserver is running as
b731cd83 119 the user "nobody" you can fix this by running:
65b14f90 120
390372b4 121 $ chown -R nobody data
122 $ chgrp -R nobody data
4bc627ae 123
124 Keep in mind that with different installations, the web server could
ff65039a 125 typically run as userid/groupid of nobody/nobody, nobody/nogroup,
126 apache/apache or www-data/www-data. The best way to find out is to read
127 the web server's configuration file.
4bc627ae 128
17cec454 129 There also needs to be a directory where attachments are stored
130 before they are sent. Since personal mail is stored in this
131 directory you might want to be a bit careful about how you set it
132 up. It should be owned by another user than the webserver is running
133 as (root might be a good choice) and the webserver should have write
134 and execute permissions on the directory, but should not have read
135 permissions. You could do this by running these commands (still
136 granted that the webserver is running as nobody/nobody)
137
390372b4 138 $ cd /var/some/place
139 $ mkdir SomeDirectory
140 $ chgrp -R nobody SomeDirectory
141 $ chmod 730 SomeDirectory
17cec454 142
143 If you trust all the users on you system not to read mail they are
144 not supposed to read change the last line to chmod 777 SomeDirectory
390372b4 145 or simply use /tmp as you attachments directory.
146
4bc627ae 147 If a user is aborting a mail but has uploaded some attachments to it
390372b4 148 the files will be lying around in this directory forever if you do not
149 remove them. To fix this, it is recommended to create a cron job that
150 deletes everything in the attachment directory. Something similar
4bc627ae 151 to the following will be good enough:
390372b4 152
153 $ cd /var/attach/directory
154 $ rm -f *
4bc627ae 155
156 However, this will delete attachments that are currently in use by people
157 sending email when the cron job runs. You can either (1) make sure that
158 the cron job runs at an obscure hour and hope that nobody gets upset, or
159 (2) you can run a modified version of the commands above. Check out the
160 man pages for other commands such as 'find' or 'tmpreaper'.
161
162 One sample script you could set up that would erase all attachments, but
163 wouldn't erase preferences, address books, or the like (just in case your
164 attachment directory is the same as your data directory) might look like
165 this:
166
167 $ rm `find /var/attach/directory -atime +2 | grep -v "\." | grep -v _`
168
169 Remember to be careful with whatever method you do use, and to test out
170 the command before it potentially wipes out everyone's preferences.
17cec454 171
172c. Setting up SquirrelMail
173
cbd6543c 174 There are two ways to configure SquirrelMail. In the config/ directory,
be8e07f8 175 there is a perl script called conf.pl that will aid you in the
390372b4 176 configuration process. This is the recommended way of handling
be8e07f8 177 the config.
178
390372b4 179 You can also copy the config/config_default.php file to config/config.php
be8e07f8 180 and edit that manually.
65b14f90 181
cbd6543c 182 After you've created a configuration, you can use your webbrowser to
13721b47 183 browse to http://your-squirrelmail-location/src/configtest.php.
cbd6543c 184 This will perform some basic checks on your config to make sure
185 everything works like it should.
186
187
17cec454 1884. RUNNING SQUIRRELMAIL
189-----------------------
65b14f90 190
429f8906 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
3d8fe250 195 It should be pretty straight forward to use. Some more documentation
429f8906 196 might show up one day or another.
8c086db6 197
198
1995. 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.
2481e3c1 204
2056. TRANSLATIONS
206---------------
207
208 In order to use translated versions of SquirrelMail, you need
209 to download and install locale packages that contain translations
210 that you want to use with squirrelmail.
211
212 Locale packages can be downloaded from SquirrelMail SourceForge
213 project page.
214
215 http://sourceforge.net/project/showfiles.php?group_id=311&package_id=110388
216
217 Each translation contains install script that copies required files
218 into appropriate locations. If you can't run that script, you can extract
219 contents of translation packages into your squirrelmail directory.
220
221 NOTE No.1: *-src.tar.gz, *-src.tar.bz2 and *-src.zip archives does not contain
222 compiled translation files. You will need to run compilelocales script
223 in order to get all gettext binary translations.
224
225 NOTE No.2: You might need to restart your webserver before using translations.
226 If you can't do that, install your translations _before_ you use SquirrelMail.