日期:2011-02-23 18:06:00  来源:本站整理

CentOS 5.5安装Apache2.2.6 mysql5.1.51 PHP5.2.14[服务器安全]

赞助商链接



  本文“CentOS 5.5安装Apache2.2.6 mysql5.1.51 PHP5.2.14[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:

1、Apache安装
下载apache (http://httpd.apache.org/)到tmp
解压,tar –zxvf httpd-2.2.6.tar.gz
cd httpd-2.2.6
mkdir /usr/local/apache2
./configure --prefix=/usr/local/apache2 --enable-so --enable-mods-shared=all --enable-rewrite --enable-cache


make
make install
安装apache完成,输入号令 #/usr/local/apache2/bin/apachectl -k start
启动Apache
service httpd start


2、Mysql安装
到这里下载mysql RPM(service和client),
MySQL-server-community-5.1.51-1.rhel5.i386.rpm 安装服务端
MySQL-client-community-5.1.51-1.rhel5.i386.rpm 安装客户端
MySQL-devel-community-5.1.51-1.rhel5.i386.rpm 用于php的mysql安装
rpm –ivh MySQL-server-community-5.1.51-1.rhel5.i386.rpm
rpm –ivh MySQL-client-community-5.1.51-1.rhel5.i386.rpm
rpm –ivh MySQL-devel-community-5.1.51-1.rhel5.i386.rpm

3、 PHP预备的tar包安装
安装php之前要预备:
curl-7.15.0.tar.gz
freetype-2.3.5.tar.gz
gd-2.0.35.tar.gz
gettext-0.16.1.tar.gz
jpegsrc.v6b.tar.gz
libpng-1.2.31.tar.bz2
libxml2-2.6.31.tar.gz
t1lib-5.0.0.tar.gz
tiff-3.8.2.tar.gz
zlib-1.2.3.tar.gz

3.1 安装curl-7.15.0.tar.gz
#tar zxvf curl-7.15.0.tar.gz
#cd curl-7.15.0
#mkdir /usr/local/crul
#./configure --prefix=/usr/local/curl
#make clean
#make
#make install
3.2 jpegsrc.v6b.tar.gz
#mkdir -pv /usr/local/jpeg/{,bin,lib,include,man/man1,man1}
#./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
#make clean
#make
#make install
3.3 libxml2-2.6.31.tar.gz
#tar zxvf libxml2-2.6.31.tar.gz
#cd libxml2
#mkdir usr/local/libxml2
#./configure --prefix=/usr/local/libxml2
#make clean
#make(时间大概稍长些)
#make install
#cp xml2-config /usr/bin
3.4 PDFlib-7.0.3-Linux-php.tar.gz
#tar xvf PDFlib-7.0.3-Linux-php.tar.gz
#cd pdflib
#cp bind/php5/php520mt/libpdf-php.so /usr/local/lib/
(上面的php520mt目录的同级目录中有php503,php510,php520目录,不知道是不是版本的辨别)
3.5 t1lib-5.0.0.tar.gz
#tar zxvf t1lib-5.0.0.tar.gz
#cd t1lib
#mkdir /usr/local/t1lib
#./configure --prefix=/usr/local/t1lib
#make without-doc
#make install
3.6 freetype-2.3.5.tar.gz
#tar zxvf freetype-2.3.5.tar.gz
#cd freetype
# mkdir /usr/local/freetype
#./configure --prefix=/usr/local/freetype
#make clean
#make
#make install
3.7 zlib-1.2.3.tar.gz
#tar zxvf zlib-1.2.3.tar.gz
#cd zlib-1.2.3
#./configure --shared
#make clean
#make
#make install
3.8 libpng-1.2.26.tar.gz
#tar zxvf libpng-1.2.26.tar.gz
#cd libpng
#cp scripts/makefile.linux ./makefile
#mkdir /usr/local/libpng
#./configure --prefix=/usr/local/libpng
#make clean
#make
#make install
3.9 gettext-0.16.tar.gz
#tar zxvf gettext-0.16.tar.gz
#cd gettext
#mkdir /usr/local/gettext
#./configure --prefix=/usr/local/gettext
#make clean
#make
#make install(时间稍长)
3.10 gd-2.0.35.tar.gz
#tar zxvf gd-2.0.35.tar.gz
#cd gd
#./configure --with-png=/usr/local/lib --with-zlib=/usr/local/lib --with-freetype=/usr/local/freetype/lib --with-jpeg=/usr/local/jpeg/lib
#make clean
#make
#make install4、安装PHP
下载php-5.2.14
tar gxvf php-5.2.14.tar.bz2
cd php-5.2.14
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --enable-track-vars --with-sockets --enable-sockets --with-sysvshm --with-sysvsem --with-pdflib-dir=/usr/local/lib --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/lib --enable-mbstring=all --with-zlib-dir=/usr/local/lib --with-freetype-dir=/usr/local/freetype --with-curl=/usr/local/curl --with-libxml-dir=/usr/local/libxml2/lib --with-gettext=/usr/local/gettext/lib --with-gd --with-mysql=/usr --with-mysqli=/usr/bin/mysql_config
#make clean
#make
#make test
# make install
Php.ini文件的改正
#cp php.ini-production /usr/local/lib/php.ini
#vi /usr/local/lib/php.ini
查找改正extension_dir='./'的内容(以下)
extension_dir = /usr/local/lib
增添PHP的环境变量:
暂时的 #export PATH=$PATH:/usr/local/php/bin
永久性的:在/etc下有个profile的文件,将其翻开把“export PATH=$PATH:/usr/local/php/bin”这句放在“export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC”的上一行
当即见效环境配置,不需求重启,用下号令:
. /etc/profile

5、改正apache配置文件httpd.conf
#vi /usr/local/apache2/conf/httpd.conf
查找AddType 大约在DefaultType text/plain
<IfModule mime_module>
输入以下内容
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php
(不清楚是不是必须输入这么多项)
查找DirectoryIndex index.html 在后来输入 index.php
查找确保有以下两行配置:
LoadModule php5_module modules/libphp5.so
LoadModule rewrite_module modules/mod_rewrite.so
保存文件,退出.
  以上是“CentOS 5.5安装Apache2.2.6 mysql5.1.51 PHP5.2.14[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:

  • Windows 2008R2 HyperV下安装CentOS6,网卡无痛设置
  • CentOS 6.x 利用安装光盘作为yum源
  • CentOS 下 Nginx + Keepalived 配置高可用Web站点
  • CentOS 5.8布置web缓存服务器(squid+memcached)
  • centos6.2改正yum的源为安装光盘
  • CentOS6 yum搭建Linux+Nginx+PHP+MYSQL(LNMP)
  • CentOS 6.2 安装Nginx并设置为开机服务
  • CentOS 6.2布置DNS
  • CentOS6.2利用yum安装LAMP及phpMyadmin
  • CentOS下配置PHP+phpMyAdmin
  • centos下mysql主从同步快速设置步骤分享
  • 在Windows主机上按时备份远程VPS(CentOS)数据的批处理
  • 本文地址: 与您的QQ/BBS好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

    文章评论评论内容只代表网友观点,与本站立场无关!

       评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
    Copyright © 2020-2022 www.xiamiku.com. All Rights Reserved .