<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.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://www.jackxiang.com/post/555/</link>
<title><![CDATA[[精华文章]linux下安装php运行环境]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Thu, 02 Aug 2007 02:23:17 +0000</pubDate> 
<guid>http://www.jackxiang.com/post/555/</guid> 
<description>
<![CDATA[ 
	linux下安装php运行环境<br/>Submitted by phpox on 2007, April 16, 12:44 PM. Linux<br/><br/>首先我在 /root 目录下建了一个 soft 文件夹来保存我要安装的源码包<br/>mkdir /root/soft<br/>cd /root/soft<br/><br/>先找到 apache php mysql proftpd 源码包下载的URL地址<br/>请浏览<br/>http://www.apache.org<br/>http://www.php.net<br/>http://www.mysql.com<br/>http://www.proftpd.org/<br/><br/><br/>第一步：安装apache<br/>注：当前目录为/root/soft ，<br/>目录下有<br/>httpd-2.0.55.tar.gz, php-5.0.5.tar.gz<br/>等二进制源码包<br/>#号代表为root 根权限,#后是输入的一条命令<br/><br/>执行下列命令<br/>解压源码包<br/># tar -zxf httpd-2.0.55.tar.gz<br/>进入安装目录<br/># cd httpd-2.0.55<br/>配置apache安装信息<br/># ./configure --prefix=/usr/local/apache --enable-modules=so --enable-rewrite<br/>执行make安装<br/># make; make install<br/>安装完后<br/># vi /usr/local/apache/conf/httpd.conf<br/>找到 prefork.c 下的<br/>MaxClients 150<br/>改为<br/>ServerLimit 2000<br/>MaxClients 1000<br/>apache默认工作在prefork.c模式下，并发进程为150，超过后就无法访问，150是远远不够的，所以这里按自己网站的需求改， 如1000<br/>由于apache默认最大并发进程是 256 所以要先设置 ServerLimit 2000 将服务器可设的最大并发数设为2000, 然后再设置最大并发数 MaxClients 1000<br/><br/>找到 #ServerName www.example.com:80 在其下设置 ServerName 如下<br/>ServerName www.mysite.com<br/>基中 www.mysite.com 为你网站名，也可用IP代替<br/>找到 DocumentRoot "/usr/local/apache/htdocs"<br/>设置你的 WEB 服务器的根目录 如<br/>DocumentRoot "/myweb"<br/>找到 DirectoryIndex index.html index.html.var 改为<br/>DirectoryIndex index.html index.php index.htm<br/>找到 ForceLanguagePriority Prefer Fallback 在其下加上<br/>AddDefaultCharset gb2312<br/>改完后保存(vi 的用法请查 Linux vi 命令)<br/>用下面命令启动WEB服务器<br/># /usr/local/apache/bin/apachectl start<br/>查看自己的站点是否正常 http://www.mysite.com 也可用IP<br/>用 # /usr/local/apache/bin/apachectl stop 可停止服务<br/><br/><br/>安装MYSQL<br/># tar -zxf mysql-standard-5.0.15-linux-i686.tar.gz<br/># cp -r mysql-standard-5.0.15-linux-i686 /usr/local/mysql<br/># vi /usr/local/mysql/support-files/my-medium.cnf<br/>在后面加上<br/>max_connections = 1000<br/>log-slow-queries<br/>long_query_time = 5<br/>注 max_connections 为允许的最大连接数<br/>log-slow-queries 打开低速查询日志<br/>long_query_time 低速查询的秒数（运行一句sql达到此时间记录在日志里）<br/>然后COPY 它为 /etc/my.cnf 文件<br/># cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf<br/>添加mysql用户及用户组<br/># groupadd mysql<br/># useradd -g mysql mysql<br/>修改mysql目录权限<br/># chown -R root /usr/local/mysql<br/># chgrp -R mysql /usr/local/mysql<br/># chown -R mysql /usr/local/mysql/data<br/>生成mysql系统数据库<br/># /usr/local/mysql/scripts/mysql_install_db --user=mysql&<br/>启动mysql服务<br/># /usr/local/mysql/bin/mysqld_safe --user=mysql&<br/>如出现 Starting mysqld daemon with databases from /usr/local/mysql/data<br/>代表正常启动mysql服务了, 按Ctrl + C 跳出<br/>修改 mysql 的 root 密码<br/># /usr/local/mysql/bin/mysqladmin -u root -p password 123456<br/>回车出现 Enter password: 最开始密码默认为空 继续回车即可<br/>123456 即为你的新密码<br/><br/>安装GD库(让PHP支持GIF,PNG,JPEG)<br/>首先下载 jpeg6,libpng,freetype 并安装模块<br/>wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz<br/>wget http://nchc.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8.tar.gz<br/>wget http://keihanna.dl.sourceforge.net/sourceforge/freetype/freetype-2.1.10.tar.gz<br/>wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz<br/><br/>安装 jpeg6<br/>建立目录<br/># mkdir /usr/local/jpeg6<br/># mkdir /usr/local/jpeg6/bin<br/># mkdir /usr/local/jpeg6/lib<br/># mkdir /usr/local/jpeg6/include<br/># mkdir /usr/local/jpeg6/man<br/># mkdir /usr/local/jpeg6/man/man1<br/># cd /root/soft<br/># tar -zxf jpegsrc.v6b.tar.gz<br/># cd jpeg-6b<br/># ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static<br/># make; make install<br/><br/>安装libpng<br/># cd /root/soft<br/># tar -zxf libpng-1.2.8.tar.gz<br/># cd libpng-1.2.8<br/># cp scripts/makefile.std makefile<br/># make; make install<br/><br/>安装 freetype<br/># cd /root/soft<br/># tar -zxf freetype-2.1.10.tar.gz<br/># cd freetype-2.1.10<br/># ./configure --prefix=/usr/local/freetype<br/># make;make install<br/><br/>安装最新的GD库<br/># cd /root/soft<br/># tar -zxf gd-2.0.33.tar.gz<br/># cd gd-2.0.33<br/># ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ --with-png --with-zlib --with-freetype=/usr/local/freetype/<br/># make; make install<br/><br/>安装最新的Curl库<br/># cd /root/soft<br/># wget http://curl.haxx.se/download/curl-7.15.0.tar.gz<br/># tar -zxf curl-7.15.0.tar.gz<br/># ./configure --prefix=/usr/local/curl<br/># make; make install<br/><br/>安装PHP<br/><br/>由于php5需libxml2的支持, 所以先下载并安装libxml2<br/># cd /root/soft<br/># wget http://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/libxml2-2.6.19.tar.gz<br/># tar -zxf libxml2-2.6.19.tar.gz<br/># cd libxml2-2.6.19<br/># ./configure --prefix=/usr/local/libxml2<br/># make; make install<br/><br/>安装 libxslt<br/># cd /root/soft<br/># wget http://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1/libxslt-1.1.15.tar.gz<br/># tar -zxf libxslt-1.1.15.tar.gz<br/># cd libxslt-1.1.15<br/># ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2<br/># make; make install<br/><br/># tar -zxf php-5.0.5.tar.gz<br/># cd php-5.05<br/># ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/ --with-curl=/usr/local/curl --enable-ftp --with-libxml-dir=/usr/local/libxml2 --with-expat-dir=/usr/lib --enable-soap --with-xsl=/usr/local/libxslt --enable-xslt --with-gd=/usr/local/gd2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-zlib-dir=/usr/lib --with-png --with-freetype-dir=/usr/local/freetype<br/># make<br/># make install<br/><br/>其中./configure 后的<br/>--prefix=/usr/local/php<br/>--with-apxs2=/usr/local/apache/bin/apxs<br/>--with-mysql=/usr/local/mysql/<br/>--with-libxml-dir=/usr/local/libxml2<br/>是必要的选项<br/><br/>--with-gd=/usr/local/gd2/<br/>--with-jpeg-dir=/usr/local/jpeg6/<br/>--with-png<br/>--with-zlib-dir=/usr/lib<br/>--with-freetype-dir=/usr/local/freetype<br/>这是让PHP支持GD库的配置选项<br/><br/>--with-curl=/usr/local/curl 支持CURL库<br/>--enable-ftp 打开FTP库函数支持<br/><br/>--enable-soap --with-xsl=/usr/local/libxslt --enable-xslt<br/>让PHP支持SOAP, 上面这些一般用得少, 可以去掉<br/><br/>配置 httpd.conf 让apache支持PHP<br/># vi /usr/local/apache/conf/httpd.conf<br/>找到 AddType application/x-gzip .gz .tgz 在其下添加如下内容<br/>AddType application/x-httpd-php .php<br/>AddType application/x-httpd-php-source .phps<br/><br/>重启apache<br/># /usr/local/apache/bin/apachectl restart<br/>在你Web目录里建一内容为 <? phpinfo(); ?> PHP文件, 输入URL地址查看PHP配置是否正确<br/><br/><br/>安装 phpmyadmin<br/>下载<br/># cd /root/soft<br/># wget http://nchc.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.6.4-pl3.tar.gz<br/># tar -zxf phpMyAdmin-2.6.4-pl3.tar.gz<br/># vi phpMyAdmin-2.6.4-pl3/config.inc.php<br/>找到 $cfg['Servers'][$i]['auth_type'] = 'config'; 将config 改为 http<br/>保存后<br/>mv phpMyAdmin-2.6.4-pl3 /你的phpmyadmin目录<br/>关于mysql4.1-4移植4.0旧数据库中文乱码问题的解决方法<br/>进入phpmyadmin管理<br/>建立你数据库名并选上 gb2312_bin 的编码<br/>然后导入你先前备份好的SQL文件, 导入时选择 文件的字符集：gb2312<br/>完成后就OK了<br/>注: PHP连接mysql4.1和5.0 数据库后需指定字符集 需执行如 mysql_query("SET NAMES 'gb2312' ");<br/>否则会产生中文乱码问题!
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post/555/#blogcomment51601</link>
<title><![CDATA[[评论] [精华文章]linux下安装php运行环境]]></title> 
<author>niu &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 16 Jul 2010 04:29:06 +0000</pubDate> 
<guid>http://www.jackxiang.com/post/555/#blogcomment51601</guid> 
<description>
<![CDATA[ 
	垃圾，脱了裤子放屁，太罗嗦了
]]>
</description>
</item>
</channel>
</rss>