当前位置: 首页 > 工具软件 > Apache Gump > 使用案例 >

mediawiki mysql配置_mediawiki搭建 基于php+mysql+apache

尤夕
2023-12-01

2007.11.27

iii安装mediawiki

1.搭建php+mysql+apache平台

1.1 安装mysql-5.0.45-linux-i686-glibc23.tar.gz,www.mysql.com

无需安装,解压后移至/usr/local/mysql.

# groupadd mysql #建立mysql组

# useradd mysql -g mysql #建立mysql用户并且加入到mysql组中

然后设置权限

# chown -R root . #设定root能访问/usr/local/mysql

# chown -R mysql data #设定mysql用户能访问/usr/local/mysql/data ,里面存的是mysql的数据库文件

# chown -R mysql data/. #设定mysql用户能访问/usr/local/mysql/data下的所有文件

# chown -R mysql data/mysql/. #设定mysql用户能访问/usr/local/mysql/data/mysql下的所有文件

# chgrp -R mysql . #设定mysql组能够访问/usr/local/mysql

# /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

1.2信件wiki数据库

mysql -u root -p

输入密码

mysql>create database wikidb;

mysql>show databases;;

2.apache的安装

2.1下载httpd包

# ./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.安装php

# tar zvxf php-5.1.6.tar.gz

# cd php-5.1.6

# ./configure --prefix=/usr/local/php \

--with-mysql=/usr/local/mysql \

--with-apxs2=/usr/local/apache/bin/apxs

注:若装得mysql rpm包 则 --with-mysql

# make

# make install

# cp php.ini-dist /usr/local/php/lib/php.ini

4.配置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

----------------------------------------------------------------------

2.重装mysql后启动出错,提示:

Starting mysqld daemon with databases from /usr/local/mysql/data

STOPPING server from pid file /usr/local/mysql/data/xmcncn.pid

061103 15:25:32  mysqld ended

请教高手gump,解决方法:

touch /tmp/mysql.sock

killall -9 mysqld

/usr/local/mysql/bin/mysqld_safe -user=mysql &

成功启动

阅读(299) | 评论(0) | 转发(0) |

 类似资料: