logo

Navigation:First_Community->Computer->Network Goto:New TopicSettingSearch
mysql5 php5 apache2 phpmyadmin 安装过程 -
Posted by: imac Date: March 29, 2008 09:46PM

mysql5 php5 apache2 phpmyadmin 安装过程

本安装过程以linux AS4 为底本.安装linux时选最小安装+xwindows没有装apache,mysql,php.等,安装cacti,nagios2.0 ,fruity,作为web页面管理测试。
一、安装基本系统:mysql5+php5+apache2
安装mysql:
www.mysql.org
  
下载了编译版本mysql-max-5.0.18-linux-i686-glibc23.tar.gz
     shell> groupadd mysql
     shell> useradd -g mysql mysql
     shell> cd /usr/local
     shell> gunzip
     shell> ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql
     shell> cd mysql
     shell> scripts/mysql_install_db --user=mysql
     shell> chown -R root  .
     shell> chown -R mysql data
     shell> chgrp -R mysql .
     shell> bin/mysqld_safe --user=mysql &
        shell>cp support-files/my-medium.cnf /etc/my.cnf
        shell> cp bin/* /usr/bin/
要开机自动运行mysql:
1、  mkdir /usr/local/etc/rc.d
       vi /usr/local/
              #! /bin/sh
              /usr/local/mysql/bin/mysqld_safe &
       chmod 755 /usr/local/etc/rc.d/mysql.sh
       启动其他服务类似。
2、vi /etc/rc.local
       /usr/local/mysql/bin/mysqld_safe &
如此操作,可以启动服务.rpm安装每次安装后启动不来,放弃。
启动:mysqld_safe &
停止:mysqladmin shudown 。
补充:    ldconfig v
              cp support-files/mysql.server /etc/init.d/mysql
              cd /etc/rc3.d/
              ln -s ../init.d/mysql S85mysql
              ln -s ../init.d/mysql K85mysql
              cd /etc/rc5.d/
              ln -s ../init.d/mysql S85mysql
              ln -s ../init.d/mysql K85mysql
              cd /etc/init.d/
              chmod 755 mysql

安装APACHE:
www.apache.org
下载httpd-2.2.0.tar.gz
# tar zxvf httpd-2.2.0.tar.gz
# cd httpd-2.2.0
# ./configure --prefix=/usr/local/apache --enable-so
# make & make install
# cp /usr/local/apache/bin/*  /usr/bin/
# cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
安装gd2:http://www.boutell.com/gd/
   下载 gd-2.0.33.tar.gz
./configure make make install
Libraries have been installed in:
   /usr/local/lib
安装php:
www.php.net
  下载 php-5.1.2.tar.gz
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-mysqli=/usr/local/mysql/bin/mysql_config --with-xmlpc --with-jpeg-dir=/usr/bin --with-zlib-dir=/usr/bin --with-gd  
cp /usr/local/php/bin/*   /usr/bin
cp /soft/php-5.1.2/ php.ini-dist  /usr/local/php/lib/php.ini
vi /usr/local/apach/conf/httpd.conf
添加如下2行:
AddType application/x-httpd-php .php .phtml .php3 .php4
AddType application/x-httpd-php-source .phps
安装phpmyadmin:
www.phpmyadmin.net
下载:phpMyAdmin-2.7.0-pl2.tar.gz
解压后mv到/usr/local/下,然后修改config.default.php 修改相应的用户名和密码即可。
$cfg[ 'Servers '][$i][ 'auth_type '] = 'http ';  // Authentication method (config, http or cookie based)
$cfg[ 'Servers '][$i][ 'user ']     = 'root ';  // MySQL user
$cfg[ 'Servers '][$i][ 'password '] = ' ';    // MySQL password (only needed with 'config ' auth_type)
注:如红色部分,用config作为认证方式,则下面得user和password都必须添上,安全性较低
用http做为认证方式,则弹出用户认证对话框.
至此:所有安装通过测试可以使用。
****************************ALL SUCESSFULLY********************************

CopyRight owned by the original author.--(www.MegaEntry.com)



Reply To This Message
Subject: 

Copyright 2005-2006 megaentry,All Rights Reserved
IE 6.0 or above is perfect