[NBLUG/talk] SquirrelMail and PHP.

Christopher Wagner chrisw at pacaids.com
Wed Apr 23 10:40:04 PDT 2003


Testing it now..

I noticed something when having apachectl restart the server..

Found in my logs:
-
[Tue Apr 22 17:33:19 2003] [error] Cannot remove module mod_php4.c: not
found in module list
-
Upon telnetting to the server on port 80:
-
HTTP/1.1 400 Bad Request
Date: Wed, 23 Apr 2003 17:40:19 GMT
Server: Apache/1.3.27 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b
DAV/
1.0.3 mod_perl/1.26
Connection: close
Content-Type: text/html; charset=iso-8859-1
-
Interestingly enough, after making the suggested change to the <Directory>
directive, Squirrelmail now functions.
Now to troubleshoot why I can't login. :)

Thanks for your time everyone!

- Christopher Wagner
chrisw at pacaids.com

Packaging Aids Corporation - Information Systems
P.O. Box 9144
San Rafael, CA 94912-9144
http://www.pacaids.com/
(415) 454-4868 x116
 

-----Original Message-----
From: talk-admin at nblug.org [mailto:talk-admin at nblug.org]On Behalf Of ME
Sent: Tuesday, April 22, 2003 5:17 PM
To: talk at nblug.org
Subject: RE: [NBLUG/talk] SquirrelMail and PHP.


The problem is due to a lack of a <directory> </directory> tag specifying
how content in /var/www/html should be "dealt with.

The default install appears to use /var/www/web

This means, that without an explicit ref for your serverRoot, serverRoot
will inheirit its nearest parent that is explicit and that appears to be
"/"

<directory>
   Options FollowSymLinks
   AllowOverride None
</directory>

I would further guess that you might want to test other options. Though
this is a very liberal specification, try this and then narrow it down
until you have just enough to make php work for your squirrelmail based
dir:

<Directory "/var/www/html/YOURSQUIRRELMAILSUBDIRPATH">
    Options All
    AllowOverride All
    DirectoryIndex index.html index.htm default.html default.htm index.php
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
</Directory>

Such that you would replace "YOURSQUIRRELMAILSUBDIRPATH" with the
directory under "html" that contains your SM stuff.

(Include the above suggestion immediately after the <Directory "/"> and
</Directory>

After you make these changes to your httpd.conf, stop the web server, make
sure it is stopped, and then restart it.

As for "testing" if PHP is really "in" the web server, try this. Please
let us know if you see a result like this....

Go to a command line and type this (regular user is ok)
$ telnet web.server.ip.address 80
(you should see this:)
Trying web.server.ip.address...
Connected to localhost.
Escape character is '^]'.
(At this point type the following and then press "enter/return" two times
and look at the results that it gives you:)
HEAD / HTTP/1.1

(press return/enter here two times as stated above.)

If you see content like this:
------------------------- cut here ------------------------
HTTP/1.1 400 Bad Request
Date: Wed, 23 Apr 2003 00:08:59 GMT
Server: Apache/1.3.27 (Unix) PHP/4.3.1 DAV/1.0.3 mod_ssl/2.8.14
OpenSSL/0.9.7a
Connection: close
Content-Type: text/html; charset=iso-8859-1

Connection closed by foreign host.
------------------------- cut here ------------------------
That should tell you if your present server has PHP enabled and included.
"PHP/4.3.1" is an example, yours may be different.

Also, consider using SSL. I force all of my SM authentication to use web
based authentication behind SSL and THEN also ask the user to authenticate
 on the SM form. Since both are over SSL, I get end-to-end encryption.

I'd like to hear feedback from you on this after you trey the above. Just
because you get it to work (assuming it does work) does not mean you are
done. You will probably want to limit the "options" enabled for that
directory.

As for the suggestions from Troy, they are very good for troubleshooting,
but I would advise about commiting these changes into your config file for
ever. The reason why is, if PHP ever gets removed, uninstalled, or ????
your whole web server may fail to restart under those conditions.

The conditional checks are *good* when they work as they are supposed to
work. After that warning, keeping them just as Troy suggested for now is a
*very* good idea for testing and helping to diagnose the problem.

HTH,
-ME
(Going to sleep in about 45 minutes... zzzzz...)


> Well, I commented out the relevant lines, now it's asking me if I want to
> download the php file instead of displaying it..  Is this progress or a
> step
> back?
> -----Original Message-----
> From: talk-admin at nblug.org [mailto:talk-admin at nblug.org]On Behalf Of
> troy
> Sent: Tuesday, April 22, 2003 4:28 PM
> To: talk at nblug.org
> Subject: Re: [NBLUG/talk] SquirrelMail and PHP.
>
>
> On Tue, Apr 22, 2003 at 02:44:30PM -0700, Christopher Wagner wrote:
>> Ok folks..  The config file is attached.
>
> You mentioned earlier that libphp4.so does in fact exist.  So i'd
> replace:
>
> <IfDefine HAVE_PHP4>
> LoadModule php4_module        modules/libphp4.so
> </IfDefine>
>
> with:
> LoadModule php4_module        modules/libphp4.so
>
> Likewise:
>
>     <IfModule mod_php4.c>
>         AddType application/x-httpd-php .php .php4 .php3 .phtml
>         AddType application/x-httpd-php-source .phps
>     </IfModule>
>
> becomes:
>         AddType application/x-httpd-php .php .php4 .php3 .phtml
>         AddType application/x-httpd-php-source .phps
>
>
> I'm not positive but I think that if the php4 module was built separately
> from
> apache, then it won't be defined as a built in apache module.
>
> -troy
>
> _______________________________________________
> talk mailing list
> talk at nblug.org
> http://nblug.org/mailman/listinfo/talk
> _______________________________________________
> talk mailing list
> talk at nblug.org
> http://nblug.org/mailman/listinfo/talk
>
>

_______________________________________________
talk mailing list
talk at nblug.org
http://nblug.org/mailman/listinfo/talk



More information about the talk mailing list