1.安装环境
操作系统:CentOS 5.5
数据库:MySQL 5.5.14
Web服务器:Apache (httpd-2.2.19)
脚本语言:PHP 5.3.6
安装之前请先用yum或rpm删除之前安装的mysql,apache以及php
2.安装MySQL 5.5.14
软件包mylsql-5.5.14-linux2.6-x86_64.tar.gz
地址http://www.mysql.com->Platform:Linux Generic
# groupadd mysql
# useradd -r -g mysql mysql
# cd /usr/local
# tar zxvf /path/to/mysql-VERSION-OS.tar.gz
# ln -s full-path-to-mysql-VERSION-OS mysql
# cd mysql
# chown -R mysql .
# chgrp -R mysql .
# scripts/mysql_install_db --user=mysql
# chown -R root .
# chown -R mysql data
# cp support-files/mysql.server /etc/init.d/mysql.server
# cp support-files/my-medium.cnf /etc/my.cnf
vi /etc/my.cnf在[mysqld]段中加入 skip-grant-tables
# bin/mysqld_safe --user=mysql &
修改mysql密码
# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 3.23.56
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> USE mysql ;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> UPDATE user SET Password = password ( 'password' ) WHERE User = 'root' ; (注意这里不是mysql)
Query OK, 0 rows affected (0.00 sec)Rows matched: 2 Changed: 0 Warnings: 0
mysql> flush privileges
;Query OK, 0 rows affected (0.01 sec)
mysql> quit
Bye
3.安装Apache (httpd-2.2.19)
地址http://www.apache.org
# tar zvxf httpd-2.2.19.tar.gz
# cd httpd-2.2.19
# ./configure --prefix=/usr/local/apache \
--enable-module=most \
--enable-shared=max
# make
# make install
在 /usr/local/apache/conf/httpd.conf文件中,有这么一段
<Directory/>
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
把Deny改成Allow
4.安装PHP 5.3.6
地址:www.php.net
# tar jvxf php-5.3.6.tar.bz2
# cd php-5.3.6
# ./configure --prefix=/usr/local/php \
--with-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache/bin/apxs
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini
5.配置Apache服务的 /usr/local/apache/conf/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
6. 安装mediaWiki
tar xzvf mediawiki-1.17.0.tar.gz
cp mediawiki-1.17.0 /var/www/wiki
vi /usr/local/apache/conf/httpd.conf
DocumentRoot "/var/www/wiki"
DirectoryIndex index.html index.html.var index.php
----------------------------------启动Apache服务----------------------------------
# /usr/local/apache/bin/apachectl start