最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

64位CentOS 6.0下搭建LAMP環(huán)境詳細(xì)步驟

 更新時(shí)間:2013年07月08日 12:52:46   作者:  
這篇文章主要介紹了系統(tǒng)環(huán)境:Centos6.0 x64的lamp運(yùn)行環(huán)境配置教程,需要的朋友可以參考下

1、確認(rèn)搭建LAMP所需要的環(huán)境是否已經(jīng)安裝

[root@centos6 ~]# rpm -q make gcc gcc-c++ zlib-devel libaio
備注:安裝libpng時(shí)候需要zlib-devel
             安裝mysql時(shí)候需要libaio
2、如果沒安裝則yum安裝
[root@centos6 ~]# yum install make gcc gcc-c++ zlib-devel libaio -y
3、由于要使用編譯安裝,所以查看httpd、mysql、php是否安裝,如果安裝則卸載
[root@centos6 ~]# rpm -q httpd mysql php
4、編譯安裝libxml2
注:libxml2是一個(gè)xml的c語言版的解析器,不僅支持c語言,還支持c++、php、Pascal、Ruby、Tcl等語言的綁定
[root@centos6 LAMP]# pwd
/tmp/LAMP
[root@centos6 LAMP]# tar -zxvf libxml2-2.7.8.tar.gz
[root@centos6 LAMP]# cd ./libxml2-2.7.8
[root@centos6 libxml2-2.7.8]# ./configure  --prefix=/usr/local/libxml2/
[root@centos6 libxml2-2.7.8]# make;make install
5、編譯安裝libmcrypt
注:libmcrypt是加密算法擴(kuò)展庫。支持DES, 3DES, RIJNDAEL, Twofish, IDEA, GOST, CAST-256, ARCFOUR, SERPENT, SAFER+等算法。
[root@centos6 LAMP]# pwd
/tmp/LAMP
[root@centos6 LAMP]# tar -zxvf libmcrypt-2.5.8.tar.gz
[root@centos6 LAMP]# cd ./libmcrypt-2.5.8
[root@centos6 libmcrypt-2.5.8]# ./configure  --prefix=/usr/local/libmcrypt/
[root@centos6 libmcrypt-2.5.8]# make;make install
6、編譯安裝zlib
注:zlib是提供數(shù)據(jù)壓縮用的函式庫
[root@centos6 LAMP]# pwd
/tmp/LAMP
[root@centos6 LAMP]# tar -zxvf zlib-1.2.5.tar.gz
[root@centos6 LAMP]# cd ./zlib-1.2.5
[root@centos6 zlib-1.2.5]# ./configure  --prefix=/usr/local/zlib/
[root@centos6 zlib-1.2.5]# make ; make install
7、編譯安裝libpng
[root@centos6 LAMP]# pwd
/tmp/LAMP
[root@centos6 LAMP]# tar -zxvf libpng-1.5.4.tar.gz
[root@centos6 LAMP]# cd ./libpng-1.5.4
[root@centos6 libpng-1.5.4]#
./configure --prefix=/usr/local/libpng/  --enable-shared
[root@centos6 libpng-1.5.4]# make ; make install
8、編譯安裝jpeg
[root@centos6 LAMP]# pwd
/tmp/LAMP
[root@centos6 LAMP]# tar -zxvf jpegsrc.v8c.tar.gz
[root@centos6 LAMP]# cd ./jpeg-8c/
[root@centos6 jpeg-8c]# mkdir /usr/local/jpeg/(創(chuàng)建jpeg軟件的安裝目錄)
[root@centos6 jpeg-8c]# mkdir /usr/local/jpeg/bin/(創(chuàng)建存放命令的目錄)
[root@centos6 jpeg-8c]# mkdir /usr/local/jpeg/lib/(創(chuàng)建jpeg庫文件所在目錄)
[root@centos6 jpeg-8c]# mkdir /usr/local/jpeg/include/(創(chuàng)建存放頭文件目錄)
[root@centos6 jpeg-8c]# mkdir -p /usr/local/jpeg/man/man1(建立存放手冊的目錄)
[root@centos6 jpeg-8c]#
 ./configure --prefix=/usr/local/jpeg/ --enable-shared --enable-static建立共享庫使用的GNU的libtool和靜態(tài)庫使用的GNU的libtool)
[root@centos6 jpeg-8c]# make ; make install
9、編譯安裝freetype
[root@centos6 LAMP]# pwd
/tmp/LAMP
[root@centos6 LAMP]# tar -zxvf freetype-2.4.6.tar.gz
[root@centos6 LAMP]# cd ./freetype-2.4.6
[root@centos6 freetype-2.4.6]#
 ./configure --prefix=/usr/local/freetype/ --enable-shared
[root@centos6 freetype-2.4.6]# make ;make install
10、      編譯安裝autoconf
[root@centos6 LAMP]# pwd
/tmp/LAMP
[root@centos6 LAMP]# tar -zxvf autoconf-2.68.tar.gz
[root@centos6 LAMP]# cd ./autoconf-2.68
[root@centos6 autoconf-2.68]# ./configure
[root@centos6 autoconf-2.68]# make ; make install
11、      編譯安裝GD
[root@centos6 LAMP]# pwd
/tmp/LAMP
[root@centos6 LAMP]# tar -zxvf gd-2.0.35.tar.gz
[root@centos6 LAMP]# cd ./gd-2.0.35
[root@centos6 gd-2.0.35]#
 ./configure --prefix=/usr/local/gd/ --with-zlib=/usr/local/zlib/ --with-jpeg=/usr/local/jpeg/ --with-png=/usr/local/libpng/ --with-freetype=/usr/local/freetype/
[root@centos6 gd-2.0.35]# make ; make install
12、      安裝apache
[root@centos6 LAMP]# pwd
/tmp/LAMP
[root@centos6 LAMP]# tar -zxvf httpd-2.2.19.tar.gz
[root@centos6 LAMP]# cd ./httpd-2.2.19
[root@centos6 httpd-2.2.19]#
 ./configure --prefix=/usr/local/apache/ --enable-so --enable-rewrite
[root@centos6 httpd-2.2.19]# make ; make install
[root@centos6 LAMP]# /usr/local/apache/bin/apachectl start
[root@centos6 LAMP]#
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
[root@centos6 LAMP]# chmod +x /etc/init.d/httpd
[root@centos6 ~]# chkconfig --add httpd
注意:如果提示service httpd does not support chkconfig錯(cuò)誤
解決辦法:編輯/etc/rc.d/init.d/httpd在文件第二行加入
           #chkconfig:2345 10 90
           #description:Activates/Deactivates Apache Web Server
[root@centos6 ~]# chkconfig --level 2345 httpd on
[root@centos6 LAMP]# service httpd restart
開機(jī)自動(dòng)啟動(dòng)apache的另一種方法:
修改/etc/rc.local文件
# vim /etc/rc.local
在文件中添加/usr/local/apache/bin/apachectl start
13、      編譯安裝mysql
[root@centos6 LAMP]# pwd
/tmp/LAMP
[root@centos6 LAMP]# tar -zxvf mysql-5.5.15-linux2.6-x86_64.tar.gz
[root@centos6 LAMP]# cd ./mysql-5.5.15-linux2.6-x86_64
[root@centos6 mysql-5.5.15-linux2.6-x86_64]# groupadd mysql
[root@centos6 mysql-5.5.15-linux2.6-x86_64]# useradd -r -g mysql mysql(創(chuàng)建mysql用戶,并將用戶指定至mysql組)
[root@centos6 mysql-5.5.15-linux2.6-x86_64]# cd /usr/local/
[root@centos6 local]# ln -s /tmp/LAMP/mysql-5.5.15-linux2.6-x86_64 mysql
[root@centos6 local]# cd ./mysql/
[root@centos6 mysql]# chown -R mysql .(將該目錄的用戶權(quán)限全部更改為mysql用戶)
[root@centos6 mysql]# chgrp -R mysql .(將該目錄的用戶組全部改為mysql用戶組)
[root@centos6 mysql]# ./scripts/mysql_install_db --user=mysql(將mysql目錄的數(shù)據(jù)庫使用權(quán)限指定為mysql)
[root@centos6 mysql]# chown -R root .
[root@centos6 mysql]# chown -R mysql data
[root@centos6 mysql]# cp support-files/my-medium.cnf  /etc/my.cnf(將當(dāng)前目錄下的配置文件拷貝到系統(tǒng)配置文件下,并更名為my.cnf)
[root@centos6 mysql]# cp support-files/mysql.server  /etc/init.d/mysqld
[root@centos6 mysql]# chmod +x /etc/init.d/mysqld
[root@centos6 mysql]# chkconfig --add mysqld
[root@centos6 mysql]# chkconfig --level 345 mysqld on
[root@centos6 mysql]# service mysqld restart
[root@centos6 mysql]#
 /usr/local/mysql/bin/mysqladmin -u root password '123456'(設(shè)置root用戶登錄mysql的密碼)
[root@centos6 mysql]# /usr/local/mysql/bin/mysql -u root –p(進(jìn)入并訪問mysql數(shù)據(jù))
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 2
Server version: 5.5.15-log MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql>(成功登錄mysql)
14、      編譯安裝php
[root@centos6 LAMP]# pwd
/tmp/LAMP
[root@centos6 LAMP]# tar -zxvf php-5.3.7.tar.gz
[root@centos6 LAMP]# cd ./php-5.3.7
[root@centos6 php-5.3.7]#
./configure --prefix=/usr/local/php/ --with-apxs2=/usr/local/apache/bin/apxs --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg/ --with-freetype-dir=/usr/local/freetype/--with-gd-dir=/usr/local/gd/--with-zlib-dir=/usr/local/zlib/--with-mcrypt=/usr/local/libmcrypt/--with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets
[root@centos6 php-5.3.7]# make ; make install
[root@centos6 php-5.3.7]#
 cp php.ini-development /usr/local/php/lib/php.ini
#vim /usr/local/php/lib/php.ini
 //這里需要將register_globals=Off更改on模式,還有時(shí)間格式改為本地
15、      更改apache的配置文件,達(dá)到解析php文件的目的
    [root@centos6 ~]# vim /usr/local/apache/conf/httpd.conf
 AddType application/x-compress .Z
 AddType application/x-gzip .gz .tgz
 Addtype application/x-httpd-php .php .phtml
     Addtype application/x-httpd-php-source .phps
添加上面綠色內(nèi)容,表示apache服務(wù)中可以解析php格式文件
接下來要檢查apache目錄下生成的php動(dòng)態(tài)連接庫文件,在目錄/usr/local/apache/modules,找到是否存在 libphp5.so文件
16、     驗(yàn)證
     [root@centos6 ~]# vim /usr/local/apache/htdocs/index.php
     添加內(nèi)容為
<?php
    echo phpinfo();
?>
在客服端驗(yàn)證,出現(xiàn)下圖說明php搭建成功

相關(guān)文章

  • 解決因文件權(quán)限導(dǎo)致git fetch命令執(zhí)行失敗的問題

    解決因文件權(quán)限導(dǎo)致git fetch命令執(zhí)行失敗的問題

    最近在工作中遇到一個(gè)問題,就是在在一個(gè)基于 git 的發(fā)布系統(tǒng)中拉取代碼,發(fā)現(xiàn)無法拉取最新的提交記錄,查找相關(guān)資料發(fā)現(xiàn)是因?yàn)槲募?quán)限的問題,所以這篇文章主要介紹了關(guān)于解決因文件權(quán)限導(dǎo)致git fetch命令執(zhí)行失敗的問題,需要的朋友可以參考下。
    2017-04-04
  • Linux查看文件大小的幾種方法匯總

    Linux查看文件大小的幾種方法匯總

    這篇文章主要介紹了Linux查看文件大小的幾種方法匯總,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-09-09
  • Linux服務(wù)器如何查看每個(gè)用戶或者當(dāng)前用戶的磁盤占用量及文件同步

    Linux服務(wù)器如何查看每個(gè)用戶或者當(dāng)前用戶的磁盤占用量及文件同步

    這篇文章主要介紹了Linux服務(wù)器如何查看每個(gè)用戶或者當(dāng)前用戶的磁盤占用量及文件同步問題,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-02-02
  • 一道題理解Linux中sort命令的多個(gè)參數(shù)

    一道題理解Linux中sort命令的多個(gè)參數(shù)

    今天小編就為大家分享一篇關(guān)于一道題理解Linux中sort命令的多個(gè)參數(shù),小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧
    2019-03-03
  • Linux中的幾種最佳文件系統(tǒng)

    Linux中的幾種最佳文件系統(tǒng)

    這篇文章主要介紹了Linux中的幾種最佳文件系統(tǒng),具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-02-02
  • Linux CentOS7 vim臨時(shí)文件使用

    Linux CentOS7 vim臨時(shí)文件使用

    這篇文章主要介紹了Linux CentOS7 vim臨時(shí)文件使用方式,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-11-11
  • linux如何查看nginx啟動(dòng)路徑

    linux如何查看nginx啟動(dòng)路徑

    這篇文章主要介紹了linux如何查看nginx啟動(dòng)路徑問題,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-07-07
  • 手把手教你在騰訊云上搭建hive3.1.2的方法

    手把手教你在騰訊云上搭建hive3.1.2的方法

    這篇文章主要介紹了手把手教你在騰訊云上搭建hive3.1.2的方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-07-07
  • 基于 Ubuntu 的發(fā)行版上安裝微軟 TrueType 字體的教程

    基于 Ubuntu 的發(fā)行版上安裝微軟 TrueType 字體的教程

    這篇文章主要介紹了基于 Ubuntu 的發(fā)行版上安裝微軟 TrueType 字體的教程,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-04-04
  • Linux進(jìn)程如何終止

    Linux進(jìn)程如何終止

    這篇文章主要介紹了Linux進(jìn)程如何終止問題,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-02-02

最新評論

拉孜县| 夏河县| 阳春市| 都兰县| 资溪县| 宁都县| 梁山县| 石狮市| 满洲里市| 来安县| 桦川县| 沙河市| 额敏县| 扬州市| 宣武区| 水富县| 遂平县| 吉林市| 萨嘎县| 卢龙县| 水富县| 于田县| 宜州市| 青冈县| 无为县| 桂林市| 阿城市| 越西县| 南汇区| 盐亭县| 昌图县| 克东县| 卢湾区| 松江区| 吴江市| 林口县| 达拉特旗| 易门县| 新巴尔虎右旗| 离岛区| 吉木乃县|