CentOS 4.5環(huán)境構(gòu)架安裝各個相關(guān)LINUX系統(tǒng)文件
CentOS 4.5環(huán)境構(gòu)架還是比較常用的,于是我研究了一下CentOS 4.5環(huán)境構(gòu)架中安裝各種系統(tǒng),在這里拿出來CentOS 4.5環(huán)境構(gòu)架和大家分享一下,希望對大家有用。CentOS社區(qū)的Linux發(fā)行版本被稱為CentOS Linux,由于使用了由RHEL的源代碼重新編譯生成新的發(fā)行版本,CentOS Linux具有與RHEL產(chǎn)品非常好的兼容性,并且與生俱來地擁有RHEL的諸多優(yōu)秀特性。
CentOS 4.5環(huán)境構(gòu)架中安裝gd庫
libpng
http://prdownloads.sourceforge.net/libpng/libpng-1.2.8-config.tar.gz?download
tar zxvf libpng-1.2.8-config.tar.gz
cd libpng-1.2.8
./configure --prefix=/usr/local/libpng2
Make
Make install
Jpeg v6b
http://www.ijg.org/files/jpegsrc.v6b.tar.gz
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure --prefix=/usr/local/jpeg6
make
mkdir /usr/local/jpeg6
mkdir /usr/local/jpeg6/include
mkdir /usr/local/jpeg6/lib
make install-lib
mkdir /usr/local/jpeg6/bin
mkdir /usr/local/jpeg6/man
mkdir /usr/local/jpeg6/man/man1
make install
FreeType2
http://jaist.dl.sourceforge.net/sourceforge/freetype/freetype-2.1.10.tar.gz
tar zxvf freetype-2.1.10.tar.gz
./configure --prefix=/usr/local/freetype2
make
make install
GD Library gd-2.0.18
http://www.boutell.com/gd/http/gd-2.0.18.tar.gz
tar zxvf gd-2.0.18.tar.gz
./configure --prefix=/usr/local/gd2 --with-png=/usr/local/libpng2 --with-jpeg=/usr/local/jpeg6 --with-freetype=/usr/local/freetype2
make
make install
CentOS 4.5環(huán)境構(gòu)架中編譯apache的源碼
wget http://apache.mirror.phpchina.com/httpd/httpd-2.2.8.tar.gz
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite=shared --enable-deflate=shared --enable-expires=shared --with-mpm=worker
make
make install
說明
#--enable-so apache2 支持模塊動態(tài)加載
#--enable-rewrite=shared 支持 URL 重寫
#--enable-deflate=shared 支持網(wǎng)頁壓縮
#--with-mpm=worker 采用worker的mpm方式運行
#--prefix=/usr/local/apache2 安裝目錄
CentOS 4.5環(huán)境構(gòu)架中源碼編譯php
zlib-1.2.3
http://www.zlib.net/zlib-1.2.3.tar.gz
tar zxvf zlib-1.2.3.tar.gz
# ./configure --prefix=/usr/local/zlib2
# make
# make install
libxml
http://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/libxml2-2.6.19.tar.gz
# cd libxml2-2.6.19
# ./configure --prefix=/usr/local/libxml2(PHP5只支持libxml2-2.5.10以上版本)
# make
# make install
wget http://cn2.php.net/distributions/php-5.2.6.tar.gz
tar zxvf php-5.2.6.tar.gz
cd php-5.2.6
#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg-dir=/usr/local/jpeg6 --with-png-dir=/usr/local/libpng2 --with-gd=/usr/local/gd2 --with-freetype-dir=/usr/local/freetype2 --with-zlib-dir=/usr/local/zlib2 -with-mysql=/usr/local/mysql --with-libxml-dir=/usr/local/libxml2 --enable-ftp --enable-mbstring --enable-exif --disable-ipv6
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini
CentOS 4.5環(huán)境構(gòu)架中安裝Zend
wget http://downloads.phpchina.com/zend/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
# tar xzvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
# ./ZendOptimizer-3.3.3-linux-glibc21-i386/install.sh
安裝Zend Optimizer過程的最后不要選擇重啟Apache。
七整合Apache與PHP
# vi /usr/local/apache2/conf/httpd.conf
找到:
AddType application/x-gzip .gz .tgz
在該行下面添加
AddType application/x-httpd-php .php
找到:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
將該行改為
<IfModule dir_module>
DirectoryIndex index.html index.htm index.php
</IfModule>
找到:
#Include conf/extra/httpd-mpm.conf
#Include conf/extra/httpd-info.conf
#Include conf/extra/httpd-vhosts.conf
#Include conf/extra/httpd-default.conf
去掉前面的“#”號,取消注釋。
注意:以上 4 個擴展配置文件中的設(shè)置請按照相關(guān)原則進行合理配置!
修改完成后保存退出。
# /usr/local/apache2/bin/apachectl restart
CentOS 4.5環(huán)境構(gòu)架查看確認L.A.M.P環(huán)境信息
在網(wǎng)站根目錄放置 phpinfo.php 腳本。
#vi phpinfo.php
<?phpphpinfo();?>
通過檢查phpinfo中的各項信息是否正確
http://ip地址/phpinfo.php
【編輯推薦】