Warning: curl_exec() has been disabled for security reasons in /pub/host/sunboyu/sunboyu/www/wp-includes/http.php on line 1022

Warning: Cannot modify header information - headers already sent by (output started at /pub/host/sunboyu/sunboyu/www/wp-includes/http.php:1022) in /pub/host/sunboyu/sunboyu/www/wp-includes/feed-rss2.php on line 8
一个程序猿 » APACHE http://www.sunboyu.cn 时光不会倒流,脚步总要前进 Tue, 31 Jan 2012 10:50:34 +0000 http://wordpress.org/?v=2.7 en hourly 1 squid,nginx,apache几个代理软件的比较 http://www.sunboyu.cn/2009/09/13/squidnginxapache%e5%87%a0%e4%b8%aa%e4%bb%a3%e7%90%86%e8%bd%af%e4%bb%b6%e7%9a%84%e6%af%94%e8%be%83.shtml http://www.sunboyu.cn/2009/09/13/squidnginxapache%e5%87%a0%e4%b8%aa%e4%bb%a3%e7%90%86%e8%bd%af%e4%bb%b6%e7%9a%84%e6%af%94%e8%be%83.shtml#comments Sun, 13 Sep 2009 03:51:03 +0000 admin http://www.sunboyu.cn/?p=988 最近一直在研究代理缓存之类的东东,几个软件一直在瞎鼓捣,没弄出个结果,自己也稀里糊涂,总结一下几天折腾的成绩:

在并发上,nginx无疑是老大,做反向代理的时候,没有发现squid的并发方面介绍,所以暂且认为ngnix是老大,apache的稳定性有目共睹,但在并发方面的确不是很如意。

缓存方面:squid,apache都支持diskcache和memcache,根据http的head头来确定是否缓存,nginx不支持缓存,不过我在google开源上看见了新浪的水杨老大的一个东东,给nginx加上了文件缓存,不过没有大规模使用,暂时不把它当做一种解决方案。

在代理和缓存的规则上,apache很强,很强大的重写功能,尤其是强制修改http规则,不过这个功能我始终没有调试成功,no-cache的页面始终无法去缓存。

如果只是做网站的反向代理,负载均衡,nginx感觉要比squid强,性能强悍,配置方便。

如果是做代理+缓存加速,那squid的功能和稳定性还是很好的,毕竟在互联网上大量应用。

apache呢?好像没它的事情了。当然不是,有些地方可以拿他的功能当中间件使用,这个等下次分解。

]]>
http://www.sunboyu.cn/2009/09/13/squidnginxapache%e5%87%a0%e4%b8%aa%e4%bb%a3%e7%90%86%e8%bd%af%e4%bb%b6%e7%9a%84%e6%af%94%e8%be%83.shtml/feed
在windows下玩apache php不能不知的几个小设置 http://www.sunboyu.cn/2009/06/10/%e5%9c%a8windows%e4%b8%8b%e7%8e%a9apache-php%e4%b8%8d%e8%83%bd%e4%b8%8d%e7%9f%a5%e7%9a%84%e5%87%a0%e4%b8%aa%e5%b0%8f%e8%ae%be%e7%bd%ae.shtml http://www.sunboyu.cn/2009/06/10/%e5%9c%a8windows%e4%b8%8b%e7%8e%a9apache-php%e4%b8%8d%e8%83%bd%e4%b8%8d%e7%9f%a5%e7%9a%84%e5%87%a0%e4%b8%aa%e5%b0%8f%e8%ae%be%e7%bd%ae.shtml#comments Wed, 10 Jun 2009 09:09:26 +0000 admin http://www.sunboyu.cn/?p=779 1、PHPIniDir “D:\PHP5″

这样不用每次都把php.ini拷贝到C:\Windows下

2、set Path=D:\PHP5;D:\PHP5\ext;%Path%

这样不用每次把那些dll拷贝到C:\Windows\system32下

]]>
http://www.sunboyu.cn/2009/06/10/%e5%9c%a8windows%e4%b8%8b%e7%8e%a9apache-php%e4%b8%8d%e8%83%bd%e4%b8%8d%e7%9f%a5%e7%9a%84%e5%87%a0%e4%b8%aa%e5%b0%8f%e8%ae%be%e7%bd%ae.shtml/feed
限制apache http线程的带宽 http://www.sunboyu.cn/2009/05/29/%e9%99%90%e5%88%b6apache-http%e7%ba%bf%e7%a8%8b%e7%9a%84%e5%b8%a6%e5%ae%bd.shtml http://www.sunboyu.cn/2009/05/29/%e9%99%90%e5%88%b6apache-http%e7%ba%bf%e7%a8%8b%e7%9a%84%e5%b8%a6%e5%ae%bd.shtml#comments Fri, 29 May 2009 04:09:15 +0000 admin http://www.sunboyu.cn/?p=736 最近带宽告急,原因是我做了几个开源软件的下载,结果带宽持续飙升,已经到了IDC给我的限度,所以在apache上增加了mod_bw模块(mod_bandwidth).

下载 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

在虚拟主机里增加如下配置文件

  1. BandWidthModule On             #打开带宽限制功能
  2. ForceBandWidthModule On     #强制带宽限制
  3. BandWidth all 102400            #强制100KB
  4. MinBandWidth all -1

具体的配置文档可以看这里

mod_bw-08

]]>
http://www.sunboyu.cn/2009/05/29/%e9%99%90%e5%88%b6apache-http%e7%ba%bf%e7%a8%8b%e7%9a%84%e5%b8%a6%e5%ae%bd.shtml/feed
我的apache配置-mpm http://www.sunboyu.cn/2009/05/28/%e6%88%91%e7%9a%84apache%e9%85%8d%e7%bd%ae-mpm.shtml http://www.sunboyu.cn/2009/05/28/%e6%88%91%e7%9a%84apache%e9%85%8d%e7%bd%ae-mpm.shtml#comments Thu, 28 May 2009 15:13:29 +0000 admin http://www.sunboyu.cn/?p=734
  1. <ifmodule mpm_prefork_module>
  2.     StartServers              2
  3.     MinSpareServers         5
  4.     MaxSpareServers        10
  5.     MaxClients                 128
  6.     MaxRequestsPerChild    5000
  7. </ifmodule>

这个配置基本支撑http的访问,几个博客,一个论坛,还有一个哥们很大的静态并发。

以前使用的是work方式,因为不太了解,经常造成进程崩溃,又切换到了prefork方式,这次调整的比较稳定了。

]]>
http://www.sunboyu.cn/2009/05/28/%e6%88%91%e7%9a%84apache%e9%85%8d%e7%bd%ae-mpm.shtml/feed
Linux下APACHE MYSQL PHP FCgid Suexec 配置文档V1.0 http://www.sunboyu.cn/2009/05/22/linux%e4%b8%8bapache-mysql-php-fcgid-suexec-%e9%85%8d%e7%bd%ae%e6%96%87%e6%a1%a3v10.shtml http://www.sunboyu.cn/2009/05/22/linux%e4%b8%8bapache-mysql-php-fcgid-suexec-%e9%85%8d%e7%bd%ae%e6%96%87%e6%a1%a3v10.shtml#comments Fri, 22 May 2009 03:14:12 +0000 admin http://www.sunboyu.cn/?p=716 文档版本:V1.0

启动撰写时间: 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进行安装,所以,要根据你实际的网络情况进行调整配置。

Linux Centos 4.7 安装视频(下载)(关闭)

第二步:系统更新,组件安装。

首先更新一下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密码,我们可以一起调试。

]]>
http://www.sunboyu.cn/2009/05/22/linux%e4%b8%8bapache-mysql-php-fcgid-suexec-%e9%85%8d%e7%bd%ae%e6%96%87%e6%a1%a3v10.shtml/feed
还是Nginx对抗负载的能力强 http://www.sunboyu.cn/2009/04/07/%e8%bf%98%e6%98%afnginx%e5%af%b9%e6%8a%97%e8%b4%9f%e8%bd%bd%e7%9a%84%e8%83%bd%e5%8a%9b%e5%bc%ba.shtml http://www.sunboyu.cn/2009/04/07/%e8%bf%98%e6%98%afnginx%e5%af%b9%e6%8a%97%e8%b4%9f%e8%bd%bd%e7%9a%84%e8%83%bd%e5%8a%9b%e5%bc%ba.shtml#comments Tue, 07 Apr 2009 06:45:11 +0000 admin http://www.sunboyu.cn/?p=640 编译了老半天的apache,又做了很多调整和优化,依然抗不住死机,其实负载也不是很大,但内存CPU就是出奇的高,无奈,装上nginx,负载一下子下来了。

顺便提一下,我PC级的服务器。

感谢  http://www.51fit.com/ 友情提供测试数据

计划重新部署apache,调整工作模式。

]]>
http://www.sunboyu.cn/2009/04/07/%e8%bf%98%e6%98%afnginx%e5%af%b9%e6%8a%97%e8%b4%9f%e8%bd%bd%e7%9a%84%e8%83%bd%e5%8a%9b%e5%bc%ba.shtml/feed
Apache开启Gzip压缩 http://www.sunboyu.cn/2008/10/28/apache%e5%bc%80%e5%90%afgzip%e5%8e%8b%e7%bc%a9.shtml http://www.sunboyu.cn/2008/10/28/apache%e5%bc%80%e5%90%afgzip%e5%8e%8b%e7%bc%a9.shtml#comments Tue, 28 Oct 2008 05:57:00 +0000 admin http://www.sunboyu.cn/?p=366 文档位置 http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_deflate.html

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手册。

]]>
http://www.sunboyu.cn/2008/10/28/apache%e5%bc%80%e5%90%afgzip%e5%8e%8b%e7%bc%a9.shtml/feed
sunboyu-amp-mod-V1.0 alpha http://www.sunboyu.cn/2008/07/26/sunboyu-amp-mod-v10-alpha.shtml http://www.sunboyu.cn/2008/07/26/sunboyu-amp-mod-v10-alpha.shtml#comments Sat, 26 Jul 2008 05:37:47 +0000 admin http://www.sunboyu.cn/?p=222 重新做了个模块版的,这次apache使用动态编译

sunboyu-amp-isapi-v10-alpha

]]>
http://www.sunboyu.cn/2008/07/26/sunboyu-amp-mod-v10-alpha.shtml/feed
sunboyu-amp-fastcgi-V1.0 Alpha版本发布 http://www.sunboyu.cn/2008/07/24/sunboyu-amp-fastcgi-v10-alpha%e7%89%88%e6%9c%ac%e5%8f%91%e5%b8%83.shtml http://www.sunboyu.cn/2008/07/24/sunboyu-amp-fastcgi-v10-alpha%e7%89%88%e6%9c%ac%e5%8f%91%e5%b8%83.shtml#comments Thu, 24 Jul 2008 06:04:45 +0000 admin http://www.sunboyu.cn/?p=218 sunboyu-amp-fastcgi-v10-alpha

基本都配置完毕了,但整体流程没有彻底自动化,适当的时候会作出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

]]>
http://www.sunboyu.cn/2008/07/24/sunboyu-amp-fastcgi-v10-alpha%e7%89%88%e6%9c%ac%e5%8f%91%e5%b8%83.shtml/feed
Apache2 PHP5 FastCgi配置终于完成 http://www.sunboyu.cn/2008/07/23/apache2-php5-fastcgi%e9%85%8d%e7%bd%ae%e7%bb%88%e4%ba%8e%e5%ae%8c%e6%88%90.shtml http://www.sunboyu.cn/2008/07/23/apache2-php5-fastcgi%e9%85%8d%e7%bd%ae%e7%bb%88%e4%ba%8e%e5%ae%8c%e6%88%90.shtml#comments Wed, 23 Jul 2008 14:12:57 +0000 admin http://www.sunboyu.cn/?p=213 这次是使用的mod_fastcgi的一个替代品:fcgid http://fastcgi.coremail.cn/ 在功能上完全可以取代fastcgi,在性能和稳定性上还优于fastcgi(据说),不过配置起来也比fastcgi的简单,只需要加上 loadmodule fcgid_module SetHandler fcgid-script
FCGIWrapper /usr/local/bin/php-cgi .php 即可。
权限方面,呵呵,还没有测试。留档,加到我的amp的shell里。

LoadModule fcgid_module modules/mod_fcgid.so
AddHandler fcgid-script .php
FCGIWrapper /opt/php5/bin/php-cgi .php

]]>
http://www.sunboyu.cn/2008/07/23/apache2-php5-fastcgi%e9%85%8d%e7%bd%ae%e7%bb%88%e4%ba%8e%e5%ae%8c%e6%88%90.shtml/feed
amp自动安装脚本安装部分已经完成 http://www.sunboyu.cn/2008/07/22/amp%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85%e8%84%9a%e6%9c%ac%e5%ae%89%e8%a3%85%e9%83%a8%e5%88%86%e5%b7%b2%e7%bb%8f%e5%ae%8c%e6%88%90.shtml http://www.sunboyu.cn/2008/07/22/amp%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85%e8%84%9a%e6%9c%ac%e5%ae%89%e8%a3%85%e9%83%a8%e5%88%86%e5%b7%b2%e7%bb%8f%e5%ae%8c%e6%88%90.shtml#comments Tue, 22 Jul 2008 04:04:41 +0000 admin http://www.sunboyu.cn/?p=207 做个版本存档

myshell_demo

]]>
http://www.sunboyu.cn/2008/07/22/amp%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85%e8%84%9a%e6%9c%ac%e5%ae%89%e8%a3%85%e9%83%a8%e5%88%86%e5%b7%b2%e7%bb%8f%e5%ae%8c%e6%88%90.shtml/feed
LAMP自动安装脚本 http://www.sunboyu.cn/2008/07/15/lamp%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85%e8%84%9a%e6%9c%ac.shtml http://www.sunboyu.cn/2008/07/15/lamp%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85%e8%84%9a%e6%9c%ac.shtml#comments Tue, 15 Jul 2008 15:08:39 +0000 admin http://www.sunboyu.cn/?p=200 mysql,apache的基本搞定了,php的还有很多问题,先放出这些代码,方便自己操作。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

]]>
http://www.sunboyu.cn/2008/07/15/lamp%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85%e8%84%9a%e6%9c%ac.shtml/feed
打造全能优化的Linux+Apache+PHP+Mysql服务器(3) http://www.sunboyu.cn/2008/07/15/%e6%89%93%e9%80%a0%e5%85%a8%e8%83%bd%e4%bc%98%e5%8c%96%e7%9a%84linuxapachephpmysql%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%883%ef%bc%89.shtml http://www.sunboyu.cn/2008/07/15/%e6%89%93%e9%80%a0%e5%85%a8%e8%83%bd%e4%bc%98%e5%8c%96%e7%9a%84linuxapachephpmysql%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%883%ef%bc%89.shtml#comments Tue, 15 Jul 2008 06:30:24 +0000 admin http://www.sunboyu.cn/?p=199 apache部分

先安装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

]]>
http://www.sunboyu.cn/2008/07/15/%e6%89%93%e9%80%a0%e5%85%a8%e8%83%bd%e4%bc%98%e5%8c%96%e7%9a%84linuxapachephpmysql%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%883%ef%bc%89.shtml/feed
打造全能优化的Linux+Apache+PHP+Mysql服务器(2) http://www.sunboyu.cn/2008/07/15/%e6%89%93%e9%80%a0%e5%85%a8%e8%83%bd%e4%bc%98%e5%8c%96%e7%9a%84linuxapachephpmysql%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%882%ef%bc%89.shtml http://www.sunboyu.cn/2008/07/15/%e6%89%93%e9%80%a0%e5%85%a8%e8%83%bd%e4%bc%98%e5%8c%96%e7%9a%84linuxapachephpmysql%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%882%ef%bc%89.shtml#comments Tue, 15 Jul 2008 03:33:13 +0000 admin http://www.sunboyu.cn/?p=197 MYsql的安装

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

]]>
http://www.sunboyu.cn/2008/07/15/%e6%89%93%e9%80%a0%e5%85%a8%e8%83%bd%e4%bc%98%e5%8c%96%e7%9a%84linuxapachephpmysql%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%882%ef%bc%89.shtml/feed
打造全能优化的Linux+Apache+PHP+Mysql服务器(1) http://www.sunboyu.cn/2008/07/13/%e6%89%93%e9%80%a0%e5%85%a8%e8%83%bd%e4%bc%98%e5%8c%96%e7%9a%84linuxapachephpmysql%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%881%ef%bc%89.shtml http://www.sunboyu.cn/2008/07/13/%e6%89%93%e9%80%a0%e5%85%a8%e8%83%bd%e4%bc%98%e5%8c%96%e7%9a%84linuxapachephpmysql%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%881%ef%bc%89.shtml#comments Sun, 13 Jul 2008 13:05:51 +0000 admin http://www.sunboyu.cn/?p=196 fastcgi   http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz
apache2   http://apache.mirror.phpchina.com/httpd/httpd-2.2.9.tar.gz
mysql5    http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.51b.tar.gz/from/http://mysql.mirrors.arminco.com/
php5      http://cn2.php.net/distributions/php-5.2.6.tar.gz
libxml2
gd-jpeg   ftp://192.48.96.9/graphics/jpeg/jpegsrc.v6b.tar.gz
freetype  http://voxel.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.7.tar.gz
libpng    http://voxel.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.29.tar.gz
zend      http://www.zend.com/download/55

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

目前想到的功能大概有这些,想到再加。

目前正在研究每一个组件的性能和参数。

]]>
http://www.sunboyu.cn/2008/07/13/%e6%89%93%e9%80%a0%e5%85%a8%e8%83%bd%e4%bc%98%e5%8c%96%e7%9a%84linuxapachephpmysql%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%881%ef%bc%89.shtml/feed
Web Service来做简单认证服务器 http://www.sunboyu.cn/2008/07/08/web-service%e6%9d%a5%e5%81%9a%e7%ae%80%e5%8d%95%e8%ae%a4%e8%af%81%e6%9c%8d%e5%8a%a1%e5%99%a8.shtml http://www.sunboyu.cn/2008/07/08/web-service%e6%9d%a5%e5%81%9a%e7%ae%80%e5%8d%95%e8%ae%a4%e8%af%81%e6%9c%8d%e5%8a%a1%e5%99%a8.shtml#comments Tue, 08 Jul 2008 03:21:43 +0000 admin http://www.sunboyu.cn/?p=183 Web Service简介

Web Service主要是为了使原来各孤立的站点之间的信息能够相互通信、共享而提出的一种接口。 Web Service所使用的是Internet上统一、开放的标准,如HTTP、XML、SOAP(简单对象访问协议)、WSDL等,所以Web Service可以在任何支持这些标准的环境(Windows,Linux)中使用。注:SOAP协议(Simple Object Access Protocal,简单对象访问协议),它是一个用于分散和分布式环境下网络信息交换的基于XML的通讯协议。在此协议下,软件组件或应用程序能够通过标准的HTTP协议进行通讯。它的设计目标就是简单性和扩展性,这有助于大量异构程序和平台之间的互操作性,从而使存在的应用程序能够被广泛的用户访问。

最近写一个认证服务器,需要进行不同程序,不同数据库之间的数据交换,认证服务器提供认证功能,而客户端可能是多种语言开发的。如果实用传统的方式,比如C,或者java开发一个稳定的服务端,人力精力都是问题,只能寻求一种简单的方式进行过渡。

这里我选择了Web Service这种方式,但这种方式也存在一定问题:速度。网上普遍反映速度是问题,soap的方式本身负载是问题,实用xmlrpc,http方式,瓶颈在于webserver的负载能力。但是项目发展初期,此方式完全能满足一段时间,而这段时间我们也能平滑过渡,留出时间进行更深层次的研究。

]]>
http://www.sunboyu.cn/2008/07/08/web-service%e6%9d%a5%e5%81%9a%e7%ae%80%e5%8d%95%e8%ae%a4%e8%af%81%e6%9c%8d%e5%8a%a1%e5%99%a8.shtml/feed