RedHat linux AS 5.5+Apache2.2+MYSQL5.1.45+PHP5.3.2 配置手记

本文详细介绍了如何在 RedHat Linux AS5.5 上安装并配置 Apache2.2、MySQL5.1.45、PHP5.3.2,包括下载资源、安装步骤、参数设置等关键操作,为开发者提供了一站式的系统搭建方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

RedHat linux AS 5.5+Apache2.2+MYSQL5.1.45+PHP5.3.2 配置手记 收藏
RedHat linux AS 5.5+Apache2.2+MYSQL5.1.45+PHP5.3.2

安装MYSQL
下载各个版本的MYSQL地址:http://ftp.linux.co.kr/pub/mysql/
# groupadd mysql
# useradd -g mysql -d /usr/local/mysql/data -M mysql
# tar -zxvf mysql-5.1.45.tar.gz
# cd mysql-5.1.45
./configure --prefix=/usr/local/mysql \ 指定安装目录
> --sysconfdir=/usr/local/mysql/etc \ 配置文件的路径
> --localstatedir=/usr/local/mysql/data \ 数据库存放的路径
> --enable-assembler \ 允许使用汇编模式(优化性能)
> --with-client-ldflags=-all-static \ 以纯静态方式编译客户端
> --with-mysqld-ldflags=-all-static \ 以纯静态方式编译服务端 静态链接提高13%性能
> --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock 使用unix套接字链接提高7.5%性能
> --with-charset=utf8 \ 添加utf8字符支持
> --with-extra-charsets=all 添加所有字符支持

# make
# make install
# /usr/local/mysql/bin/mysql_install_db
# chown -R mysql:mysql /usr/local/mysql/data
# cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# cp /usr/local/mysql/share/mysql/my-medium.cnf /usr/local/mysql/etc/my.cnf

安装OpenSSL

# tar -zxvf openssl-1.0.0.tar.gz
# cd openssl-1.0.0
# ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
# make
# make install

# vi /etc/ld.so.conf
添加路径
/usr/local/ssl/lib
更新运行时连接
# ldconfig

编译和安装 apr
# tar -zxvf apr-1.4.2.tar.gz
# cd apr-1.4.2
# ./configure --prefix=/usr/local/apr
# make
# make install

编译和安装 apr-util
# tar -zxvf apr-util-1.3.9.tar.gz
# cd apr-util-1.3.9
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make
# make install

安装Apache
tar -zvxf httpd-2.2.15.tar.gz
cd httpd-2.2.15

# vi server/mpm/worker/worker.c
找到下面几行,并改成如下的数值,其目的是在源码中修改apache可支持的最大线程数和最大客户端数目。
# define DEFAULT_SERVER_LIMIT 256
# define MAX_SERVER_LIMIT 40000
# define DEFAULT_THREAD_LIMIT 256
# define MAX_THREAD_LIMIT 40000

./configure --prefix=/usr/local/apache --enable-so --enable-mods-shared=all --with-mpm=worker
--enable-rewrite --enable-deflate --enable-cache --enable-disk-cache --enable-mem-cache
--enable-file-cache --enable-proxy --enable-ssl --with-ssl=/usr/local/ssl –
--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
> --enable-dav --enable-dav-fs SVN支持
make
make install

先安装支持包(注意安装顺序)
先列出配置gd2需要的网址
gd-2.0.35.tar.gz
www.libgd.org

jpegsrc.v6b.tar.gz
http://download.chinaunix.net/download.php?id=10021&ResourceID=5095

libpng-1.4.1.tar.gz
www.libpng.org/pub/png/libpng.html

zlib-1.2.4.tar.gz
www.zlib.net

freetype-2.1.9.tar.gz
www.freetype.org

libxml2-2.6.30.tar.gz
ftp.gnome.org/pub/GNOME/sources/libxml2

建立初始目录:
mkdir /usr/local/modules

jpeg目录
mkdir /usr/local/modules/jpeg6
mkdir /usr/local/modules/jpeg6/bin
mkdir /usr/local/modules/jpeg6/lib
mkdir /usr/local/modules/jpeg6/include
mkdir /usr/local/modules/jpeg6/man
mkdir /usr/local/modules/jpeg6/man/man1

安装libxml
# tar -zxvf libxml2-2.6.30.tar.gz
# cd libxml2-2.6.30
# ./configure (xml默认安装就可以,不要指定路径了,因为安装时php可能找不到它,PHP5只支持libxml2-2.5.10以上版本)
# make
# make install

安装zlib
tar xzvf zlib-1.2.4.tar.gz
cd zlib-1.2.4
#不要用--prefix自定义安装目录,影响gd的安装
./configure
make
make install

安装freetype
tar xzvf freetype-2.3.12.tar.gz
cd freetype-2.3.12
./configure --prefix=/usr/local/modules/freetype
make
make install

安装libpng
tar xzvf libpng-1.4.1.tar.gz
#不要用--prefix自定义安装目录,影响gd的安装
cd libpng-1.4.1
cp scripts/makefile.std makefile
make
make install


安装jpeg
tar xzvf jpegsrc.v6b.tar.gz
./configure --prefix=/usr/local/modules/jpeg6 --enable-shared --enable-static
make
make install

安装GD
tar xzvf gd-2.0.35.tar.gz
./configure --prefix=/usr/local/modules/gd --with-jpeg=/usr/local/modules/jpeg6 --with-png --with-zlib --with-freetype=/usr/local/modules/freetype
make
make install

安装cURL
# wget http://curl.haxx.se/download/curl-7.20.1.tar.gz
# tar -zxvf curl-7.20.1.tar.gz
# cd curl-7.20.1
# ./configure --prefix=/usr/local/curl --with-ssl=/usr/local/ssl
# make
# make install

tar -zxvf php-5.3.2.tar.gz
cd php-5.3.2
./configure --prefix=/usr/local/php \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-libxml-dir=/usr/local/lib \
--with-gd=/usr/local/modules/gd \
--with-jpeg-dir=/usr/local/modules/jpeg6 \
--with-zlib \
--with-png-dir \
--with-freetype-dir=/usr/local/modules/freetype \
--with-xmlrpc \
--with-iconv
--enable-soap
--enable-inline-optimization
--enable-sockets
--enable-mbstring
--enable-static
--with-openssl=/usr/local/ssl
--with-curl=/usr/local/curl

make
make install

cp ./php.ini-development /usr/local/php/lib/php.ini

修改httpd.conf
#vi /usr/local/apache/conf/httpd.conf
加载php模块,去掉注释“#”,如没有此行,请加上。
LoadModule php5_module modules/libphp5.so
加上此两行
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值