记忆不行,只能记录
2009年二月
[error] (13)Permission denied: mod_fcgid: couldn’t bind unix domain socket /etc/httpd/logs/fcgidsock/15464.6
二 17th
# chmod 755 /var/log/httpd
参考:http://bbs.cd-dns.com/read-htm-tid-937.html中的
Solution: chmod 555 /etc/httpd/logs (this is a symlink to /var/log/httpd)
还有看到是 SocketPath /tmp/fcgidsock,单独列出来,再赋予读写权限
【转】Debian下为Apache2配置FastCGI(mod-fcgid),PHP5,Perl
二 17th
http://godsontech.blog.sohu.com/74164775.html
http://www.upsdn.net/html/2006-10/724.html
mysql设置密码
二 16th
set password for root@localhost=password('在这里填入root密码');
select user,host,password from mysql.user;安装mysql遇到奇怪问题,经查后,发现mysql服务器需要安装的是mysql-server
二 16th
以为是安装mysql就行了
后来看到http://www.centospub.com/make/mysql.html上安装的mysql-server才大悟
NSIS判断软件是否在运行
二 15th
需要安装2个plugin,http://nsis.sourceforge.net/FindProcDLL_plug-in
Function un.onInit
FindProcDLL::FindProc "你的程序.exe"
Pop $0
IntCmp $0 1 0 no_run
MessageBox MB_ICONSTOP "(你的程序)正在运行,请先关闭程序!"
Quit
no_run:
FunctionEnd
arbor找到的很快的国内yum 源
二 15th
CentOS USTC mirror
http://centos.ustc.edu.cn/centos/
安装后请按照以下步骤修改CenOS-Base.repo,以后就可以方便的用yum安装软件了.
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.save
wget http://centos.ustc.edu.cn/CentOS-Base.repo
修改以上文件后, 如需要安装gcc, 直接yum install gcc就可以了
还有一个:
http://www.shlug.org/
文章出处:http://www.diybl.com/course/6_system/linux/Linuxjs/20081213/153625.html
记录下,以备查用。
又找到一个:http://mirrors.ta139.com/CentOS-Base.repo.ta139
-
文章出处:http://www.diybl.com/course/6_system/linux/Linuxjs/20081213/153625.html
[转]在apache下php以编译fastcgi方式运行
二 14th
http://blog.163.com/gwo-cce@126/blog/static/32573649200882342821925/
一般php的安装都是编译为apache的一个模块,运行在apache的上下文中,权限比较高.如果不是特别注重安全性和使用一些线程不安全的模块,没有必要搞cgi.cgi模式一般比module要慢.但是,最近安装php5在make install时总是说dlname not found很是烦恼,想尝试编译成fastcgi看看效果.
一、安装php
wget http://cn2.php.net/get/php-5.2.5.tar.bz2/from/cn.php.net/mirror
tar jxvf php-5.2.5.tar.bz2
cd php-5.2.5
./configure --prefix=/usr/local/php5-fcgi --with-mysql=/usr/local/mysql --with-zlib-dir --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-gd --enable-track-vars --enable-ftp --with-iconv --with-gettext --with-curl --enable-fastcgi --with-openssl
1. 编译参数不能加 –with-apxs2=/usr/local/apache2/bin/apxs 否则安装出来的php执行文件是cli模式的
2. 如果系统已经安装好了zlib、freetype、jpeg和png是gd库的基础,一般系统都会带有,那么用–with-xxxx-dir=/usr 就行了.gd2也不要另外下载安装了,貌似gd库的核心成员被zend挖走了,总之php源码自己带有一套更加帅气的gd库,用–with-gd就ok 了
make
make install
cp php.ini-dist /usr/local/php5-fcgi/lib/php.ini
二、 安装mod_fcgid
其实php官方主推fascgi,但是国内有牛人发现它的管理模式有点冗余,详情请看
http://fastcgi.coremail.cn/
经过测试,国人的fascgi在进程回收,内存控制方面比较不错.
wget http://jaist.dl.sourceforge.net/sourceforge/mod-fcgid/mod_fcgid.2.2.tgz
tar zxvf mod_fcgid.2.2.tgz
cd mod_fcgid.2.2
make
make install
安装好以后在apache的 modules 目录下会有一个 mod_fcgid.so
附fastcgid的安装过程
wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz
tar zxvf mod_fastcgi-2.4.6.tar.gz
cd mod_fastcgi-2.4.6
如果web服务器是apache2
cp Makefile.AP2 Makefile
vi Makefile
把top_dir = /usr/local/apache 修改成apache的安装目录
make
make install
三、配置apache
vi一下httpd.conf添加这样的内容
LoadModule fcgid_module modules/mod_fcgid.so
ScriptAlias /fcgi-bin/ "/usr/local/php5-fcgi/bin/"
AddHandler php-fastcgi .php
Action php-fastcgi /fcgi-bin/php-cgi
AddType application/x-httpd-php .php
Options FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
allow from all
第一句话装载mod_fcgid,fastcgi用LoadModule fcgid_module modules/mod_fcgid.so这个去装载
然后建立一个/fcgi-bin/的虚拟目录到php-cgi的那个目录,分别用AddHandler和Action关联apache和php-cgi,然后AddType建立一个web文件类型php,最后用Directory定义一下访问权限.
其实建立/fcgi-bin/虚拟目录偷懒了,为了更好的安全性应该是用ln -s将php-cgi链到另外的目录,而不是将整个php安装目录暴露,诸如此类的写法
AddHandler fcgid-script .php .py .pl .fcgi
IdleTimeout 300
ProcessLifeTime 1800
MaxProcessCount 100
DefaultMinClassProcessCount 3
DefaultMaxClassProcessCount 8
IPCConnectTimeout 15
IPCCommTimeout 300
MaxRequestsPerProcess 100
# RewriteCond %{REQUEST_URI} ^/fcgi-bin/.* [NC]
# RewriteRule .*/php$ /nonexistent.file [L]
IdleTimeout 发呆时限
ProcessLifeTime 一个进程的最长生命周期,过期之后无条件kill
MaxProcessCount 最大进程个数
DefaultMinClassProcessCount 每个程序启动的最小进程个数
DefaultMaxClassProcessCount 每个程序启动的最大进程个数
IPCConnectTimeout 程序响应超时时间
IPCCommTimeout 与程序通讯的最长时间,上面的错误有可能就是这个值设置过小造成的
MaxRequestsPerProcess 每个进程最多完成处理个数,达成后自杀,因为PHP最多只处理500次请求。不过这个是mod_fcgid 1.11版本添加的,我们主机上暂时不支持。
重启一下apache就ok了.
通过用ab对比PHP模块运行的服务器,FASTCGI要慢很多,目前还没找解决方案.
四、参考资料
http://linux.chinaunix.net/techdoc/install/2008/01/06/975966.shtml
http://www.seaoffire.net/fcgi-faq.html
http://typo3.org/development/articles/using-php-with-mod-fcgid/page/3/
[url=http://xok.la/2008/07/php_fastcgi_apache.html][/url]
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/249/showart_1092019.html