intinya cuma ini :
a2dismod suphp
/etc/init.d/apache2 restart
lengkapnya begini isi webnya:
Let's put this thread to bed already.
The most important thing to note regarding the tutorial at http://www.howtoforge.com/enabling-s...r-ubuntu-10.10 is that a key assumption is made: Apache is configured in CGI mode. If Apache is configured using one of the other modes, the instructions would need to be modified accordingly.
The sources of confusion are largely that:
a.) The tutorial does not specify which PHP mode to use.
b.) The tutorial is inaccurate if ISPConfig's default PHP mode, Fast-CGI, is selected.
c.) The fact that PHP configuration directives (open_basedir, where this tutorial is concerned) must be placed in different locations depending on the selected PHP mode.
d.) It is unnecessary to add the SquirrelMail directories to the open_basedir directives when using ISPConfig's default PHP mode, Fast-CGI, so that step of the tutorial is superfluous unless using CGI mode.
e.) In ISPConfig, the "PHP open_basedir" field length is limited, although there is no mention of this fact. As such, some portion of the value in that field may be truncated without warning. One way around this bug is to use Mod-PHP, in which case the open_basedir directive is specified in the Apache Directives box, which does not suffer from the same length limit.
f.) The tutorial fails to mention two additional directories that should be added to the open_basedir directive's value. The full list should be:
Code:
/usr/share/squirrelmail:/etc/squirrelmail:/etc/mailname:/etc/hostname
The problem with Apache sending the actual binary file "index.php" to the browser has to do with an incompatibility with the default SquirrelMail configuration and Apache's SuPHP module, which as mentes already suggested, can be disabled:
Quote:
Originally Posted by mentes
I had a similar problem. My solution was:
a2dismod suphp
/etc/init.d/apache2 restart
With suPHP disabled, the SquirrelMail index page (index.php) is parsed properly and the login screen is accessible.
Basically, SquirrelMail should work if:
a.) PHP mode is CGI and the necessary directories are added to "PHP open_basedir" field in Sites -> Website -> example.com -> Options [tab], as described in the tutorial. (Even if suphp module is enabled, it is ignored in CGI mode.)
b.) PHP mode is Fast-CGI and the suphp Apache module is disabled. (Disabling this module prevents "index.php" from being sent to the browser as a file download. It should be noted that Apache can be configured to enable SquirrelMail to function with SuPHP enabled, if desired.)
c.) PHP mode is Mod-PHP and the necessary open_basedir directories are added to the "Apache Directives" field in Sites -> Website -> example.com -> Options [tab]. How this directive is defined depends on the Apache configuration. An example might be:
Code:
Alias /webmail /usr/share/squirrelmail
<Location /webmail>
php_admin_value open_basedir "/usr/share/squirrelmail:/etc/squirrelmail:/etc/mailname:/etc/hostname"
</Location>
If the appropriate directories are not added to PHP's open_basedir configuration directive, the SquirrelMail index page will state:
Code:
ERROR: Config file "config/config.php" not found. You need to configure SquirrelMail before you can use it.
The Apache logs will state (among other open_basedir errors):
Code:
PHP Warning: file_exists(): open_basedir restriction in effect. File(config/config.php) is not within the allowed path(s): (/current/open_basedir/path) in /usr/share/squirrelmail/index.php on line 15
The bottom line is that to configure SquirrelMail properly, it is important to understand that ISPConfig offers several different modes of operation for Apache: FastCGI, CGI, Mod-PHP, and suPHP. Each mode has different configuration requirements.
Tidak ada komentar:
Posting Komentar