Linux下Apache 2.2, MySQL 5.0的安装与配置

1.安装MySQL 5.0.24
-------------下载软件包mysql-5.0.24.tar.gz,地址http://www.mysql.com-------------
# tar zvxf mysql-5.0.24.tar.gz                                                       //解压缩
# cd mysql-5.0.24                                                                        //进入解压缩后的文件目录
# ./configure --prefix=/usr/local/mysql \                                        //设定安装目录
--enable-thread-safe-client \                                                        //编译线程安全版的客户端库
--without-debug \                                                                         //关闭debug功能
--localstatedir=/data/mysqldata \                                                 //设定数据库文件目录
# make                                                                                        //编译
# make install                                                                              //安装
# /usr/local/mysql/bin/mysql_install_db                                       //初始化授权
# chown –R root:root /usr/local/mysql                                         //文件属性改为root用户
# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf    //复制配置文件
----------------------------------启动MySQL服务----------------------------------
# /usr/local/mysql/bin/mysqld_safe --user=root & //启动MySQL
----------------------------------修改MySQL密码----------------------------------
# /usr/local/mysql/bin/mysqladmin -uroot password mysqlsecret //修改密码
----------------------------------关闭MySQL服务----------------------------------
# /usr/local/mysql/bin/mysqladmin -uroot -pmysqlsecret shutdown //关闭MySQL

2.安装Apache 2.2.3
-------------下载软件包httpd-2.2.3.tar.gz,地址http://www.apache.org-------------
# tar zvxf httpd-2.2.3.tar.gz
# cd httpd-2.2.3
# ./configure --prefix=/usr/local/apache \
--enable-module=most \
--enable-shared=max
# make
# make install
----------------------------------启动Apache服务----------------------------------
# /usr/local/apache/bin/apachectl start
----------------------------------关闭Apache服务----------------------------------
# /usr/local/apache/bin/apachectl stop
----------------------------------重启Apache服务----------------------------------
# /usr/local/apache/bin/apachectl restart



3.配置Apache服务的httpd.conf文件
*在LoadModule处添加 LoadModule php5_module module/libphp5.so
*在DirectoryIndex处添加 index.php
*在AddType application处添加
AddType application/x-httpd-php .php .phtml
AddType applicatoin/x-httpd-php-source .phps

你可能感兴趣的:(apache,thread,linux,mysql,PHP)