日期:2014-05-16  浏览次数:20735 次

Linux上全源码安装Apache、MySQL、PH

Linux上全源码安装Apache、MySQL、PHP、WSF安装(原创)

需要root权限

  1. Apache安装
    • 下载
      # wget?
      http://apache.mirror.phpchina.com/httpd/httpd-2.2.6.tar.gz
    • 安装
      # tar zxvf httpd-2.2.6.tar.gz
      # cd httpd-2.2.6
      #./configure --prefix=/usr/local/apache2 --enable-so
      # make
      # make install
      # make clean
    • 系统启动时自动加载Apache
      # cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
      # cd /etc/rc.d/rc3.d
      # ln –s ../init.d/httpd S80httpd
  2. MySQL安装
    • 下载
      # wget?
      http://mysql.ntu.edu.tw/Downloads/MySQL-5.0/mysql-5.0.45.tar.gz
    • 安装
      # tar zxvf mysql-5.0.45.tar.gz
      # cd mysql-5.0.45
      # ./configure --prefix=/usr/local/mysql --enable-thread-safe-client --with-charset=utf8
      # make
      # make install
      # cp support-files/my-medium.cnf /etc/my.cnf
      # make clean
    • 创建mysql用户
      # groupadd mysql
      # useradd -g mysql mysql
    • 设置目录访问权限
      # cd /usr/local/mysql
      # chown -R mysql .
      # chgrp -R mysql .
    • # bin/mysql_install_db --user=mysql (初始化表)
      # chown -R root .
      # chown -R mysql var
    • <