|
SquirrelMail 1.4.6 on RedHat Linux 9
Part 1 - Installing SquirrelMail & Configuring the Apache Virtual Host
Written by Tony Bhimani
April 1, 2006
Requirements
RedHat Linux
Apache HTTPD
IMAP Server
PHP with IMAP
SquirrelMail 1.4.6
The SquirrelMail tutorial is the second part of a series I started this
week on installing webmail access on a server. We began with setting up
an IMAP server using Dovecot that provides the back-end and now we conclude
with SquirrelMail being the front-end. This tutorial will teach you how
to install and configure the SquirrelMail 1.4.6 package, set up an Apache
virtual host for your webmai sitel, and verify your installation actually
works. Before you continue you should already have Sendmail or another
SMTP server and Dovecot or another other IMAP server installed and working.
My Sendmail install uses SMTP AUTH to deny relaying abuse and that will
play a part later on when configuring SquirrelMail. Dovecot should be
configured as an IMAP server and not necessarily utilizing SSL/TLS. In
Part 1 we'll download and install SquirrelMail and configure Apache for
the webmail site.
At the time of this writing the latest stable version of SquirrelMail
is 1.4.6 which is available at http://www.squirrelmail.org/.
Once again the target operating system is RedHat 9. I know it's kind of
dated and I promise one of these days I'll use a more up-to-date OS. We'll
start by downloading the SquirrelMail package.
Make sure you're logged in as root and are in your home directory. Start
by downloading the SquirrelMail gzip file using wget.
wget http://easynews.dl.sourceforge.net/sourceforge/squirrelmail/squirrelmail-1.4.6.tar.gz

Using tar we'll unzip the package and then move into the squirrelmail-1.4.6
directory that was extracted.
tar zxf squirrelmail-1.4.6.tar.gz
cd squirrelmail-1.4.6

SquirrelMail comes with a text-based configuration utility that makes
creating the config file. We'll do the SquirrelMail configuration in the
second part of this guide. Next we're going to set up an Apache virtual
host for our webmail site. We're going to create some directories, move
the SquirrelMail files to the document root, move the data folder outside
the document root, and change ownership of the data folder to the apache
user (or whatever user your httpd process runs as). I chose to install
SquirrelMail in /home in a directory called squirrelmail. You may want
to put it somewhere else like in /var or /var/www. It's up to you.
cd /home
mkdir squirrelmail
cd squirrelmail
mkdir html
mkdir html/cgi-bin
mkdir logs
mv /root/squirrelmail/* ./html/
mv html/data/ ./sqdata
chown -R apache.apache sqdata

Let me explain the structure. The html directory is the document root
of the webmail site. We also create a cgi-bin directory for our own purposes
(not SquirrelMail) if we ever need it in the future. A logs directory
is created for our web server logs. The contents of the extracted squirrelmail
tar.gz is moved to the html directory. We then move the data directory
from html to /home/squirrelmail/sqdata - thus renaming it. It's not a
requirement to rename it, it's merely so we know it's SquirrelMail data
(your address book, preferences, signature and other files are stored
there). We then recursively change ownership of sqdata to the apache user
& group. SquirrelMail will need to be able to write to this directory
and our httpd process runs as apache. Typically httpd runs as apache by
default if you installed via RPM's. If you didn't change it in httpd.conf
then yours should be the same.
Next we'll configure an Apache virtual host for our webmail site. If
this is the first time you're configuring Apache then you'll have to edit
two lines (ServerName and NameVirtualHost) located in /etc/httpd/conf/httpd.conf.
Use your machine's IP address for both of these directives.
ServerName 192.168.1.110
NameVirtualHost 192.168.1.110:80
Open /etc/httpd/conf/httpd.conf with an editor like vi or pico and scroll
all the way to the end of the file. We'll add our new VirtualHost there.
vi /etc/httpd/conf/httpd.conf
<VirtualHost 192.168.1.110:80>
ServerAdmin admin@domain.com
ServerName 192.168.1.110
DocumentRoot /home/squirrelmail/html
ScriptAlias /cgi-bin/ /home/squirrelmail/html/cgi-bin/
ErrorLog /home/squirrelmail/logs/error_log
CustomLog /home/squirrelmail/logs/access_log combined
</VirtualHost>

We created a name based virtual host and will listen on port 80. We use
six directives to configure our site (ServerAdmin, ServerName, DocumentRoot,
ScriptAlias, ErrorLog, and CustomLog).
- ServerAdmin specifies the email address of the administrator
(that's you).
- ServerName is the IP address or FQDN of your site.
I used an IP for this example but you'll want to use something like
webmail.yourdomain.com. Be sure to add whatever host you use
to your DNS zone file otherwise your webmail site won't be accessible.
Read my BIND
tutorial for more information on adding a new host.
- DocumentRoot is the path to your HTML files or otherwise
known as your web site root.
- ScriptAlias is used to create a cgi-bin for executable
CGI/Perl scripts. It's mapped to http://host.yourdomain.com/cgi-bin/.
- ErrorLog defines the name of your web server error
file for this site. Any 404, 500, and other HTTP or PHP errors will
be written to this file.
- CustomLog creates a log of people that access your
web site. At the end we use combined to tell Apache to use the combined
format for log file entries. If you wanted to use a web server log analysis
program like Awstats to
parse your logs for HTML report creation then using the combined
format is ideal.
Save your changes and exit your editor. We have to tell Apache to reload
httpd.conf and this can be accomplished by restarting the httpd process
(or using graceful).
/etc/init.d/httpd restart

That's it for getting your webmail site up. The next phase will be configuring
SquirrelMail.
|
[ 1 ]
[ 2 ]
[ 3 ]
[ Next Page ]
|
This page has been viewed 14,234 times |
|