zoukankan      html  css  js  c++  java
  • Centos6.4中Apache,MySQL,PHP 的安装

    一、安装Apache
    1、检查是否安装Apache服务
    [root@Arvin02 ~]# cd /home/oldboy/tools/
    [root@Arvin02 tools]# rpm -qa httpd 
    2、下载,解压Apache
    [root@Arvin02 tools]# tar xf httpd-2.2.27.tar.gz
    [root@Arvin02 tools]# cd httpd-2.2.27
    3、编译安装,开启服务
    [root@Arvin02 tools]# ./configure
    --prefix=/application/apache2.2.27
    --enable-deflate
    --enable-expires
    --enable-headers
    --enable-modules=most
    --enable--so
    --with-mpm=worker
    --enable-rewrite
    [root@Arvin02 tools]# make
    [root@Arvin02 tools]# make install
    [root@Arvin02 httpd-2.2.27]# /application/apache/bin/apachectl start
    4、测试
    [root@Arvin02 httpd-2.2.27]# lsof -i :80
    [root@Arvin02 httpd-2.2.27]# ps -ef|grep httpd
     
     
    二、安装MySql
    1、mysql数据库安装准备
    1)、提前加大虚拟内存,编译会更快,1-2G。
    2)、准备好mysql软件包。
    3)、重视操作过程的报错输出。
    4)、进入虚拟机界面去make,make install。
     
    2、建立MySql帐号
    首先以root身份登陆到linux系统中,然后执行创建mysql组及用户:
    [root@oldboy ~]# groupadd mysql                                 -----添加组和用户
    [root@oldboy ~]# useradd mysql -g mysql -M -s /sbin/nologin
    [root@oldboy ~]# id mysql 
    uid=500(mysql) gid=500(mysql) groups=500(mysql)
    执行脚本编译mysql
    [root@oldboy mysql-5.1.72]# cat o.log   --mysql编译脚本
    ./configure  
    --prefix=/application/mysql5.1.72  
    --with-unix-socket-path=/application/mysql5.1.72/tmp/mysql.sock  
    --localstatedir=/application/mysql5.1.72/data  
    --enable-assembler  
    --enable-thread-safe-client  
    --with-mysqld-user=mysql  
    --with-big-tables  
    --without-debug  
    --with-pthread  
    --with-extra-charsets=complex  
    --with-readline  
    --with-ssl  
    --with-embedded-server  
    --enable-local-infile  
    --with-plugins=partition,innobase  
    --with-mysqld-ldflags=-all-static  
    --with-client-ldflags=-all-static 
    [root@oldboy mysql-5.1.72]# cat o.log |bash  --bash执行o.log脚本,编译mysql
    [root@oldboy mysql-5.1.72]# yum -y install ncurses-devel
    编译执行
    [root@oldboy mysql-5.1.72]#make &&make install
    [root@oldboy mysql-5.1.72]#ln -s /application/mysql5.1.72 /application/mysql
    [root@oldboy mysql-5.1.72]#ll /application/mysql
    安装完毕!
     
    三、安装PHP
    1、检查Apache和Mysql是否安装成功
        进入mysql,lsof -i :80
    2、检查安装PHP所需lib库
    rpm -qa zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel
        部分安装:yum install libpng libpng-devel  
        完全安装:yum install zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel -y 
    3、安装libiconv库
    tar zxf libiconv-1.14.tar.gz
    cd libiconv-1.14
    ./cinfigure --prefix=/usr/local/libiconv
    make
    make install
    cd ../
    4、开始安装PHP
    获取PHP安装包
    cd /home/oldboy/tools
    解压配置   
    tar zxf php-5.3.10.tar.gz
    cd php-5.3.10
    yum install openssl-devel libxslt-devel -y
     
    ./configure
    --prefix=/application/php5.3.27
    --with-apxs2=/application/apache/bin/apxs
    --with-mysql=/application/mysql
    --with-xmlrpc
    --with-openssl
    --with-zlib
    --with-freetype-dir
    --with-gd
    --with-jpeg-dir
    --with-png-dir
    --with-iconv=/usr/local/libiconv
    --enable-short-tags
    --enable-sockets
    --enable-zend-multibyte
    --enable-soap
    --enable-mbstring
    --enable-static
    --enable-gd-native-ttf
    --with-curl
    --with-xsl
    --enable-ftp
    --with-libxml-dir     如果出现Thank you for using PHP.则安装成功。
     
    make && make install
    ln -s /application/php5.3.27/ /application/php
    ll /application/php/
    安装完毕!
     
  • 相关阅读:
    【转载】三元运算符 使用小技巧一则 – javascript
    Mysql、SqlServer和Oracle 添加修改删除字段
    Jquery闪烁提示特效
    【转载】jQuery.validate 中文API
    Js取数组中最大值和最小值
    Visual Studio 2010快捷键大全
    JS 在指定数组中随机取出N个不重复的数据
    数据库 索引的优点和缺点
    OnClientClick和OnClick同时使用!
    JS 判断输入字符串的长度(中文占用两个字节,英文占用一个字节)
  • 原文地址:https://www.cnblogs.com/miaokm/p/4075562.html
Copyright © 2011-2022 走看看