NOTE: Please make sure you have a working SMTP server and IMAP server because there are chances if your IMAP server is not up and running properly you will receive error at the end of the configuration.
To install squirrel mail you will need to download the tar file.
here is a link where you can find one
http://squirrelmail.org/download.php
make a directory inside /var/www/
# mkdir /var/www/mail
and unzip the file tar file inside this directory. You can use this command for that
you might also need php and php-imap to install PHP supports for Apache/IMAP.
# yum -y install php php-imap
# cd /var/www/mail
Now make one symlink for the squirrelmail.x.x.x
# ln -s squirrelmail.x.x.x/ mail
you can check the symlinks
# ls -l
Now just edit your apache configuration file with the virtual host entry
# vi /etc/httpd/conf/httpd.conf
(at the end of the file)
<VirtualHost 192.x.x.x:80>
ServerAdmin mail@server.example.com
DocumentRoot /var/www/mail/
<Directory /var/www/mail>
Options FollowSymlinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Here server is the name of your machine and example.com is the domain name so change as per your machine hostname and domain name.
IP used is your machine's IP.
Restart the apache server
# service httpd restart
# cd /var/www/mail/mail/config/
# ./config.pl
And follow the instructions to edit your squirrelmail as per your requirements.
You also might need to Create 'attach' and 'data' directories for SquirrelMail:
# mkdir /var/local/squirrelmail/{data,attach}
(if you go for default settings)
Change the ownership of both these files to apache
# chown -R apache:apache /var/local/squirrelmail/
Go to the browser and mention the ip of your machine
you will get the login page and try logging with one of your self created user