<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[Centos5.5下编译安装AMP环境]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 05 Oct 2010 13:19:50 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	centos最近发布了5.5版本，但AMP软件包并没有升级（Apache2.2.3/php5.1.6/mysql.5.0.40);所以为了能使用最新稳定版，需要自己编译安装。下面是具体的安装步骤，对于优化细节暂不做多的考虑。<br/><br/>1.准备相应的软件包。<br/><br/>下载相应的软件包放在/usr/local/src目录下。<br/><br/>查看源代码打印帮助1 cd /usr/local/src&nbsp;&nbsp;<br/><br/>2&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>3 wget http://labs.renren.com/apache-mirror/httpd/httpd-2.2.15.tar.gz&nbsp;&nbsp;<br/><br/>4&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>5 wget http://mirrors.sohu.com/php/php-5.2.13.tar.gz&nbsp;&nbsp;<br/><br/>6&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>7 wget http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.48.tar.gz <br/><br/>2.安装mysql<br/><br/>在编译安装mysql之前。需先装ncurses；<br/><br/>查看源代码打印帮助01 wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.7.tar.gz&nbsp;&nbsp;<br/><br/>02&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>03 chmod +x ncurses-5.7.tar.gz&nbsp;&nbsp;<br/><br/>04&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>05 tar xzvf ncurses-5.7.tar.gz&nbsp;&nbsp;<br/><br/>06&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>07 ./configure --with-shared --with-normal --with-debug --enable-overwrite&nbsp;&nbsp;<br/><br/>08&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>09 make&nbsp;&nbsp;<br/><br/>10&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>11 make install <br/><br/>编译安装mysql。注意–with-innodb是安装innodb引擎。<br/><br/>查看源代码打印帮助01 tar xzvf mysql-5.1.48.tar.gz&nbsp;&nbsp;<br/><br/>02&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>03 cd mysql-5.1.48&nbsp;&nbsp;<br/><br/>04&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>05 groupadd db&nbsp;&nbsp;<br/><br/>06&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>07 useradd -g db mysql&nbsp;&nbsp;<br/><br/>08&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>09 passwd mysql&nbsp;&nbsp;<br/><br/>10&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>11 ./configure --prefix=/usr/local/mysql --enable-assembler&nbsp;&nbsp;--with-mysqld-ldflags=-all-static&nbsp;&nbsp;--with-client-ldflags=-all-static --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all&nbsp;&nbsp;--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock --with-mysqld-user=mysql --with-innodb&nbsp;&nbsp;<br/><br/>12&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>13 make&nbsp;&nbsp;<br/><br/>14&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>15 make install&nbsp;&nbsp;<br/><br/>16&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>17 cd /usr/local/mysql&nbsp;&nbsp;<br/><br/>18&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>19 cp share/mysql/my-medium.cnf /etc/my.cnf&nbsp;&nbsp;<br/><br/>20&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>21 cp /usr/local/src/mysql-5.1.43/support-files/mysql.server /etc/init.d/mysqld&nbsp;&nbsp;<br/><br/>22&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>23 ./bin/mysql_install_db&nbsp;&nbsp;<br/><br/>24&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>25 ./bin/mysqld_safe &amp; <br/><br/>可能出现的问题，在启动/etc/init.d/mysqld start出现MySQL manager or server PID file could not be found! [FAILED]<br/><br/>解决办法：打开vi /etc/my.cnf文件，在[mysqld]下面加入如下配置<br/><br/>查看源代码打印帮助1 basedir = /usr/local/mysql&nbsp;&nbsp;<br/><br/>2&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>3 datadir = /usr/local/mysql/data&nbsp;&nbsp;<br/><br/>4&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>5 log-error = /usr/local/mysql/log/alert.log&nbsp;&nbsp;<br/><br/>6&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>7 log_slow_queries = /usr/local/mysql/log/slow.log <br/><br/>3 安装Apache<br/><br/>查看源代码打印帮助1 tar xzvf httpd-2.2.15.tar.gz&nbsp;&nbsp;<br/><br/>2&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>3 cd httpd-2.2.15&nbsp;&nbsp;<br/><br/>4&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>5 ./configure --prefix=/usr/local/apache2/ <br/><br/>4安装PHP<br/><br/>在安装PHP之前，需要先安装libxml2软件包，不然在编译过程中会出现configure: error: xml2-config not found. Please check your libxml2 installation。<br/><br/>查看源代码打印帮助1 yum install libxml2-devel <br/><br/>下面是编译安装php的具体过程<br/><br/>查看源代码打印帮助01 tar xzvf php-5.2.13.tar.gz&nbsp;&nbsp;<br/><br/>02&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>03 cd php-5.2.13&nbsp;&nbsp;<br/><br/>04&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>05 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config&nbsp;&nbsp;<br/><br/>06&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>07 make&nbsp;&nbsp;<br/><br/>08&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>09 make test&nbsp;&nbsp;<br/><br/>10&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>11 make install&nbsp;&nbsp;<br/><br/>12&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>13 cp php-dist /usr/local/php/lib/php.ini <br/><br/>5安装完毕后，需要配置 php.ini和httpd.conf<br/><br/>打开vi /etc/local/php/lib/php.ini,查找”include_path” 加入路径”/usr/local/php/lib”;<br/><br/>打开vi /usr/local/apache2/conf/http.conf。加入如下指令<br/><br/>查看源代码打印帮助01 &lt;/pre&gt;&nbsp;&nbsp;<br/><br/>02 AddType application/x-httpd-php .php&nbsp;&nbsp;<br/><br/>03&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>04 AddType application/x-httpd-php-source .phps&nbsp;&nbsp;<br/><br/>05&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>06 &lt;IfModule dir_module&gt;&nbsp;&nbsp;<br/><br/>07&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>08 DirectoryIndex index.php index.html&nbsp;&nbsp;<br/><br/>09&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>10 &lt;/IfModule&gt;&nbsp;&nbsp;<br/><br/>11&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>12 keepAlive Off&nbsp;&nbsp;<br/><br/>13&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>14 &lt;IfModule prefork.c&gt;&nbsp;&nbsp;<br/><br/>15&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>16 StartServers 5&nbsp;&nbsp;<br/><br/>17&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>18 MinSpareServers 5&nbsp;&nbsp;<br/><br/>19&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>20 MaxSpareServers 10&nbsp;&nbsp;<br/><br/>21&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>22 MaxClients 255&nbsp;&nbsp;<br/><br/>23&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>24 MaxRequestsPerchild 10&nbsp;&nbsp;<br/><br/>25&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>26 &lt;/IfModule&gt;&nbsp;&nbsp;<br/><br/>27 &lt;pre&gt; <br/><br/>6 使用apxs安装编译过程中没有安装的Apache模块<br/><br/>如果在编译Apache的过程中，没有使用–with-rewrite选项。则需要增加mod_rewrite模块。以下是安装过程<br/><br/>查看源代码打印帮助1 &lt;/pre&gt;&nbsp;&nbsp;<br/><br/>2 cd /usr/local/apach2/modules/mappers&nbsp;&nbsp;<br/><br/>3&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>4 /usr/local/apache2/bin/apxs -i -a -c mod_rewrite.c&nbsp;&nbsp;<br/><br/>5 &lt;pre&gt; <br/><br/>在httpd.conf中查看LoadModule rewrite_module modules/mod_rewrite.so是否开启。AllowOverride 改为All<br/><br/>7 使用php-config安装编译过程中没有安装的PHP模块<br/><br/>安装gettext<br/><br/>查看源代码打印帮助01 &lt;/pre&gt;&nbsp;&nbsp;<br/><br/>02 cd /usr/local/src/php-5.1.13/etc&nbsp;&nbsp;<br/><br/>03&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>04 cd ./gettext&nbsp;&nbsp;<br/><br/>05&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>06 /usr/local/php/bin/phpize&nbsp;&nbsp;<br/><br/>07&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>08 ./configure --with-php-config=/usr/local/php/bin/php-config&nbsp;&nbsp;<br/><br/>09&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>10 make&nbsp;&nbsp;<br/><br/>11&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>12 make install&nbsp;&nbsp;<br/><br/>13 &lt;pre&gt; <br/><br/>安装gd<br/><br/>查看源代码打印帮助01 &lt;/pre&gt;&nbsp;&nbsp;<br/><br/>02 yum install libpng-devel&nbsp;&nbsp;<br/><br/>03&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>04 yum install libjepg-devel&nbsp;&nbsp;<br/><br/>05&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>06 yim install freetype-devel&nbsp;&nbsp;<br/><br/>07&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>08 cd /usr/local/src/php-5.1.13/etc/gd&nbsp;&nbsp;<br/><br/>09&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>10 /usr/local/php/bin/phpize&nbsp;&nbsp;<br/><br/>11&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>12 ./configure --with-php-config=/usr/local/php/bin/php-config&nbsp;&nbsp;<br/><br/>13&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>14 make&nbsp;&nbsp;<br/><br/>15&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>16 make install&nbsp;&nbsp;<br/><br/>17 &lt;pre&gt; <br/><br/>安装完毕后gettext.so和gd.so写到php.ini文件中.(extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/<br/><br/>gettext.so)<br/><br/>同理。安装mcrypt。在安装mcrypt之前注意先安装yum install libmcrypt libmcrypt-devel<br/><br/>出现的问题：<br/>问题一：PHP安装GD库后发现无法处理JPEG，JPG类型的图片；<br/>解决办法：首先查看系统GD库文件存在哪些.输入命令：gdlib-config –all 结果如下：<br/><br/>includedir: /usr/include<br/>cflags: -I/usr/include<br/>ldflags: -L/usr/lib<br/>libs: -lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng12 -lz -lm<br/>libdir: /usr/lib<br/>features: GD_XPM GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG GD_GIF<br/><br/>有GD_JPEG说明libjpeg.so动态库在/usr/lib目录下。出现问题的原因应该是编译安装GD库是没有指名JPEG的路径。所以，重新编译下GD库。方法如下<br/>cd /usr/local/src/php-5.2.13/ext/gd<br/>./configure --with-php-config=/usr/local/php/bin/php-config --with-jpeg-dir=/usr/lib<br/>make<br/>make install<br/>/etc/init.d/apache restart<br/>问题解决。<br/>来源：http://www.cardii.net/centos5-5-compile-installed-amp-environment/
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] Centos5.5下编译安装AMP环境]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>