Centos6.4中Apache,MySQL,PHP 的安裝

來源:互聯網
上載者:User

標籤:http   io   ar   os   for   sp   資料   div   on   

一、安裝Apache1、檢查是否安裝Apache服務
[[email protected] ~]# cd /home/oldboy/tools/[[email protected] tools]# rpm -qa httpd 
2、下載,解壓Apache
[[email protected] tools]# wget -q http://mirror.bit.edu.cn/apache/httpd/httpd-2.2.27.tar.gz [[email protected] tools]# tar xf httpd-2.2.27.tar.gz[[email protected] tools]# cd httpd-2.2.27
3、編譯安裝,開啟服務
[[email protected] tools]# ./configure \--prefix=/application/apache2.2.27 \--enable-deflate \--enable-expires \--enable-headers \--enable-modules=most \--enable--so \--with-mpm=worker \--enable-rewrite[[email protected] tools]# make[[email protected] tools]# make install[[email protected] httpd-2.2.27]# /application/apache/bin/apachectl start
4、測試
[[email protected] httpd-2.2.27]# lsof -i :80[[email protected] httpd-2.2.27]# ps -ef|grep httpd
  二、安裝MySql1、mysql資料庫安裝準備
1)、提前加大虛擬記憶體,編譯會更快,1-2G。2)、準備好mysql軟體包。3)、重視操作過程的報錯輸出。4)、進入虛擬機器介面去make,make install。
 2、建立MySql帳號首先以root身份登陸到linux系統中,然後執行建立mysql組及使用者:
[[email protected] ~]# groupadd mysql                                 -----添加組和使用者[[email protected] ~]# useradd mysql -g mysql -M -s /sbin/nologin[[email protected] ~]# id mysql uid=500(mysql) gid=500(mysql) groups=500(mysql)
執行指令碼編譯mysql
[[email protected] 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 [[email protected] mysql-5.1.72]# cat o.log |bash  --bash執行o.log指令碼,編譯mysql[[email protected] mysql-5.1.72]# yum -y install ncurses-devel
編譯執行
[[email protected] mysql-5.1.72]#make &&make install[[email protected] mysql-5.1.72]#ln -s /application/mysql5.1.72 /application/mysql[[email protected] mysql-5.1.72]#ll /application/mysql
安裝完畢! 三、安裝PHP1、檢查Apache和Mysql是否安裝成功    進入mysql,lsof -i :802、檢查安裝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庫
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gztar zxf libiconv-1.14.tar.gzcd libiconv-1.14./cinfigure --prefix=/usr/local/libiconvmakemake installcd ../
4、開始安裝PHP擷取PHP安裝包
cd /home/oldboy/toolswget http://cn.php.net/get/php-5.3.10.tar.gz/from/cn2.php.net/mirror
解壓配置   
tar zxf php-5.3.10.tar.gzcd php-5.3.10yum 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 installln -s /application/php5.3.27/ /application/phpll /application/php/安裝完畢! 

Centos6.4中Apache,MySQL,PHP 的安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.