在并发上,nginx无疑是老大,做反向代理的时候,没有发现squid的并发方面介绍,所以暂且认为ngnix是老大,apache的稳定性有目共睹,但在并发方面的确不是很如意。
缓存方面:squid,apache都支持diskcache和memcache,根据http的head头来确定是否缓存,nginx不支持缓存,不过我在google开源上看见了新浪的水杨老大的一个东东,给nginx加上了文件缓存,不过没有大规模使用,暂时不把它当做一种解决方案。
在代理和缓存的规则上,apache很强,很强大的重写功能,尤其是强制修改http规则,不过这个功能我始终没有调试成功,no-cache的页面始终无法去缓存。
如果只是做网站的反向代理,负载均衡,nginx感觉要比squid强,性能强悍,配置方便。
如果是做代理+缓存加速,那squid的功能和稳定性还是很好的,毕竟在互联网上大量应用。
apache呢?好像没它的事情了。当然不是,有些地方可以拿他的功能当中间件使用,这个等下次分解。
]]>这样不用每次都把php.ini拷贝到C:\Windows下
2、set Path=D:\PHP5;D:\PHP5\ext;%Path%
这样不用每次把那些dll拷贝到C:\Windows\system32下
]]>下载 mod_bw 的源代码 http://www.ivn.cl/apache/files/source/mod_bw-0.8.tgz
解压后,执行 apxs -i -a -c mod_bw.c
貌似自动就加到httpd.conf文件里。
如果不是自动的,就手工拷贝 mod_bw.so 到 apache module目录,httpd.conf 里增加 LoadModule bw_module modules/mod_bw.so
在虚拟主机里增加如下配置文件
具体的配置文档可以看这里
]]>这个配置基本支撑http的访问,几个博客,一个论坛,还有一个哥们很大的静态并发。
以前使用的是work方式,因为不太了解,经常造成进程崩溃,又切换到了prefork方式,这次调整的比较稳定了。
]]>启动撰写时间: 2009年05月20日
目的:全面详细介绍LAMP fastcgi方式配置细节,基于之前的自动配置脚本,目的是把更多的细节转达给大家。
需要软件源码:
CentOS4.7
http://centos.ustc.edu.cn/centos/4.7/isos/i386/CentOS-4.7.ServerCD-i386.iso
http://centos.ustc.edu.cn/centos/4.7/isos/x86_64/CentOS-4.7.ServerCD-x86_64.iso
Apache-2.2.9
http://archive.apache.org/dist/httpd/httpd-2.2.9.tar.gz
MYSQL-5.2.6
http://downloads.mysql.com/archives/mysql-5.0/mysql-5.0.22.tar.gz
PHP-5.2.6
http://museum.php.net/php5/php-5.2.6.tar.gz
FCGID
http://ncu.dl.sourceforge.net/sourceforge/mod-fcgid/mod_fcgid.2.2.tgz
安装:
第一步:Linux系统安装,同时可以参照我原来的文档
http://www.sunboyu.cn/2008/06/13/centos5%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97%EF%BC%88%E7%AE%80%E5%8D%95%E7%AF%87%EF%BC%89.shtml
视频。我按照最小化进行安装。最后ping百度不通,是因为没有重启,重启后是正常的。从过程可疑看出,我用的vmware进行安装,所以,要根据你实际的网络情况进行调整配置。
第二步:系统更新,组件安装。
首先更新一下yum源,具体查看这篇日志 http://www.sunboyu.cn/2009/01/07/centos4%E5%88%9D%E5%A7%8B%E5%8C%96%E7%9A%84%E4%B8%80%E4%BA%9B%E8%84%9A%E6%9C%AC.shtml
升级一下系统:
yum upgrade
安装一些必要的组件:
yum install gcc gcc-c++ gcc4-c++ autoconf gd gd-devel libxml2 libxml2-devel zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel expat expat-devel sqlite sqlite-devel png-devel jpeg-devel libtool libjpeg* libpng* freetype-devel
安装MYSQL-5.0.22
解压mysql
#tar -zxvf mysql-5.0.22.tar.gz
#cd cd mysql-5.0.22
#groupadd mysql
#useradd -g mysql mysql
#./configure –prefix=/opt/mysql-5.0.22 \
–without-debug \
–enable-thread-safe-client \
–with-client-ldflags=-all-static \
–with-mysqld-ldflags=-all-static \
–enable-local-infile \
–enable-largefile \
–with-charset=utf8 \
–with-collation=utf8_unicode_ci \
–with-extra-charsets=complex \
–with-pic \
–with-mysqld-libs \
–with-comment \
–with-query-cache \
–with-bench \
–with-big-tables \
–with-innodb \
–with-mysqld-use=mysql
#make
#make install
#cp ./support-files/my-medium.cnf /etc/my.cnf
#cp ./support-files/mysql.server /etc/init.d/mysqld
#chmod 755 /etc/init.d/mysqld
#/opt/mysql-5.0.22/bin/mysql_install_db –user=mysql &
#echo “/opt/mysql-5.0.22/bin/mysqld_safe –user=mysql &”>>/etc/rc.local
#service mysqld start
#/opt/mysql-5.0.22/bin/mysqladmin -u root password ‘123456′
#cd ..
安装APACHE
#groupadd apache
#useradd -g apache apache
#tar -zxvf httpd-2.2.9.tar.gz
#cd httpd-2.2.9
#./configure –prefix=/opt/httpd-2.2.9 \
–enable-dav \
–enable-dav-fs \
–enable-modules=all \
–enable-mods-shared=all \
–disable-auth-basic \
–enable-include \
–enable-substitute \
–enable-authz-dbm \
–enable-log-config \
–enable-headers \
–enable-setenvif \
–with-ssl \
–enable-static-ab \
–enable-http \
–enable-mime \
–enable-status \
–enable-isapi \
–enable-imagemap \
–enable-actions \
–enable-speling \
–enable-userdir \
–enable-alias \
–enable-vhost-alias \
–enable-dir \
–enable-rewrite \
–enable-dumpio \
–enable-echo \
–enable-so \
–enable-example \
–enable-case-filter \
–enable-substitute \
–enable-log-config \
–enable-logio \
–enable-env \
–with-mpm=worker \
–with-included-apr \
–with-apr \
–with-apr-util \
–with-z \
–enable-proxy \
–enable-proxy-connect \
–enable-proxy-ftp \
–enable-proxy-http \
–enable-proxy-ajp \
–enable-proxy-balancer \
–enable-suexec \
–with-suexec-caller=apache \
–with-suexec-userdir=www \
–with-suexec-docroot=/home \
–with-suexec-uidmin=100 \
–with-suexec-gidmin=100 \
–with-suexec-logfile=/var/log/suexec_log
#make
#make install
#ln -s /opt/httpd-2.2.9/bin/apachectl /etc/init.d/httpd
#cd ..
修改apache配置文件 /opt/httpd-2.2.9/conf/httpd.conf
找到
User daemon
Group daemon
修改为
User apache
Group apache
安装 fcgid
#tar -zxvf mod_fcgid.2.2.tgz
#cd mod_fcgid.2.2
修改Makefile
top_dir = /usr/local/apache2 为 top_dir = /opt/httpd-2.2.9
#make
#make install
#cd ..
修改apache配置文件 httpd.conf
增加 LoadModule fcgid_module modules/mod_fcgid.so
安装PHP,记得增加cgi支持
#tar -zxvf php-5.2.6.tar.gz
#cd php-5.2.6
#./configure –prefix=/opt/php-5.2.6 –with-libxml-dir –enable-cli –enable-cgi –enable-fastcgi –enable-bcmath –enable-force-cgi-redirect –enable-discard-path –enable-path-info-check –with-openssl –with-pcre-regex –enable-calendar –enable-dom –enable-ftp –with-openssl-dir=/usr/local/ssl –enable-gd-jis-conv –enable-hash –with-iconv –enable-json –enable-mbstring –enable-mbregex –enable-pdo –enable-posix –enable-libxml –enable-simplexml –with-sqlite –enable-tokenizer –enable-xmlreader –enable-xmlwriter –enable-sockets –with-zlib –with-freetype-dir –with-gd –with-jpeg-dir=/usr/lib –with-png-dir=/usr/lib –with-mime-magic –with-mysql=/opt/mysql-5.0.22 –with-zlib-dir=/usr/lib/libz.so –with-pdo-mysql=/opt/mysql-5.0.22 –with-pdo-sqlite –enable-posix –enable-soap
#make
#make install
修改apache配置文件httpd.conf
找到
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
修改为
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
修改apache配置文件 conf/extra/httpd-vhosts.conf
删除所有的虚拟主机
现在配置虚拟主机:
所有虚拟主机的组为 vhost
增加一个用户名为sunboyu的虚拟主机
#groupadd vhost
#useradd -g vhost sunboyu
用户主目录默认为 /home/sunboyu
增加两个目录
#mkdir /home/sunboyu/www
#mkdir /home/sunboyu/logs
增加虚拟主机配置文件
SuexecUserGroup sunboyu vhost
ServerAdmin sunboyu@gmail.com
DocumentRoot “/home/sunboyu/www”
ServerName 192.168.0.4
ServerAlias sunboyu.cn
ErrorLog “/home/sunboyu/logs/error_log”
CustomLog “|/opt/httpd-2.2.9/bin/rotatelogs /home/sunboyu/logs/%Y_%m_%d_log 86400 +480″ common
AddHandler fcgid-script .php
#AddHandler cgi-script .pl .cgi
FCGIWrapper /home/sunboyu/php-cgi .php
Options ExecCGI FollowSymLinks
AllowOverride all
Order deny,allow
Allow from all
创建文件 /home/sunboyu/php-cgi 文件内容为
#!/bin/sh
export PHPRC=/home/sunboyu
export PHP_FCGI_CHILDREN=4
export PHP_FCGI_MAX_REQUESTS=5000
exec /opt/php-5.2.6/bin/php-cgi “$@”
#chmod 755 -R /home/sunboyu
#chown sunboyu:vhost -R /home/sunboyu
配置到现在,重启apache
#service httpd restart
在虚拟目录根下 /home/sunboyu/www 下写文件 info.php 内容为 phpinfo() 修改权限为755 用户组为 sunboyu:vhost
现在访问应该是phpinfo的信息。
在写这篇文档的时候,基本是按照数续依次安装。
如果有问题,希望帮忙,请提前修改你服务器root密码,我们可以一起调试。
]]>顺便提一下,我PC级的服务器。
感谢 http://www.51fit.com/ 友情提供测试数据
计划重新部署apache,调整工作模式。
]]>Apache2中的实时压缩解压的模块编译在mod_deflate模块中,替换了原来的mod_gzip模块。
编译apache的时候 –enable-deflate 这个参数是默认开启的,编译完会有mod_deflate模块。
配置站点:
如果我们想使一个文件传输的时候进行加密,我们在站点配置文件里增加这样的配置
<Location />
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
Header append Vary User-Agent env=!dont-vary
</Location>
这样,/opt/httpd-2.2.9/htdocs目录下的所有mime类型为text/html的文件就可以启用
未压缩的http头
| Date | Tue, 28 Oct 2008 13:04:15 GMT |
| Server | Apache/2.2.9 (Unix) DAV/2 PHP/5.2.6 |
| Last-Modified | Tue, 28 Oct 2008 12:51:52 GMT |
| Etag | “30623-55fda-45a4fb62a8a00″ |
| Accept-Ranges | bytes |
| Content-Length | 352218 |
| Content-Type | text/html |
| Vary | Accept-Encoding,User-Agent |
压缩后的http头
| Date | Tue, 28 Oct 2008 13:07:39 GMT |
| Server | Apache/2.2.9 (Unix) DAV/2 PHP/5.2.6 |
| Last-Modified | Tue, 28 Oct 2008 12:51:52 GMT |
| Etag | “30623-55fda-45a4fb62a8a00″-gzip |
| Accept-Ranges | bytes |
| Vary | Accept-Encoding,User-Agent |
| Content-Encoding | gzip |
| Content-Length | 2778 |
| Keep-Alive | timeout=5, max=100 |
| Connection | Keep-Alive |
| Content-Type | text/html |
原来length为352218,压缩后为2778,效果还是很明显的。
不过对于length很小的文件,是不进行压缩的。
具体的一些调整的细节,可以看原apache手册。
]]>基本都配置完毕了,但整体流程没有彻底自动化,适当的时候会作出stable版本。
# author:sunboyu@gmail.com
# qq:176300676 msn:sunboyu@gmail.com
# http://www.sunboyu.cn
#!/bin/sh
h_path = “/root/”
url=”http://www.sunboyu.cn/sourse/”
install_dir=”/opt/”
mkdir $install_dir
termcap_sourse_name=”termcap-1.3.1″
mysql_sourse_name=”mysql-5.0.22″
mysql_install_dir=$install_dir$mysql_sourse_name
openssl_sourse_name=”openssl-0.9.8g”
openssl_install_dir=$install_dir$openssl_sourse_name
httpd_sourse_name=”httpd-2.2.9″
httpd_install_dir=$install_dir$httpd_sourse_name
fastcgi_sourse_name=”mod_fastcgi-2.4.6″
fastcgi_install_dir=$install_dir$fastcgi_sourse_name
fcgid_sourse_name=”mod_fcgid.2.2″
libxml2_sourse_name=”libxml2-2.6.30″
libxml2_install_dir=$install_dir$libxml2_sourse_name
zlib_sourse_name=”zlib-1.2.3″
jpeg_sourse_name=”jpegsrc.v6b”
jpeg_install_dir=$install_dir$jpeg_sourse_name
libpng_sourse_name=”libpng-1.2.29″
libpng_install_dir=$install_dir$libpng_sourse_name
freetype_sourse_name=”freetype-2.3.7″
freetype_install_dir=$install_dir$freetype_sourse_name
php_sourse_name=”php-5.2.6″
php_install_dir=$install_dir$php_sourse_name
gd_sourse_name=”gd-2.0.36RC1″
gd_install_dir=$install_dir$gd_sourse_name
###MYSQL依赖库
wget ${url}${termcap_sourse_name}”.tar.gz”
tar -zxvf $termcap_sourse_name”.tar.gz”
cd $termcap_sourse_name
./configure
make && make install
cd ..
#rm -rf ${termcap_sourse_name}*
###openssl
wget ${url}${openssl_sourse_name}”.tar.gz”
tar -zxvf $openssl_sourse_name”.tar.gz”
cd $openssl_sourse_name
./Configure –prefix=$openssl_install_dir
make && make install
cd ..
#rm -rf ${openssl_sourse_name}*
###libxml
wget ${url}${libxml2_sourse_name}”.tar.gz”
tar -zxvf $libxml2_sourse_name”.tar.gz”
cd $libxml2_sourse_name
./configure –prefix=$libxml2_install_dir
make && make install
cd ..
#rm -rf ${libxml2_sourse_name}*
###zlib
wget ${url}${zlib_sourse_name}”.tar.gz”
tar -zxvf $zlib_sourse_name”.tar.gz”
cd $zlib_sourse_name
./configure
make && make install
cd ..
cp /usr/lib/libz.so.1 /usr/lib/libz.so
#rm -rf ${zlib_sourse_name}*
###jpeg
wget ${url}${jpeg_sourse_name}”.tar.gz”
tar -zxvf $jpeg_sourse_name”.tar.gz”
cd jpeg-6b
./configure
mkdir /usr/local/man/
mkdir /usr/local/man/man1/
mkdir /usr/local/man/man1/cjpeg/
make && make install
cp /usr/lib/libjpeg.so.62 /usr/lib/libjpeg.so
cp jpeglib.h /usr/include/jpeglib.h
cp jconfig.h /usr/include/jconfig.h
cp jmorecfg.h /usr/include/jmorecfg.h
cp jerror.h /usr/include/jerror.h
cd ..
#rm -rf ${jpeg_sourse_name}.tar.gz
#rm -rf jpeg-6b
###png
wget ${url}${libpng_sourse_name}”.tar.gz”
tar -zxvf $libpng_sourse_name”.tar.gz”
cd $libpng_sourse_name
./configure –prefix=$libpng_install_dir
make && make install
cp png* /usr/include/
cd ..
#rm -rf ${libpng_sourse_name}*
###freetype
wget ${url}${freetype_sourse_name}”.tar.gz”
tar -zxvf $freetype_sourse_name”.tar.gz”
cd $freetype_sourse_name
./configure –prefix=$freetype_install_dir
make && make install
cd ..
#rm -rf ${freetype_sourse_name}*
###GD2
wget ${url}${gd_sourse_name}”.tar.gz”
tar -zxvf $gd_sourse_name”.tar.gz”
cd $gd_sourse_name
./configure –prefix=$gd_install_dir –with-png=/opt/libpng-1.2.29 –with-freetype=/opt/freetype-2.3.7 –with-jpeg=/usr/lib/libjpeg.so
make && make install
cd ..
#rm -rf ${gd_sourse_name}*
###MYSQL
groupadd mysql
useradd -g mysql mysql
wget ${url}${mysql_sourse_name}”.tar.gz”
tar -zxvf $mysql_sourse_name”.tar.gz”
cd $mysql_sourse_name
./configure –prefix=$mysql_install_dir –without-debug –with-unix-socket-path=/tmp/mysql.sock –with-client-ldflags=-all-static –with-mysqld-ldflags=-all-static –enable-local-infile –enable-largefile –with-charset=utf8 –with-pic –with-mysqld-libs –with-comment –with-query-cache –with-bench –with-big-tables –with-innodb –with-mysqld-use=mysql
make && make install
cp ./support-files/my-medium.cnf /etc/my.cnf
cp ./support-files/mysql.server /etc/init.d/mysqld
cd ..
#mkdir $mysql_install_dir/var/
#$mysql_install_dir/bin/mysql_install_db –user=mysql &
#$mysql_install_dir/bin/mysqld_safe –user=mysql &
echo ${mysql_install_dir}”/bin/mysqld_safe –user=mysql &”>>/etc/rc.local
#rm -rf ${mysql_sourse_name}*
###APACHE
wget ${url}${httpd_sourse_name}”.tar.gz”
tar -zxvf $httpd_sourse_name”.tar.gz”
cd $httpd_sourse_name
./configure –prefix=$httpd_install_dir –enable-authz-dbm –enable-log-config –enable-headers –enable-setenvif –with-ssl=$openssl_install_dir –enable-static-ab –enable-http –enable-mime –enable-status –enable-suexec –enable-vhost-alias –enable-dir –enable-rewrite –with-mpm=worker
make && make install
cd ..
ln -s $httpd_install_dir/bin/apachectl /etc/init.d/httpd
echo $httpd_install_dir/bin/apachectl start>>/etc/rc.local
chkconfig –level 345 httpd on
#rm -rf ${httpd_sourse_name}*
###fastcgi
wget ${url}${fastcgi_sourse_name}”.tar.gz”
tar -zxvf $fastcgi_sourse_name”.tar.gz”
cd $fastcgi_sourse_name
sed ’s/\/usr\/local\/apache2/\/opt\/httpd-2.2.9\//g’ Makefile.AP2 > Makefile
make && make install
cd ..
###fcgid
wget ${url}${fcgid_sourse_name}”.tgz”
tar -zxvf $fcgid_sourse_name”.tgz”
cd $fcgid_sourse_name
mv Makefile Makefile.AP2
sed ’s/\/usr\/local\/apache2/\/opt\/httpd-2.2.9\//g’ Makefile.AP2 > Makefile
make && make install
cd ..
echo LoadModule fcgid_module modules/mod_fcgid.so>>$httpd_install_dir/conf/httpd.conf
echo AddHandler fcgid-script .php>>$httpd_install_dir/conf/httpd.conf
echo “FCGIWrapper “${php_install_dir}”/bin/php-cgi .php”>>$httpd_install_dir/conf/httpd.conf
#rm -rf ${fastcgi_sourse_name}*
###PHP
wget ${url}${php_sourse_name}”.tar.gz”
tar -zxvf $php_sourse_name”.tar.gz”
cd $php_sourse_name
cp php.ini-dist php.ini
./configure –prefix=$php_install_dir –with-libxml-dir=$libxml2_install_dir –enable-cli –enable-cgi –enable-fastcgi –enable-force-cgi-redirect –enable-discard-path –enable-path-info-check –with-openssl –with-pcre-regex –enable-calendar –enable-dom –enable-ftp –with-openssl-dir=/usr/local/ssl –enable-gd-jis-conv –enable-hash –with-iconv –enable-json –enable-mbstring –enable-mbregex –enable-pdo –enable-posix –enable-libxml=$xml2_install_dir –enable-simplexml –with-sqlite –enable-tokenizer –enable-xmlreader –enable-xmlwriter –with-zlib –with-freetype-dir=$freetype_install_dir –with-gd=$gd_install_dir –with-jpeg-dir=/usr/lib/libjpeg.so –with-libpng-dir=/opt/libpng-1.2.29/lib/libpng12.so –with-zlib-dir=/usr/lib/libz.so –with-mime-magic –with-mysql=$mysql_install_dir –with-zlib-dir=/usr/lib/libz.so –with-pdo-mysql=$mysql_install_dir –with-pdo-sqlite –enable-posix –enable-soap
make && make install
cp php.ini $php_install_dir/lib/
cd ..
$mysql_install_dir/bin/mysql_install_db –user=mysql &
service httpd start
service mysqld start
LoadModule fcgid_module modules/mod_fcgid.so
AddHandler fcgid-script .php
FCGIWrapper /opt/php5/bin/php-cgi .php
#!/bin/sh
h_path = “/root/”
url=”http://www.sunboyu.cn/sourse/”
install_dir=”/opt/”
mkdir $install_dir
termcap_sourse_name=”termcap-1.3.1″
mysql_sourse_name=”mysql-5.0.22″
mysql_install_dir=$install_dir$mysql_sourse_name
openssl_sourse_name=”openssl-0.9.8g”
openssl_install_dir=$install_dir$openssl_sourse_name
httpd_sourse_name=”httpd-2.2.9″
httpd_install_dir=$install_dir$httpd_sourse_name
fastcgi_sourse_name=”mod_fastcgi-2.4.6″
fastcgi_install_dir=$install_dir$fastcgi_sourse_name
libxml2_sourse_name=”libxml2-2.6.30″
libxml2_install_dir=$install_dir$libxml2_sourse_name
zlib_sourse_name=”zlib-1.2.3″
zlib_install_dir=$install_dir$zlib_sourse_name
jpeg_sourse_name=”jpegsrc.v6b”
jpeg_install_dir=$install_dir$jpeg_sourse_name
libpng_sourse_name=”libpng-1.2.29″
libpng_install_dir=$install_dir$libpng_sourse_name
freetype_sourse_name=”freetype-2.3.7″
freetype_install_dir=$install_dir$freetype_sourse_name
php_sourse_name=”php-5.2.6″
php_install_dir=$install_dir$php_sourse_name
###MYSQL
wget ${url}${termcap_sourse_name}”.tar.gz”
tar -zxvf $termcap_sourse_name”.tar.gz”
cd $termcap_sourse_name
./configure
make && make install
cd ..
rm -rf ${termcap_sourse_name}*
groupadd mysql
useradd -g mysql mysql
wget ${url}${mysql_sourse_name}”.tar.gz”
tar -zxvf $mysql_sourse_name”.tar.gz”
cd $mysql_sourse_name
./configure –prefix=$mysql_install_dir –enable-thread-safe-client –enable-local-infile –enable-largefile –with-charset=utf8 –with-uca –with-gnu-ld –with-pic –with-mysqld-libs –with-comment –with-query-cache –with-bench –with-big-tables –with-innodb –with-mysqld-use=mysql
make && make install
cd ..
rm -rf ${mysql_sourse_name}*
###APACHE
wget ${url}${openssl_sourse_name}”.tar.gz”
tar -zxvf $openssl_sourse_name”.tar.gz”
cd $openssl_sourse_name
./configure –prefix=$openssl_install_dir
make && make install
cd ..
rm -rf ${openssl_sourse_name}*
wget ${url}${httpd_sourse_name}”.tar.gz”
tar -zxvf $httpd_sourse_name”.tar.gz”
cd $httpd_sourse_name
./configure –prefix=$httpd_install_dir –enable-authz-dbm –enable-log-config –enable-headers –enable-setenvif –with-ssl=$openssl_install_dir –enable-static-ab –enable-http –enable-mime –enable-status –enable-suexec –enable-vhost-alias –enable-dir –enable-rewrite –with-mpm=worker
make && make install
cd ..
rm -rf ${httpd_sourse_name}*
wget ${url}${fastcgi_sourse_name}”.tar.gz”
tar -zxvf $fastcgi_sourse_name”.tar.gz”
cd $fastcgi_sourse_name
sed ’s/\/usr\/local\/apache2/\/opt\/httpd-2.2.9\//g’ Makefile.AP2 > Makefile
make && make install
cd ..
rm -rf ${fastcgi_sourse_name}*
###PHP
wget ${url}${libxml2_sourse_name}”.tar.gz”
tar -zxvf $libxml2_sourse_name”.tar.gz”
cd $libxml2_sourse_name
./configure –prefix=$libxml2_install_dir
make && make install
cd ..
rm -rf ${libxml2_sourse_name}*
wget ${url}${zlib_sourse_name}”.tar.gz”
tar -zxvf $zlib_sourse_name”.tar.gz”
cd $zlib_sourse_name
./configure –prefix=$zlib_install_dir
make && make install
cd ..
rm -rf ${zlib_sourse_name}*
wget ${url}${jpeg_sourse_name}”.tar.gz”
tar -zxvf $jpeg_sourse_name”.tar.gz”
cd $jpeg_sourse_name
cp makefile.unix Makefile
make && make install
cd ..
rm -rf ${jpeg_sourse_name}*
wget ${url}${libpng_sourse_name}”.tar.gz”
tar -zxvf $libpng_sourse_name”.tar.gz”
cd $libpng_sourse_name
./configure –prefix=$libpng_install_dir
make && make install
cd ..
rm -rf ${libpng_sourse_name}*
wget ${url}${freetype_sourse_name}”.tar.gz”
tar -zxvf $freetype_sourse_name”.tar.gz”
cd $freetype_sourse_name
./configure –prefix=$freetype_install_dir
make && make install
cd ..
rm -rf ${freetype_sourse_name}*
wget ${url}${php_sourse_name}”.tar.gz”
tar -zxvf $php_sourse_name”.tar.gz”
./php-5.2.6/configure –enable-cli –enable-cgi –enable-fastcgi –enable-force-cgi-redirect –enable-discard-path –enable-path-info-check –with-openssl –with-pcre-regex –enable-calendar –enable-dom –enable-ftp –with-openssl-dir=/usr/local/openssl –enable-gd-jis-conv –enable-hash –with-iconv –enable-json –enable-mbstring –enable-mbregex –enable-pdo –enable-posix –enable-libxml –enable-simplexml –with-sqlite –enable-tokenizer –enable-xmlreader –enable-xmlwriter –with-zlib=/usr/local/zlib –with-freetype-dir=/usr/local/freetype –with-gd –with-jpeg-dir=/usr/lib/libjpeg.so.62.0.0
先安装openssl
./configure –enable-authz-dbm –enable-log-config –enable-headers –enable-setenvif –with-ssl=/usr/local/ssl –enable-static-ab –enable-http –enable-mime –enable-status –enable-suexec –enable-vhost-alias –enable-dir –enable-rewrite –with-mpm=worker
fastcgi
cp Makefile.AP2 Makefile
make make install
mysql 编译参数
./configure –enable-thread-safe-client –enable-local-infile –enable-largefile –with-charset=utf8 –with-uca –with-gnu-ld –with-pic –with-mysqld-libs –with-comment –with-query-cache –with-bench –with-big-tables –with-innodb –with-mysqld-use=mysql
/usr/local/bin/mysql_install_db
/usr/local/bin/mysqld_safe –user mysql
如果安装时候有错误提示,也许是缺少这个组件 http://www.sunboyu.cn/sourse/termcap-1.3.1.tar.gz
]]>memcached http://www.danga.com/memcached/dist/memcached-1.2.5.tar.gz
memcache http://pecl.php.net/get/memcache-3.0.1.tgz
libevent http://www.monkey.org/~provos/libevent-1.2a.tar.gz
目前想到的功能大概有这些,想到再加。
目前正在研究每一个组件的性能和参数。
]]>最近写一个认证服务器,需要进行不同程序,不同数据库之间的数据交换,认证服务器提供认证功能,而客户端可能是多种语言开发的。如果实用传统的方式,比如C,或者java开发一个稳定的服务端,人力精力都是问题,只能寻求一种简单的方式进行过渡。
这里我选择了Web Service这种方式,但这种方式也存在一定问题:速度。网上普遍反映速度是问题,soap的方式本身负载是问题,实用xmlrpc,http方式,瓶颈在于webserver的负载能力。但是项目发展初期,此方式完全能满足一段时间,而这段时间我们也能平滑过渡,留出时间进行更深层次的研究。
]]>