<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[gOxiA=苏繁=SuFan Blog]]></title> 
<link>https://sufan.maytide.net/index.php</link> 
<description><![CDATA[gOxiA,苏繁,sufan,Microsoft MVP]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[gOxiA=苏繁=SuFan Blog]]></copyright>
<item>
<link>https://sufan.maytide.net/read.php/808.htm</link>
<title><![CDATA[静态编译配置Apache+PHP+GD等模块]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[开源系统]]></category>
<pubDate>Mon, 17 Jan 2005 09:36:45 +0000</pubDate> 
<guid>https://sufan.maytide.net/read.php/808.htm</guid> 
<description>
<![CDATA[ 
	经过小半个月的努力，已经两次成功了搭建Aapche+PHP环境<br/>这次的搭建纯粹为了练手和写这篇文章，不过也有一个主要的原因：之前的Linux9系统是建立在VPC2004下的，以虚拟机的方式运行，后来不知道为什么总是出现“i8252.......”的什么问题很头大，后来安装了VSRV2005，并将linux安装到下边还是这个问题，无奈之下决定将Linux的学习转到VMware下，不过我很希望使用VMware GSX3.1来虚拟Linux，可惜网络太慢了，只能用4.5.2-8848工作站版，不过感觉还是不错的，运行linux比在VPC2004下舒服的多，VSRV2005比较遗憾，可能是我应用不对路子，毕竟微软的东西，怎么能很好的支持自己最大的竞争对手呢！这次的环境如下：<br/>宿主平台：Windows XP Pro SP2 英文版<br/>虚拟平台：VMware Workstation 4.5.2-8848<br/>虚拟系统：RedHat Linux 9<br/>应用软件：Zlib-1.2.2.tar.gz<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Libpng-1.2.7.tar.gz<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Freetype-2.1.9.tar.gz<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Jpegsrc.v6b.tar.gz<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GD-2.0.33.tar.gz<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Apache_1.3.33.tar.gz<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PHP-4.3.10.tar.gz<br/>安装步骤：<br/>先安装zlib,freetype,libpng,jpeg,再装GD<br/>1.装zlib<br/><div class="code">tar zxvf zlib-1.2.2.tar.gz<br/>cd zlib-1.2.2<br/>./configure<br/>make <br/>make install</div><br/><br/>2.安装libpng<br/><div class="code">tar zxvf libpng-1.2.7.tar.tar<br/>cd libpng-1.2.7<br/>cd scripts/<br/>mv makefile.linux ../makefile<br/>cd ..<br/>make<br/>make install</div><br/>注意，这里的makefile不是用./configure生成，而是直接从scripts/里拷一个<br/><br/>3.安装freetype<br/><div class="code">tar zxvf freetype-2.1.9.tar.gz<br/>cd freetype-2.1.9<br/>./configure<br/>make<br/>make install</div><br/><br/>4.安装Jpeg<br/><div class="code">tar zxvf jpegsrc.v6b.tar.gz <br/>cd jpeg-6b/<br/>./configure --enable-shared<br/>make<br/>make install</div><br/>注意，这里configure一定要带--enable-shared参数，不然，不会生成共享库<br/>命令完成后，jpeglib.h被拷到/usr/include目录下，libjpeg.a和libjpeg.so被拷到/usr/local/lib目录下<br/><span style="color: red;">注：很奇怪，我安装了多次Jpegsrc都没有成功，重新下载安装也同样，总是提示什么目录文件找不到，很郁闷。到现在也没有解决，不过按照其他教程的先记录下来吧。</span><br/><br/>5.安装GD<br/><div class="code">tar zxvf gd-2.0.33.tar.gz <br/>cd gd-2.0.33<br/>./configure --with-png --with-freetype --with-jpeg<br/>make install</div><br/><br/>下来是重要的环节了，静态编译Apache+PHP<br/>apache第一次编译,并不要安装，因为php的编译需要apache至少已经编译过一次 <br/><div class="code">tar zvxf apache_1.3.33.tar.gz <br/>cd apache_1.3.33 <br/>./configure --prefix=/usr/local/apache </div><br/><br/>编译php <br/><div class="code">tar zvxf php4.3.10.tar.gz <br/>cd php4.3.10<br/>./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.33 --enable-bcmath --with-zlib --with-gd --with-jpeg-dir --enable-gd-native-ttf --with-ttf --with-freetype-dir --enable-memory-limit --enable-zend-multibyte --disable-ipv6 --disable-path-info-check --with-iconv --with-pear --disable-debug && <br/>make <br/>make install </div><br/><br/>第二次编译安装apache: <br/><div class="code">cd ../apache_1.3.33<br/>./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.a --enable-module=rewrite <br/>make <br/>make install </div><br/><br/>拷贝PHP配置文件php.ini:<br/><div class="code">cp ../php4.3.10/php.ini.dist /usr/local/php/lib/php.ini </div><br/><br/>修改:<div class="code">/usr/local/apache/conf/httpd.conf</div><br/><br/>查找:＜IfModule mod_mime.c＞<br/><br/>在此范围添加 <br/><div class="code">AddType application/x-httpd-php .php <br/>AddType application/x-httpd-php-source .phps </div><br/><br/>注意：apache和php的源码包在同一个目录，--with-apache=../apache_1.3.33是指向源码解压的目录 <br/><br/>可算编译安装完成了，现在启动Apache:<br/><div class="code">/usr/local/apache/bin/apachectl start</div><br/>哈哈，打开浏览器测试，成功！
]]>
</description>
</item><item>
<link>https://sufan.maytide.net/read.php/808.htm#blogcomment12</link>
<title><![CDATA[[评论] 静态编译配置Apache+PHP+GD等模块]]></title> 
<author>gOxiA &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 09 Dec 2005 14:52:04 +0000</pubDate> 
<guid>https://sufan.maytide.net/read.php/808.htm#blogcomment12</guid> 
<description>
<![CDATA[ 
	其实还是有很多问题，毕竟没有应用到生产环境中。而且大部分操作都是从网上找来的，看来熟悉这些不是一朝一夕的事情，在备注一个网址感觉对部属web服务器很有用处。<br/>http://www.qinyu.net/content/2005/02/redhat9apache2m.html
]]>
</description>
</item>
</channel>
</rss>