| 1 |
alpine.tar.z web/INSTALL |
| 2 |
/* ======================================================================== |
| 3 |
* Copyright 2006-2008 University of Washington |
| 4 |
* |
| 5 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 |
* you may not use this file except in compliance with the License. |
| 7 |
* You may obtain a copy of the License at |
| 8 |
* |
| 9 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 10 |
* |
| 11 |
* ======================================================================== |
| 12 |
*/ |
| 13 |
|
| 14 |
|
| 15 |
BUILDING AND INSTALLING WEB ALPINE |
| 16 |
---------------------------------- |
| 17 |
|
| 18 |
This file provides brief instructions for building, installing and |
| 19 |
configuring the Web Alpine application |
| 20 |
|
| 21 |
Web Alpine's binary components are built along with the other Alpine |
| 22 |
Mail System components. If the build process completed, that is the |
| 23 |
commands ./configure and make completed without error, then you are |
| 24 |
nearly good to go. |
| 25 |
|
| 26 |
Unlike the other Alpine components, however, Web Alpine does not use |
| 27 |
the "make install" method of installation. Between the various Web |
| 28 |
Alpine pieces, web site layout and web server configuration, |
| 29 |
variability and administrative preference is too great to be reliably |
| 30 |
automated at this time. |
| 31 |
|
| 32 |
For more information on the how's and why's of Web Alpine consult the |
| 33 |
somewhat more technically complete treatment in |
| 34 |
web/cgi/alpine/help/tech-notes.html. |
| 35 |
|
| 36 |
At some point online FAQs and such may be available. If you find |
| 37 |
anything missing, incomplete, or otherwise unclear please send a note |
| 38 |
to <[email protected]>. |
| 39 |
|
| 40 |
|
| 41 |
WEB ALPINE LAYOUT |
| 42 |
----------------- |
| 43 |
|
| 44 |
The Web Alpine package is distributed as part of the Alpine Mail System. |
| 45 |
The source for the various components can be found in the "web/" |
| 46 |
directory arranged, for the most part, by function. |
| 47 |
|
| 48 |
src/ |
| 49 |
alpined.d/ |
| 50 |
source for Web Alpine's binary components: the |
| 51 |
per-user/per-session serverette and the small library used for |
| 52 |
inter-tcl script communication. |
| 53 |
|
| 54 |
pubcookie/ |
| 55 |
sources for various components required to provide |
| 56 |
pubcookie web-login support |
| 57 |
|
| 58 |
cgi.tcl-1.10/ |
| 59 |
Tcl library used to help coordinate web page generation |
| 60 |
|
| 61 |
cgi/ |
| 62 |
CGI scripts used to generate Web Alpine pages, typically synonymous |
| 63 |
with the web server's document root. It, in turn, contains: |
| 64 |
|
| 65 |
alpine/ |
| 66 |
Meat and potatoes of the Web Alpine Application. |
| 67 |
|
| 68 |
alpine-2.0/ |
| 69 |
Meat and potatoes of the Web Alpine 2.0 Application |
| 70 |
|
| 71 |
session/ |
| 72 |
Alpine session management scripts used to login, establish |
| 73 |
an alpine session, logout and acquire IMAP server credentials |
| 74 |
as needed. These scripts are distinct from the alpine/ |
| 75 |
scripts in order to properly scope the session key. |
| 76 |
|
| 77 |
images/ |
| 78 |
Various images and icons |
| 79 |
|
| 80 |
pub/ |
| 81 |
Scripts that are accessed outside the scope of the Web Alpine |
| 82 |
session key. |
| 83 |
|
| 84 |
sounds/ |
| 85 |
Sounds files that might be referenced by Web Alpine |
| 86 |
|
| 87 |
config/ |
| 88 |
general Web Alpine and default host configurations |
| 89 |
|
| 90 |
bin/ |
| 91 |
binary executables providing services to the CGI scripts |
| 92 |
|
| 93 |
lib/ |
| 94 |
binary and script routines used by both CGI scripts |
| 95 |
and binary utilities |
| 96 |
|
| 97 |
For a more thorough discussion of the distribution's layout and |
| 98 |
Web Alpine components see cgi/alpine/help/tech-notes.html. |
| 99 |
|
| 100 |
|
| 101 |
BUILDING WEB ALPINE'S BINARY COMPONENTS |
| 102 |
--------------------------------------- |
| 103 |
|
| 104 |
For the most part, Web Alpine's binary components were built |
| 105 |
automatically along with the rest of the Alpine Mail System. |
| 106 |
|
| 107 |
If configure reports that it could not locate suitable TCL libraries |
| 108 |
and header files, then it is likely that the components necessary for |
| 109 |
Web Alpine were not built. Locating and installing a TCL development |
| 110 |
environment appropriate for your system should get the build back on |
| 111 |
track. Note, even though a tclsh interpreter may be available on the |
| 112 |
command line, tools necessary to build TCL applications may need to be |
| 113 |
installed separately. |
| 114 |
|
| 115 |
If you plan to use UW pubcookie for browser-based network login, |
| 116 |
please review src/pubcookie/README. Be sure the Web Alpine Mail |
| 117 |
System was configured with the "--with-pubcookie" AND --with-web-bin= |
| 118 |
options set. The latter is set to the directory that will eventually |
| 119 |
contain Web Alpine's binary components. For the example system |
| 120 |
described in the next section, you would add: |
| 121 |
|
| 122 |
--with-pubcookie --with-web-bin=/usr/local/libexec/alpine/bin |
| 123 |
|
| 124 |
to the configure script's command line. |
| 125 |
|
| 126 |
|
| 127 |
ACQUIRING EXTERNAL LIBRARIES |
| 128 |
---------------------------- |
| 129 |
|
| 130 |
Web Alpine 2.0 makes heavy use of the functionality provided by the |
| 131 |
The Yahoo! User Interface Library (YUI). By default, Web Alpine is |
| 132 |
configured to generate pages that cause user's browser to request the |
| 133 |
necessary library files directly from Yahoo servers. |
| 134 |
|
| 135 |
Web Alpine can be easily configured to generate pages with references |
| 136 |
to a local copy of the YUI libraries. |
| 137 |
|
| 138 |
First, you will need to download the YUI libararies from: |
| 139 |
|
| 140 |
http://developer.yahoo.com/yui/download/ |
| 141 |
|
| 142 |
They are made available to Web Alpine 2.0 scripts thru the symbolic |
| 143 |
link: |
| 144 |
|
| 145 |
web/cgi/alpine-2.0/lib/yui |
| 146 |
|
| 147 |
Simply install the downloaded library in the directory specified by |
| 148 |
the symbolic link, or change the link to refer to the intalled |
| 149 |
location. |
| 150 |
|
| 151 |
Second, you will need to change the _wp(yui) configuration setting |
| 152 |
in |
| 153 |
|
| 154 |
web/config/alpine.tcl |
| 155 |
|
| 156 |
to reference the new location. |
| 157 |
|
| 158 |
|
| 159 |
INSTALLING WEB ALPINE COMPONENTS |
| 160 |
-------------------------------- |
| 161 |
|
| 162 |
Unfortunately, due to the variety of web server requirements and |
| 163 |
configurations, Web Alpine installation must be done by hand and |
| 164 |
requires several steps. To illustrate the procedure, a generic Fedora |
| 165 |
Core 8 system with standard httpd package installed is used as an |
| 166 |
example. On other systems, the general ideas are the same but the |
| 167 |
specific file locations and server configuration settings will likely |
| 168 |
vary. Note also that your system may have an additional security |
| 169 |
layer installed, such as selinux, that may require extra configuration |
| 170 |
that is beyond the scope of this explanation. |
| 171 |
|
| 172 |
The first step is to build and configure the tools Web Alpine needs to |
| 173 |
generate pages and access mail data. The following commands will put |
| 174 |
those tools where they need to be within the web/ directory structure. |
| 175 |
|
| 176 |
1. % cd web/src |
| 177 |
|
| 178 |
2. % make |
| 179 |
|
| 180 |
3. % make install |
| 181 |
|
| 182 |
Second, the web/ directory tree needs to be made available to the web |
| 183 |
server. On the example system, start by moving the web/ directory |
| 184 |
tree into a more system-visible location. We'll also change the name |
| 185 |
to reflect the current version number (for this example, 1.00) to help |
| 186 |
keep future upgrades isolated. This command will likely require |
| 187 |
elevated privileges using either sudo or after becoming root. |
| 188 |
|
| 189 |
4. % cd ../.. |
| 190 |
|
| 191 |
5. % sudo mv web /usr/local/libexec/alpine-2.00 |
| 192 |
|
| 193 |
Next, for simplicity, create a generically named symbolic link as a |
| 194 |
synonym for the version-specific directory. |
| 195 |
|
| 196 |
6. % cd /usr/local/libexec |
| 197 |
|
| 198 |
7. % sudo ln -s alpine-2.00 alpine |
| 199 |
|
| 200 |
After that, make the scripts that actually generate the user visible |
| 201 |
portion of Web Alpine available to the web server. |
| 202 |
|
| 203 |
8. % cd /var/www |
| 204 |
|
| 205 |
9. % sudo ln -s /usr/local/libexec/alpine/cgi ./alpine |
| 206 |
|
| 207 |
Now adjust the web server's configuration so that it can effectively |
| 208 |
provide Web Alpine pages to connecting browsers by editing httpd's |
| 209 |
configuration file. |
| 210 |
|
| 211 |
10. % sudo vi /etc/httpd/conf/httpd.conf |
| 212 |
|
| 213 |
After the section that starts with <Directory /var/www/html> and ends |
| 214 |
with </Directory>, add the lines: |
| 215 |
|
| 216 |
# |
| 217 |
# This sets up Web Alpine |
| 218 |
# |
| 219 |
<Directory "/var/www/alpine"> |
| 220 |
Options FollowSymLinks ExecCGI -Indexes |
| 221 |
AllowOverride All |
| 222 |
Order allow,deny |
| 223 |
Allow from all |
| 224 |
</Directory> |
| 225 |
|
| 226 |
If you intend for your web server to provide Web Alpine pages |
| 227 |
exclusively, then simply edit the DocumentRoot to the directory |
| 228 |
defined above: |
| 229 |
|
| 230 |
DocumentRoot /var/www/alpine |
| 231 |
|
| 232 |
If your web server offers pages other than Web Alpine, specify a |
| 233 |
prefix the web server should use for referencing Web Alpine pages by |
| 234 |
adding this line before the <Directory> entry specified above: |
| 235 |
|
| 236 |
Alias /webmail/ "/var/www/alpine/" |
| 237 |
|
| 238 |
After saving httpd.conf with these small additions, it's time to |
| 239 |
adjust Web Alpine's configuration. |
| 240 |
|
| 241 |
First, be sure the symbolic link "/usr/local/libexec/alpine/bin/tclsh" |
| 242 |
points to the tclsh interpreter for your system. The default should |
| 243 |
work for the example system. |
| 244 |
|
| 245 |
Then edit the Web Alpine configuration file to configure appropriate |
| 246 |
settings for your environment. |
| 247 |
|
| 248 |
11. % sudo vi /usr/local/libexec/alpine/config/alpine.tcl |
| 249 |
|
| 250 |
The config file is itself a Tcl script, and the settings are |
| 251 |
simply Tcl variable settings. Most are settings of elements |
| 252 |
within the "_wp" array. |
| 253 |
|
| 254 |
Starting from the top, skim the various configuration |
| 255 |
settings. The primary one's to be aware of include: |
| 256 |
|
| 257 |
admin email address offered in error pages |
| 258 |
associated with problems that likely |
| 259 |
require system administrator attention |
| 260 |
|
| 261 |
helpdesk email address offered in help pages and |
| 262 |
some error pages as a place to report |
| 263 |
problems or get more information |
| 264 |
|
| 265 |
comments email address offered in help pages |
| 266 |
as place to send general comments on |
| 267 |
web alpine |
| 268 |
|
| 269 |
urlprefix directory or path defined in the httpd.conf's |
| 270 |
"Alias" setting. In example above, set this to |
| 271 |
"webmail". If DocumentRoot set as above, set this |
| 272 |
to {}. |
| 273 |
|
| 274 |
fileroot file system path to directory that contains cgi/, |
| 275 |
config/, bin/, and lib/ directories. In example |
| 276 |
above, set this to /usr/local/libexec/alpine. |
| 277 |
|
| 278 |
Continue scanning the list, and adjust as needed. Most defaults |
| 279 |
should be fine. Until you come to: |
| 280 |
|
| 281 |
ispell full path to ispell application if installed |
| 282 |
|
| 283 |
ssl_safe_domains |
| 284 |
a performance setting that allows for relatively |
| 285 |
safe disabling of SSL for connections that we know |
| 286 |
are reasonably safe from sniffing. For our campus |
| 287 |
web alpine installation, browsers associated with the |
| 288 |
campus dial-in pools connecting to our servers |
| 289 |
offer this kind of connection. Be careful. |
| 290 |
|
| 291 |
flexserver |
| 292 |
determines whether or not web alpine offers the option |
| 293 |
of connecting to a user-defined IMAP server on |
| 294 |
the greeting page. |
| 295 |
|
| 296 |
hosts an array of default configurations that |
| 297 |
correspond to default web alpine config files |
| 298 |
in the config/ directory. these are what |
| 299 |
is offered on the greeting page as the option |
| 300 |
list of servers to connect to. |
| 301 |
|
| 302 |
And, probably lastly: |
| 303 |
|
| 304 |
cgi_mail_relay |
| 305 |
the server used to send out script errors that are |
| 306 |
so heinous that no web page error could be generated |
| 307 |
|
| 308 |
|
| 309 |
The final step is to restart httpd and give it a try! Using a browser |
| 310 |
pointed to your server's https port, try connecting to the alpine/ |
| 311 |
directory. |
| 312 |
|
| 313 |
If you run into problems, rest assured you have our sympathies. |
| 314 |
Because of the various components that must be coordinated, errors can |
| 315 |
be difficult to resolve. The good news is, once initially configured |
| 316 |
and working the system is reasonably stable. As for debugging, with |
| 317 |
luck, the error response reported in the browser will point in a |
| 318 |
useful direction. If not, check httpd access and error logs to verify |
| 319 |
paths and check for exceptional conditions. Next, check syslog's |
| 320 |
maillog for any exceptional reports issued by the alpined serverette. |
| 321 |
Depending on the type of error, you may also have to consult the IMAP |
| 322 |
server's logs for clues. |
| 323 |
|
| 324 |
|
| 325 |
COLLECTED GOTCHAS AND SO FORTH |
| 326 |
------------------------------ |
| 327 |
|
| 328 |
First, it is strongly encourage that Web Alpine be run on a web server |
| 329 |
that does not have general user accounts. The primary reason is to |
| 330 |
maintain the privacy of the Web Alpine session key. Steps are taken |
| 331 |
to minimize the risk and consequences of session key exposure, but |
| 332 |
there are risks nonetheless. |
| 333 |
|
| 334 |
For the most part, the default Web Alpine application settings should |
| 335 |
require little adjustment for your particular environment. These |
| 336 |
settings are in the web/config/pine.conf file which uses the same |
| 337 |
format as alpine's pinerc file. The most likely setting to adjust is |
| 338 |
"smtp-server." |
| 339 |
|
| 340 |
By default, Web Alpine sends via SMTP to the localhost's SMTP port. |
| 341 |
This setting can easily be adjusted by setting the smtp-server in |
| 342 |
web/config/pine.conf to one or more external servers. Web Alpine can |
| 343 |
also be directed to post to a local process by setting the |
| 344 |
sendmail-path variable. Be aware, however, posting to a local process |
| 345 |
(e.g., sendmail, postfix, etc), will likely require you to grant |
| 346 |
trusted mail user privilege to the userid associated with the web |
| 347 |
server process. Without such privilege, the SMTP envelope From will |
| 348 |
be set to the web server's userid which causes all externally bounced |
| 349 |
mail to be returned to the mailbox associated with the web server |
| 350 |
userid. |
| 351 |
|
| 352 |
|
| 353 |
FURTHER INFORMATION |
| 354 |
------------------- |
| 355 |
|
| 356 |
See the Web Alpine technical notes for more detailed descriptions of |
| 357 |
what's going on and why. If you have any questions or comments drop |
| 358 |
us a note <[email protected]>. |
| 359 |
|