来自 系统操作 2019-11-07 23:16 的文章
当前位置: 六合联盟网 > 系统操作 > 正文

0下LAMP条件搭建

系统景况:CentOS6.0 x64

1、确认搭建LAMP所急需的条件是或不是早就设置

[root@centos6 ~]# rpm -q make gcc gcc-c++ zlib-devel libaio

备考:安装libpng时候供给zlib-devel

             安装mysql时候须要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是三个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是加密算法扩充库。扶持DES, 3DES, RIJNDAEL, Twofish, IDEA, GOST, CAST-256, ARCFOUCRUISER, SERPENT, SAFEPRADO+等算法。

[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是提供数据压缩用的函式库

[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/(创建jpeg软件的装置目录)

[root@centos6 jpeg-8c]# mkdir /usr/local/jpeg/bin/(创立贮存命令的目录卡塔尔

[root@centos6 jpeg-8c]# mkdir /usr/local/jpeg/lib/(创设jpeg库文件所在目录卡塔 尔(英语:State of Qatar)

[root@centos6 jpeg-8c]# mkdir /usr/local/jpeg/include/(创立存放头文件目录卡塔尔

[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和静态库使用的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错误

扑灭办法:编辑/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

开机自动运转apache的另意气风发种艺术:

修改/etc/rc.local文件

# vim /etc/rc.local

在文件中加多/usr/local/apache/bin/apachectl start

图片 1

本文由六合联盟网发布于系统操作,转载请注明出处:0下LAMP条件搭建

关键词: