出家如初,成佛有余

Dreamhost Internal Server Error故障

Posted in Uncategorized by chuanliang on 2008/09/07

  9-5号访问寄存在dreamhost的www.yeeach.com主机时候,访问所有应用页面(blog、pligg、bbs、下载)都报Internal Server Error,查看服务器日志发现大量的如下错误:

[Thu Sep 04 00:41:53 2008] [error] [client 220.181.32.23] Premature end of script headers: php.cgi
[Thu Sep 04 00:41:53 2008] [error] [client 220.181.32.23] php.cgi: error while loading shared libraries: libsablot.so.0: cannot open shared object file: No such file or directory

    看来是apache出了问题,与dreamhost客服联系后,发现不是我自己的问题,近期dreamhsot对debian操作系统进行了升级,从32-bit升级到64-bit,导致原来的32-bit的php动态库不能够再使用。

   按照dreamhost提供的参考网页:

http://www.dreamhoststatus.com/2008/09/02/debian-upgrades-and-custom-php/

http://wiki.dreamhost.com/Installing_PHP5#Compiling_a_Customized_PHP_5

    看见繁琐的升级过程,头就大,也没有时间仔细去琢磨。突然想起来,前段时间遇到的upload_max_filesize时候曾经使用的shell脚本,修改Dreamhost虚拟主机的php.ini的upload_max_filesize参数限制 ,在服务器上执行了一下两个脚本,问题解决了。呵呵,看来多记笔记很有好处。

1、mkdir ~/yeeach.com/cgi-bin/

2、touch ~/php-copy.sh 

#!/bin/sh
CGIFILE="$HOME/yeeach.com/cgi-bin/php.cgi"
INIFILE="$HOME/yeeach.com/cgi-bin/php.ini"
rsync -a /dh/cgi-system/php5.cgi "$CGIFILE"
# REMOVE THE FOLLOWING LINE TO CREATE THE UPDATE-ONLY SCRIPT:
cp /etc/php5/cgi/php.ini "$INIFILE"

perl -p -i -e ‘
s/.*post_max_size.*/post_max_size = 100M/;
s/.*upload_max_filesize.*/upload_max_filesize = 100M/;
‘ "$INIFILE"

3、chmod +x php-copy.sh

4、./php-copy.sh

5、touch ~/yeeach.com/.htaccess

Options +ExecCGI
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi

6、 php daily  update

cp php-copy.sh php-update.sh
#the php-update.sh content is :

#!/bin/sh

CGIFILE="$HOME/yeeach.com/cgi-bin/php.cgi"

INIFILE="$HOME/yeeach.com/cgi-bin/php.ini"

rsync -a /dh/cgi-system/php5.cgi "$CGIFILE"

perl -p -i -e ‘

s/.*post_max_size.*/post_max_size = 100M/;

s/.*upload_max_filesize.*/upload_max_filesize = 100M/;

‘ "$INIFILE"

7、crontab configure

crontab -e
#the crontab's content :
@weekly /home/myusername/php-update.sh

 

参考资料:

http://www.activecollab.com/forums/topic/1507/

http://wiki.dreamhost.com/index.php/PHP.ini .

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: