View Full Version : Squirrelmail
Buickman 04-08-2007, 03:54 PM I did the initial setup found here for postfix, courier, apache, etc;
http://www.howtoforge.com/perfect_setup_ubuntu_6.10
Then I installed squirrelmail found here;
https://help.ubuntu.com/community/Squirrelmail
Everything works so far except squirrelmail. This is what I get when I try to access it through a web browser;
<?php
/**
* index.php
*
* Redirects to the login page.
*
* @copyright © 1999-2006 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: index.php,v 1.14.2.7 2006/02/03 22:27:46 jervfors Exp $
* @package squirrelmail
*/
// Are we configured yet?
if( ! file_exists ( 'config/config.php' ) ) {
echo '<html><body><p><strong>ERROR:</strong> Config file ' .
'"<tt>config/config.php</tt>" not found. You need to ' .
'configure SquirrelMail before you can use it.</p></body></html>';
exit;
}
// If we are, go ahead to the login page.
header('Location: src/login.php');
?>
Just to make sure apache was working, I created a plain web page and it does work;
timbo.homelinux.net
For some reason squirrel mail doesn't seem like it's configured right. Is there a site that breaks down the options? I did go to squirrel mail's homepage, but didn't see anything that could help.
eaux-yeah 04-09-2007, 02:51 PM Then I installed squirrelmail found here;
https://help.ubuntu.com/community/Squirrelmail
Wow, that is a very contrived way to setup Squirrelmail, IMO.
First of all, the error you posted looks like a php display problem. Are you certain you have php installed and configured?
An easy way to test your php setup is to open an editor and create a file with the following in it.
<?php phpinfo() ?>Save that file as something like info.php and place it in your main htdocs directory (or anywhere in your web server path, as long as you can open it in a browser).
That results of that file, when viewed through a browser, should contain a lot of information on your php setup.
If that worked and looks good, in the main Squirrelmail directory, there should be a config directory.
You can create the config.php file manually. 'cd' into the squirrelmail/config directory and run:
./configure Fill in the relevant information and it should create the necessary config.php file.
After everything is done, make sure to delete the info.php file you created, that is information that does not need to be viewed by the public.
Hopefully that will make things go.
eaux-yeah 04-09-2007, 02:56 PM also,
When things are setup and working, go to:
http://server_name/squirrelmail/src/configtest.php (http://%3Ci%3Eserver_name%3C/i%3E)
That is a php script that will parse the config files dealing with the squirrelmail setup and will (should) point out any problems.
Buickman 04-09-2007, 07:25 PM How do I configure php? I found some docs for configuring it with mysql, but not much more than that. I do have php4 and php5 installed. Is that a problem having both of them?
The file you had me create above;
<?php phpinfo() ?>
brought up a web page showing exactly that.
eaux-yeah 04-10-2007, 03:45 PM Ahh hah! PHP no worky.
No need for MySQL to get PHP or Squirrelmail going. Squirrelmail WILL use MySQL for some stuff, though. Deal with that after you get it working.
I would probably just install only one of the php versions. I consider php5 safe pretty safe, now. Squirrelmail just added (6-9 months ago?) php5 support and I have not ran into any problems using php5.
When you install php5 in Ubuntu, I think it only installs the framework (for lack of a better word) and the php libraries.
You need the Apache2 PHP5 modules
sudo apt-get install libapache2-mod-php5That 'should' add what is needed in your apache config files and setup your php.ini file for you. It's easy to add manually, if not.
Restart Apache and see if the info.php file works.
Buickman 04-10-2007, 04:54 PM This is what I got;
sudo apt-get install libapache2-mod-php5
Password:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-php5 is already the newest version.
The following packages were automatically installed and are no longer required:
libburn2 libisofs2
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Apparently I already have it. I did a search of php.ini, and I have 5 of them on my system. Which one does it use?
eaux-yeah 04-10-2007, 07:13 PM Open your /etc/apache2/apache2.conf file.
Find the 2 lines that say:
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php-source .phps
Un-hash (remove the #'s) those 2 lines and save changes.
Next,
sudo cp /usr/share/php5/php.ini-dist /usr/share/php5/php.iniRestart Apache one more time, this one should do it for ya.
eaux-yeah 04-10-2007, 08:02 PM Buickman, my bad. Forget about the:
sudo cp /usr/share/php5/php.ini-dist /usr/share/php5/php.iniI can see that a legit php.ini is already where it needs to be.
It should be in /etc/php5/apache2/php.ini. That is a copy of /usr/share/php5/php.ini-dist
Buickman 04-10-2007, 08:07 PM Worked!!! Woo-Hoo!
Buickman 04-16-2007, 05:20 AM One more question about this. I can access this using HTTP and HTTPS. How do I disable the http so that I can only access it securely?
llama 04-16-2007, 07:58 AM You can use a redirect to send visits to http:// to https://
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{SERVER_NAME}/webmail/$1 [L,R=303]
</IfModule>
That works as an .htaccess file [in the above case at DOCUMENT_ROOT/webmail, or /var/www/webmail].
Next you can use mod_ssl and enable with `sudo a2enmod ssl` and need to add a Listen directive to /etc/apache2/ports.conf that contains this:
# added for ssl
Listen 443
Ah heck, there's a few other steps I think and my memory is failing me. I know you'll need to generate a certificate too. Hopefully somebody comes along and polishes up my reply with more info.
EDIT: I just realized that you already can access it via https. Just add the rewrite to your .htaccess for wherever Squirrelmail resides and restart apache2.
eaux-yeah 04-16-2007, 04:13 PM You can use a redirect to send visits to http:// to https://
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{SERVER_NAME}/webmail/$1 [L,R=303]
</IfModule>
That works as an .htaccess file [in the above case at DOCUMENT_ROOT/webmail, or /var/www/webmail].
Next you can use mod_ssl and enable with `sudo a2enmod ssl` and need to add a Listen directive to /etc/apache2/ports.conf that contains this:
# added for ssl
Listen 443
:9: nice.
Using mod_rewrite is a great here. Sometimes you may not want certain pages to use ssl, but for your web mail, you should always use it.
The mod-rewrite directive makes sure that you cannot use the web mail without using ssl.
Before running sudo a2enmod ssl, first create your security certs:
sudo apache2-ssl-certificateAnswer the questions it asks. Then run the a2enmod ssl command.
Next,
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl
sudo ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/ssl
In a text editor,
Open the /etc/apache2/sites-available/ssl file and change the top 2 lines to:
NameVirtualHost *:443
<VirtualHost *:443>
and in the middle of the file (I would say before the 'ScriptAlias' line) add:
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
then fill in your relevant information.
next, open the /etc/apache2/sites-enabled/default and change the top 2 lines to:
NameVirtualHost *:80
<VirtualHost *:80>
and the relevant information
Restart Apache
llama 04-16-2007, 06:00 PM I also forgot to mention that the Debianized (and Ubuntu) package of Squirrelmail has at the end of the /etc/squirrelmail/apache.conf file this:
#<IfModule mod_rewrite.c>
# <IfModule mod_ssl.c>
# <Location /squirrelmail>
# RewriteEngine on
# RewriteCond %{HTTPS} !^on$ [NC]
# RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L]
# </Location>
# </IfModule>
#</IfModule>
So one could merely un-hash that also.
llama 04-19-2007, 07:46 AM Huh, I upgraded to Feisty and apache2-ssl-certificate is broken.
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/77675
BTW, the workaround (from the link to Debian's bug tracker) didn't work. I'll wait for them to get this fixed.
llama 04-23-2007, 10:14 AM Hold up, wait a minute: I figured it out. Operator error (no laughs!)
I forgot to relink my /etc/apache2/sites-available/ssl to sites-enabled. All working.
Buickman 06-06-2007, 03:55 PM Just trying to get this setup with SSL and got this error when I tried to restart apache;
tim@timbo:~$ sudo /etc/init.d/apache2 restart
* Forcing reload of web server (apache2)... apache2: Syntax error on line 668 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/sites-enabled/default: /etc/apache2/sites-enabled/default:2: <VirtualHost> was not closed.
[fail]
Line 668 of the apache2.conf;
Include /etc/apache2/sites-enabled/
This is my /etc/apache2/sites-enabled/default
NameVirtualHost *:80
<VirtualHost *:80>
Any ideas?
llama 06-06-2007, 05:37 PM Just trying to get this setup with SSL and got this error when I tried to restart apache;
Line 668 of the apache2.conf;
This is my /etc/apache2/sites-enabled/default
Any ideas?
You have no other options for your default? Mine is fairly fleshed out. The error has to do with there is no
</VirtualHost>
on the line after what you have to close the virtualhost. You will need to add that.
Buickman 06-06-2007, 06:30 PM I'd messed up somewhere along the way, here it is;
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
However when I restart apache, I get;
tim@timbo:~$ sudo /etc/init.d/apache2 restart
* Forcing reload of web server (apache2)... apache2: Syntax error on line 668 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/sites-enabled/default: /etc/apache2/sites-enabled/default:2: <VirtualHost> was not closed.
There's still something wrong with that line.
llama 06-06-2007, 08:20 PM Oh, your include line may be goofed. My /etc/apache2/apache2.conf has this for that:
Include /etc/apache2/sites-enabled/[^.#]*
Buickman 06-07-2007, 12:21 PM I tried your line and it had no affect. Maybe when I get home I'll remove the :80 from the other file and see what happens.
|
|