红联Linux门户
Linux帮助

Linux配置APACHE2.0.55 +PHP5.1.1+MYSQL5.0.16+GD库

发布时间:2006-03-21 00:41:48来源:红联作者:电脑博士
redhat linux9.0下配置APACHE2.0.55 +PHP5.1.1+MYSQL5.0.16+GD库

首先,服务器GCC要有,不然什么都不能做.可以用gcc -v来查看是否安装了GCC,
#gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-34)

有以上类似信息说明已有GCC,
如果你没有,请先拿安装光盘装好它

请下载以下所有的东西:
httpd-2.0.55.tar.gz
MySQL-client-5.0.16-0.i386.rpm
MySQL-server-5.0.16-0.i386.rpm
MySQL-devel-5.0.16-0.i386.rpm
php-5.1.1.tar.gz

ZendOptimizer-2.5.3-linux-glibc21-i386.tar.gz

gd-2.0.28.tar.gz
libxml2-2.6.11.tar.gz
zlib-1.2.1.tar.gz
jpegsrc.v6b.tar.gz
libpng-1.2.5.tar.gz

xpm-3.4k-2.i386.rpm
gd-devel-1.8.4-11.i386.rpm

可能你的电脑不需要这么多.但最好都下载吧.

不过,可能你看到这贴子的时候会有以上软件新的版本下载了.看着办吧.

开始装吧>>>>>>>>>>>>>>>>>>>>>>>>>

先安装MYSQL 服务器

#rpm -ivh MySQL-server-5.0.16-0.i386.rpm

接着客户端

#rpm -ivh MySQL-client-5.0.16-0.i386.rpm
安装mysql-devel
#rpm -ivh MySQL-devel-5.0.16-0.i386.rpm(没有它不能安装php5.1.1)

安装好后试试能不能用

#mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 27651 to server version: 4.0.20-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

说明OK
请自己改mysql的密码

安装GD库基本包

#rpm -ivh gd-devel-1.8.4-11.i386.rpm

安装XPM支持

#rpm -ivh xpm-3.4k-2.i386.rpm

安装libxml2 (记得PHP5.1.1只支持libxml2-2.6.11以上版本)
#tar zxvf libxml2-2.6.11.tar.gz
#cd libxml2-2.6.11
#./configure
#make
#make install

开始装GD库支持
-------------------------------------------------------
ZLIB
#tar zxvf zlib-1.2.1.tar.gz
#cd zlib-1.2.1
#./configure
#make
#make install

JPEGSRC
#tar zxvf jpegsrc.v6b.tar.gz
#cd jpegsrc-6b
#./configure
#make
#make install-lib
#make install

LIBPNG
#tar zxvf libpng-1.2.5.tar.gz
#cd libpng-1.2.5
#cp scripts/makefile.std Makefile
#make
#make install

最后是GD2.*

gd-2.0.28
#tar zxvf gd-2.0.28.tar.gz
#cd gd-2.0.28
#./configure --with-png=/usr/local --with-jpeg=/usr/local --with-freetype=/usr
#make
#make install
----------------------------------------------
上面一切都很顺利的话,GD就算成功的安装上了. 如果有问题,应该是缺少支持包,总之是少什么就下载什么来安装上.

跟着下来,开始安装APAHCHE2和PHP5

#tar zxvf httpd-2.0.55.tar.gz
#cd httpd-2.0.55
#./configure --prefix=/usr/local/apache2 --enable-module=so
#make
#make install

#tar zxvf php-5.1.1.tar.gz
#cd php-5.1.1
#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-gd=/usr/local --enable-trace-vars --with-zlib-dir=/usr/local -with-mysql=/var/lib/mysql
#make
#make install
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
我是把他们分别安装在/usr/local/apache2 & PHP目录下的
所有的安装工作做好了,接着我们来配置.

复制PHP.INI文件到正确位置
在PHP目录下运行
#cp php.ini-dist /usr/local/php/lib/php.ini

编辑apache配置文件httpd.conf
#vi /usr/local/apache2/conf/httpd.conf

要改的有如下几处:

一般都在
#AddType application/x-tar .tgz
下加一行
AddType application/x-httpd-php .php

还有找到
DirectoryIndex index.html index.html.var
在后面加 index.php 让它把index.php做为默认页

再找
#ServerName
把#去掉,后面的IP改成你的IP.

找到
DocumentRoot "/usr/local/apache2/htdocs"
把/usr/local/apache2/htdocs改为你存放网页文件的路径
比如我是放在/myweb目录下,所以我以后上传PHP文件就放在/myweb目录下,然后用IP访问,就能看到首页了

差不多就这些了,至于apache2其它优化,请看www.phpv.net 里的apache配置那一分类.

保存httpd.conf文件.

启动它
# /usr/local/apache2/bin/apachectl start
如果没有出错,写一个测试页放到你网页目录下, 我的就是上面所说的 /myweb
#vi /home/easy/index.php
phpinfo();

保存.试试在测试器里打IP进去就可以看到PHPINFO页了

好了.如无意外.你现在可以放心在你的机器上运行PHP脚本连接mysql了.

用ZendOptimizer-2.5.3加速PHP

#tar zxvf ZendOptimizer-2.5.3-linux-glibc21-i386.tar.gz
#cd ZendOptimizer-2.5.3-linux-glibc21-i386
#./install.sh

一路默认下去应该就好了.
再看看测试页,

找找是不是这样的?
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.3, Copyright (c) 2003-2004, by Zend Technologies with Zend Optimizer v2.5.3, Copyright (c) 1998-2004, by Zend Technologies
文章评论

共有 95 条评论

  1. 221.200.50.* 于 2007-09-05 16:36:42发表:

    http://emeraldring.fora.pl/
    http://emeraldring.fora.pl/
    http://emeraldring.fora.pl/ - emerald cut wedding ring

  2. 69.147.76.* 于 2007-09-05 16:36:39发表:

    http://emeraldring.fora.pl/
    http://emeraldring.fora.pl/
    http://emeraldring.fora.pl/ - emerald cut wedding ring

  3. 212.158.128.* 于 2007-09-04 11:42:48发表:

    child defense fund
    child defense fund
    child defense fund - http://fund.freewebpages.org/child-defense-fund/index.html
    free fund raising idea
    free fund raising idea
    free fund raising idea - http://fund.freewebpages.org/free-fund-raising-idea/index.html
    fund raising company
    fund raising company
    fund raising company - http://fund.freewebpages.org/fund-raising-company/index.html

  4. 60.190.223.* 于 2007-09-04 11:42:36发表:

    child defense fund
    child defense fund
    child defense fund - http://fund.freewebpages.org/child-defense-fund/index.html
    free fund raising idea
    free fund raising idea
    free fund raising idea - http://fund.freewebpages.org/free-fund-raising-idea/index.html
    fund raising company
    fund raising company
    fund raising company - http://fund.freewebpages.org/fund-raising-company/index.html

  5. 204.39.95.* 于 2007-09-02 09:42:03发表:

    Hi, nice very nice page..!
    state insurance fund
    mutual fund company - http://fund.freewebpages.org/fund-raising-counselor-organization/index.html
    cookie dough fund raiser
    fund raising counselor organization - http://fund.freewebpages.org/memorial-scholarship-fund/index.html
    cookie dough fund raiser

    Good luck !
    PS: do you listen Linkin Park ?

  6. 207.44.238.* 于 2007-09-01 01:38:31发表:

    Hi, nice very nice page..!
    fund raising counselor organization
    abb fund
    fund raising cook book - http://fund.freewebpages.org/mutual-fund-company/index.html
    alaska permanent fund dividend
    mutual fund company - http://fund.freewebpages.org/state-insurance-fund/index.html

    Good luck !
    PS: do you listen Linkin Park ?

  7. 88.208.219.* 于 2007-08-30 17:55:33发表:

    Hi, nice very nice page..!
    child defense fund - http://fund.freewebpages.org/fund-novel-raising/index.html
    hedge funds
    sample fund raising letter - http://fund.freewebpages.org/hedge-funds/index.html
    fund novel raising
    mutual fund research - http://fund.freewebpages.org/free-fund-raising-idea/index.html

    Good luck !
    PS: do you listen Linkin Park ?

  8. 0.0.0.* 于 2007-08-29 13:16:58发表:

    Hi, nice very nice page..!
    money banking and financial market
    best rate on money market account - http://www.volny.cz/businessmoney/best-rate-on-money-market-account
    money market fund
    best money market rate
    best money market

    Good luck !
    PS: do you listen Linkin Park ?

  9. 201.37.150.* 于 2007-08-27 23:57:44发表:

    Hi, nice very nice page..!
    money market account
    high yield money market account
    vanguard money market funds - http://www.volny.cz/bestmoney/make-money-in-stock-market/
    money market
    money market savings account - http://www.volny.cz/bestmoney/best-money-market/

    Good luck !
    PS: do you listen Linkin Park ?

  10. 82.135.85.* 于 2007-08-26 02:55:30发表:

    Hi, nice very nice page..!
    vanguard money market funds
    best rate on money market account
    money market fund
    money market account rate
    money market savings account

    Good luck !
    PS: do you listen Linkin Park ?

  11. 0.0.0.* 于 2007-08-14 15:30:58发表:

    good work !
    chandelier lamp shades
    chandelier lamp shades
    chandelier lamp shades - www.desklamp1.fora.pl


    buy viagra online
    buy viagra online
    buy viagra online - www.buyviagraonlinex.fora.pl

    .
    norwegian pearl
    norwegian pearl
    norwegian pearl - http://volny.cz/norwegianpearl
    blackberry pearl white
    blackberry pearl white
    blackberry pearl white - http://volny.cz/blackberrypearlwhite
    pink pearls
    pink pearls
    pink pearls - http://volny.cz/pinkpearls
    blackberry pearl review
    blackberry pearl review
    blackberry pearl review - http://volny.cz/blackberrypearlrev
    pearl white
    pearl white
    pearl white - http://volny.cz/pearlwhite
    good luck

  12. 81.169.173.* 于 2007-08-07 23:16:19发表:

    desk lamp
    desk lamp - www.halogendesklamp.freehostia.com/desk-lamp/

    lamp shades
    lamp shades - www.halogendesklamp.freehostia.com/lamp-shades/

    office desk lamp
    office desk lamp - www.halogendesklamp.freehostia.com/office-desk-lamp/

  13. 213.132.175.* 于 2007-08-05 21:19:52发表:

    nice site... look on my site

    http://www.desklamp.fora.pl - desk lamp
    http://www.lampshades.fora.pl - lamp shades

  14. 217.141.109.* 于 2007-08-04 05:45:39发表:

    thnx... nice site
    and i wan't see my:
    http://www.tablelamp.fora.pl/
    http://www.tablelamp.fora.pl/
    http://www.tablelamp.fora.pl/ - table lamp

  15. 217.141.105.* 于 2007-08-02 16:27:47发表:

    diesel ford truck used
    diesel ford truck used
    diesel ford truck used - http://www.bcars.fora.pl/

    car insurance quote
    car insurance quote
    car insurance quote - http://www.carinsurancequote.fora.pl/

  16. 85.126.64.* 于 2007-08-01 00:16:31发表:

    gmc trucks here www.gmctruck.fora.pl
    gmc from america www.gmctruck.fora.pl
    real gmc www.gmctruck.fora.pl


    and www.emeraldring.fora.pl rings

  17. 201.69.82.* 于 2007-07-17 10:59:02发表:

    http://d9e80101b0c365245476a41704b9186f-t.xkktxb.org d9e80101b0c365245476a41704b9186f http://d9e80101b0c365245476a41704b9186f-b1.xkktxb.org d9e80101b0c365245476a41704b9186f http://d9e80101b0c365245476a41704b9186f-b3.xkktxb.org 8d1f2bfe3cbc5359328d95464cab8b7c