编译安装 PHP 5.3.2 + php-fpm 通过 

真的是好事成双。

刚刚写完上一篇文章,就收到了PHP Bug Database的提醒,我提交的问题被解决了

原来是因为 我既启用了 php 内置的 mysqli,又自己编译了mysqli扩展.

导致php 遭遇Segmentation fault....

以后这个问题要注意呀,呵呵

为什么要用php-fpm ,因为fastcgi已经很久不更新了.
而且从 php 5.3.x 分支开始,php-fpm 已经成为了php内部项目了。
可见其前景无限.

下载 php 5.3.2源码包,解压,进入目录.
检出php-fpm 源码:
svn co http://svn.php.net/repository/php/php-src/trunk/sapi/fpm sapi/fpm

并重新生成configure文件,
./buildconf --force

我的configure:

$ ./configure --prefix=/usr/local/php --bindir=/usr/local/bin --sbindir=/usr/local/sbin --sysconfdir=/etc/sysconfig --enable-embed=static --enable-fpm --enable-debug --enable-safe-mode --enable-sigchild --enable-magic-quotes --enable-fd-setsize=100 --enable-calendar --enable-dba=shared --enable-exif --enable-ftp --enable-gd-native-ttf --enable-intl --enable-mbstring --enable-pcntl --disable-phar --enable-shmop --enable-soap --enable-sockets --enable-wddx --enable-zip --enable-zend-multibyte --with-libxml-dir --with-libevent-dir=/usr/local/libevent --with-fpm-user=http --with-fpm-group=web --with-config-file-path=/etc --with-exec-dir=/usr/local/bin --with-openssl --with-kerberos --with-pcre-regex --with-zlib --with-bz2 --with-curl --with-gd --with-mhash --with-imap --with-imap-ssl --with-ldap --with-ldap-sasl --with-mcrypt --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-mysqli=/usr/local/bin/mysql_config --with-pdo-mysql=/usr/local/bin/mysql_config --with-xmlrpc --without-pear

检查依赖,报错:
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing

yum install libc-client-devel.i386

解决.

接下了,make && make install.

如果编译通过,make 报错,make: *** [ext/phar/phar.php] Error 139
那是因为没有禁用掉 phar.
这是个php已知的bug(http://bugs.php.net/bug.php?id=51216),只有等下一个版本修复了.

安装OK后,复制源码包下sapi/fpm/php-fpm.conf 到 /etc/sysconfig/ 下,
稍加编辑,即可

运行 php-fpm,成功跑起来.
[ ] ( 2565 次浏览 ) 永久链接 ( 3 / 2243 )
编译安装 Squid 3.1.1 通过 

这几天搞php搞得头昏,已经把遇到的问题提交到了 http://bugs.php.net/,等回答了

故决定先把php放一放。

于是便寻思着去为即将问世的web server 做一个缓存系统.

因为我的VPS流量是1TB,说大不大,说小也不小。所以搞个缓存机制也是可行的。

于是便瞄准了squid-cache 这个工具.

下载最新的3.1.1版本,解压,进入源码包

我的configure:

It was created by Squid Web Proxy configure 3.1.1, which was
generated by GNU Autoconf 2.62. Invocation command line was

$ ./configure --prefix=/usr/local/squid --bindir=/usr/local/bin --sbindir=/usr/local/sbin --sysconfdir=/etc/sysconfig --enable-icmp --enable-delay-pools --enable-esi --enable-icap-client --enable-ecap --enable-cachemgr-hostname=PowerPC --enable-arp-acl --enable-ssl --enable-cache-digests --enable-follow-x-forwarded-for --enable-stacktraces --with-default-user=cache

可能会要求安装iptables,不过那台linux系统里没有呢?

有个安装cppunit的警告,只要不需要 make check,该依赖不是必须的。

检查依赖通过,make && make install

安装成功.

完了之后,编辑/etc/sysconfig/squid.conf 文件.

因为我这个squid 只是用来做web 缓存的,所以只需要设置反向代理即可.
在配置文件顶上面加入下面几行:

http_port 80 accel defaultsite=184.82.15.110 vhost
#由于暂时没有域名指向,直接用ip
cache_peer 184.82.15.110 parent 81 0 no-query originserver name=myAcce
#我lighttpd 的端口是81
cache_peer_access myAccel allow all
#暂时没有接入规则

更多设置见:http://wiki.squid-cache.org/ConfigExamples/

保存退出后。
运行 squid -z 生成缓存数据 (确保squid uid 对目录有读写权限)
最后,运行 squid,启动缓存.

访问下 http://184.82.15.110,看看返回体。

HTTP/1.0 200 OK
Content-Type: text/html
Content-Length: 5794
Date: Mon, 19 Apr 2010 10:28:33 GMT
Server: lighttpd/1.4.26
X-Cache: MISS from PowerPC
X-Cache-Lookup: MISS from PowerPC:80
Via: 1.0 PowerPC (squid/3.1.1)
Connection: keep-alive

果然squid 开始工作了
___________________
访问 http://184.82.15.110:81/,返回体

HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 5794
Date: Mon, 19 Apr 2010 10:53:29 GMT
Server: lighttpd/1.4.26

无缓存.
[ ] ( 1574 次浏览 ) 永久链接 ( 3 / 2246 )
编译安装 ProFTPD 1.3.3 通过 

想到为VPS安装一个ftp是必须的,于是便动手了.
因为proftpd没有用过,便想试试.
据说它提供像apache 那样的配置文件格式,很是友好

我的configure:
$ ./configure --prefix=/usr/local/proftpd --bindir=/usr/local/bin --sbindir=/usr/local/sbin --sysconfdir=/etc/sysconfig --enable-autoshadow --enable-nls --enable-openssl --enable-shadow --enable-buffer-size --enable-pool-size --enable-timeout-idle=180 --enable-transfer-buffer-size

检查依赖,缺openssl.故而 yum install openssl-devel

再次检查,通过

make && make install. 一切OK

然后复制源码包下的contrib下的几个几个第三方工具(如 ftpasswd) 到/usr/local/bin 下

再在 sample-configurations 下复制最适合自己的配置文件到 /etc/sysconfig 下,并改名为proftpd.config

因为我是私人的ftp,而且用的人很少,故选择 basic.conf.

接下来配置ftp虚拟用户,发现proftpd支持像vsftpd那样的通过mod_pam 连接mysql 验证用户.

不过,我比较喜欢通过本地文件存储用户信息.

编辑 proftpd.config 文件,加入

AuthUserFile /etc/proftpd.passwd
#定位用户信息存储文件路径
AuthOrder mod_auth_file.c mod_auth_unix.c
#指明验证方式.一定要有,不要像我一样,总是登不进去

use 和 group 可以自己指定.
我用的是系统自带的 ftp:ftp.
uid 14 ,giu 50

这个好了后,可以用第三方工具ftpasswd 添加虚拟用户.

ftpasswd -passwd --name=admin --uid=14 --gid=50 --home=/home --shell=/sbin/nologin --file=/etc/proftpd.passwd

输入两次密码即可,设置成功.

proftpd -t 测试一下配置文件
proftpd 启动ftp

ftp 127.0.0.1,输入用户名密码,登录成功
[ ] ( 2873 次浏览 ) 永久链接 ( 3 / 2407 )
源码安装 mysql 5.5.4-m3 

mysql刚刚发布了5.5 分支的第四个里程碑版本,于是下载安装.
前几天只有 x86_64 for linux 版本,今天已经放出了了i686版本.

我的configure:

It was created by MySQL Server configure.am 5.5.4-m3, which was
generated by GNU Autoconf 2.63. Invocation command line was

$ ./configure.am --prefix=/usr/local/mysql --bindir=/usr/local/bin --sbindir=/usr/local/sbin --sysconfdir=/etc/sysconfig --enable-profiling --with-charset=utf8 --with-extra-charsets=all --with-system-type=PowerOS --with-machine-type=PowerPC --with-mysqld-user=mysql --with-zlib-dir=bundled --with-low-memory --with-big-tables --with-ssl --with-embedded-server --with-embedded-privilege-control

检查依赖通过,但是在生成安装文件的时候,有了一行错误.
/bin/rm: cannot remove `libtoolT’: No such file or directory

查了一下,不影响安装.不过要再次生成conf 文件.

后来在源码包下INSTALL-SOURCE里面发现了源码编译前的准备步骤,可以避免这个错误.

2. Prepare the source tree for configuration:
shell> autoreconf --force --install
#发现autoconf 工具没装.
As an alternative to the preceding autoreconf command,
you can use BUILD/autorun.sh, which acts as a shortcut
for the following sequence of commands:
shell> aclocal; autoheader
shell> libtoolize --automake --force
#发现libtool 工具没装.
shell> automake --force --add-missing; autoconf
#发现automake 工具没装.

If you get some strange errors during this stage, verify
that you have the correct version of libtool installed.
删除源码文件夹,重新解压了下。
按照提示的步骤,走下去

检查依赖的时候,libtoolT 的错误的确没有了

不过,make 的时候居然报错了……囧rz

报zilb找不到,我日啊,我设置的zlib是mysql集成的,居然问我要zlib 库....

这个问题一时还找不到解决方案.

所幸libtoolT那个错误不影响安装使用,先忽略.以后再议.

接下来:
shell> groupadd mysql
shell> useradd -g mysql mysql
创建mysql 用户 组
shell> cp support-files/my-medium.cnf /etc/my.cnf
复制配置文件
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> mysql_install_db --user=mysql
安装初始数据.
shell> chown -R root .
shell> chown -R mysql var
shell> mysqld_safe --user=mysql &
成功启动mysql.
[ ] ( 1597 次浏览 ) 永久链接 ( 3.1 / 2181 )
编译安装 lighttpd 1.4.26 通过 

最近买的VPS刚到手,便忙活起来了

由于apache 2.3.5 alpha 与 php module 的不兼容,打算以Cherokee (上次试过,速度很快)作为web server.

于是乎,卸掉自带的apache 2.2,开始安装.

不过我这个人喜欢在一边看configure 参数,一边编译。由于VPS上没有预装ftp server.
所以便临时搭建了个服务器作为数据传输.

本想用nginx,想到从没试过lighttpd,就用它了.

下载源码,wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.26.tar.bz2

解压,进入目录

我的configure:

It was created by lighttpd configure 1.4.26, which was
generated by GNU Autoconf 2.65. Invocation command line was

$ ./configure --prefix=/usr/local/lighttpd --with-ldap --with-attr --with-openssl --with-zlib --with-bzip2 --with-fam --with-memcache

检查依赖,一秒钟报错.GCC no found……

新系统,真的很新

yum install gcc

再次检查依赖,pcre 没有,zlib没有,bzip没有,pkg-config没有

晕,依次安装.

最后检查,又报错~
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables FAM_CFLAGS
and FAM_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

fam 没有

yum install gamin
yum install fam-devel

这次OK了.

make && make install.安装成功

复制 源码包下doc下的lighttpd.conf到etc下.

稍加编辑后
/usr/local/lighttpd/sbin/lighttpd -t -f /etc/lighttpd.conf
测试一下
/usr/local/lighttpd/sbin/lighttpd -f /etc/lighttpd.conf
启动即可.
[ ] ( 1565 次浏览 ) 永久链接 ( 3 / 2206 )

<< <上一页 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 下一页> >>