apr (apache protable run-time libiraies,apache移植运行库),主要就是为上层应用程序提供一个可以跨越多操作系统平台使用的底层支持接口库。 tomcat链接优化工具
完整的APR实际上包含了三个开发包,apr apr-iconv apr-util ,每一个版本都独立开发,并拥有自己的版本号。
apr-iconv 是apr的一个子程序,字体函数 apr-iconv -> libiconv ->apr
apr-util 连接的辅助工具
libiconv 是一个开源库,解决多语言编码处理转换等应用问题
pcre (perl compatiable regular expressions) 是一个perl库,包括perl兼容的正规表达式。
/share/soft/lamp/apache_source/apr-1.3.8.tar.gz
/share/soft/lamp/nginx/libiconv-1.13.tar.gz
/share/soft/lamp/apache_source/apr-iconv-1.2.1.tar.gz
/share/soft/lamp/apache_source/apr-util-1.3.9.tar.gz
/share/soft/lamp/nginx/pcre-7.9.tar.gz
[root@li ~]# mkdir /usr/src/lamp
--------------------------------------------
apr-1.3.8.tar.gz
[root@li ~]# tar xvf /share/soft/lamp/apache_source/apr-1.3.8.tar.gz -C /usr/src/lamp/
./configure --disable-ipv6 --with-gnu-ld --with-devrandom=/dev/random
注意查看信息
Libraries have been installed in:
/usr/local/apr/lib
[root@li apr-1.3.8]# vim /etc/ld.so.conf.d/lamp.conf --新建一个lamp有关动态库调用路径文件
/usr/local/apr/lib --加上这一句
[root@li apr-1.3.8]# ldconfig --上述新加的路径生效
-----------------------------------------------
libiconv-1.13.tar.gz
[root@li apr-1.3.8]# tar xvf /share/soft/lamp/nginx/libiconv-1.13.tar.gz -C /usr/src/lamp/
[root@li apr-1.3.8]# cd /usr/src/lamp/libiconv-1.13/
./configure --enable-static=yes --with-gnu-ld
make;make install;ldconfig
------------------------------------------------
apr-iconv-1.2.1.tar.gz
[root@li libiconv-1.13]# tar xvf /share/soft/lamp/apache_source/apr-iconv-1.2.1.tar.gz -C /usr/src/lamp/
[root@li lamp]# cd /usr/src/lamp/apr-iconv-1.2.1/
./configure --with-apr=/usr/local/apr/bin/apr-1-config
make ;make install
echo /usr/local/apache2/lib/iconv >> /etc/ld.so.conf.d/lamp.conf
ldconfig
-------------------------------------------------------
[root@li apr-iconv-1.2.1]# tar xvf /share/soft/lamp/apache_source/apr-util-1.3.9.tar.gz -C /usr/src/lamp/
[root@li apr-iconv-1.2.1]# cd /usr/src/lamp/apr-util-1.3.9/
./configure --with-apr=/usr/local/apr/bin/apr-1-config --with-mysql=/usr/local/mysql/ --with-iconv=/usr/local/
make;make install
查看编译信息
Libraries have been installed in:
/usr/local/apr/lib --上面装apr时已经加入了这个路径,所以直接ldconfig
ldconfig
--------------------------------------------------
pcre-7.9.tar.gz
[root@li apr-util-1.3.9]# tar xvf /share/soft/lamp/nginx/pcre-7.9.tar.gz -C /usr/src/lamp/
[root@li apr-util-1.3.9]# cd /usr/src/lamp/pcre-7.9/
./configure --with-gnu-ld --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-rebuild-chartables --enable-newline-is-any
make;make install
查看编译信息
Libraries have been installed in:
/usr/local/lib
echo /usr/local/lib >> /etc/ld.so.conf.d/lamp.conf
ldconfig
---------------------------------------------------------------------------
httpd-2.2.9.tar.gz
--with-mpm=worker 线程模式运行apache,比较适合跑静态的
--with-mpm=prefork 进程模式,适合与php搭建lamp
[root@li pcre-7.9]# tar xvf /share/soft/lamp/apache_source/httpd-2.2.9.tar.gz -C /usr/src/lamp/
[root@li pcre-7.9]# cd /usr/src/lamp/httpd-2.2.9/
[root@li httpd-2.2.9]# ./configure --enable-modules=all --enable-mods-shared=all --enable-authz-owner --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache --enable-echo --enable-example --enable-case-filter --enable-ext-filter --enable-deflate --enable-charset-lite --enable-mime-magic --enable-logio --enable-expires --enable-headers --enable-unique-id --enable-usertrack --enable-version --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --enable-ssl --enable-http --enable-dav --enable-info --enable-cgi --enable-vhost-alias --enable-rewrite --enable-so --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config --with-pcre=/usr/local/ --with-mpm=prefork
make ;make install
vim /usr/local/apache2/conf/httpd.conf
1,修改家目录
DocumentRoot "/web"
<Directory "/web">
2,修改默认访问权限,改为允许所有
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
3,加上支持php的主页
DirectoryIndex index.php index.html --加上index.php
4,修改语言集
Include conf/extra/httpd-languages.conf --打开注释
vim /usr/local/apache2/conf/extra/httpd-languages.conf
DefaultLanguage zh-CN
LanguagePriority zh-CN en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-TW
5,拷贝服务脚本
cp /usr/local/apache2/bin/apachectl /etc/init.d/apache
vim /etc/init.d/apache --加上下面两句支持chkconfig
# chkconfig: - 86 16
# description: Apache is a World Wide Web server.
chkconfig --add apache
chkconfig apache on
--------------------------------------------------------------
下面要安装的是php,但在安装php之前,先安装php的扩展库
php的扩展库
/share/soft/lamp/nginx/freetype-2.1.10.tar.gz --一个开源的,高质量的且可移植的字体引擎
/share/soft/lamp/nginx/libevent-1.4.11-stable.tar.gz --是一个跨平台的事件驱动库
/share/soft/lamp/nginx/libpng-1.2.37.tar.gz --libpng库,被其他程序用于读写png文件
/share/soft/lamp/nginx/libmcrypt-2.5.8.tar.bz2 --数据加密库
/share/soft/lamp/nginx/mhash-0.9.9.9.tar.bz2 --哈希函数库
/share/soft/lamp/nginx/jpegsrc.v6b.tar.gz --jpg图片处理
/share/soft/lamp/nginx/mcrypt-2.6.6.tar.gz --加密算法扩展库,包括有22种算法
/share/soft/lamp/nginx/libxml2-2.7.3.tar.gz--是一个xml c语言版的解析器
/share/soft/lamp/nginx/gd-2.0.35.tar.gz --graphic device图像设备,图像工具库,在网站上使用GD库用来生成缩略图或者用来对图片加水印
/share/soft/lamp/nginx/ruby-1.8.6.tar.gz --ruby, 一种简单快捷的面向对象编程而创的脚本语言
/share/soft/lamp/nginx/libart_lgpl-2.3.20.tar.gz --libart库,绘制高性能的2D图形
/share/soft/lamp/nginx/rrdtool-1.2.30.tar.gz --一个强大的绘图引擎
------------------------------------
freetype-2.1.10.tar.gz
[root@li lamp]# tar xvf /share/soft/lamp/nginx/freetype-2.1.10.tar.gz -C /usr/src/lamp/
[root@li lamp]# cd /usr/src/lamp/freetype-2.1.10/
./configure --with-gnu-ld
make ;make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
----------------------------------------
ibevent-1.4.11-stable.tar.gz
[root@li freetype-2.1.10]# tar xvf /share/soft/lamp/nginx/libevent-1.4.11-stable.tar.gz -C /usr/src/lamp/
[root@li freetype-2.1.10]# cd /usr/src/lamp/libevent-1.4.11-stable/
./configure --with-gnu-ld
make ; make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
----------------------------------------------
libpng-1.2.37.tar.gz
[root@li libpng-1.2.37]# tar xvf /share/soft/lamp/nginx/libpng-1.2.37.tar.gz -C /usr/src/lamp/
[root@li libevent-1.4.11-stable]# cd /usr/src/lamp/libpng-1.2.37/
./configure --enable-maintainer-mode --with-gnu-ld
make ;make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
-------------------------------------------------
libmcrypt-2.5.8.tar.bz2
[root@li libpng-1.2.37]# tar xvf /share/soft/lamp/nginx/libmcrypt-2.5.8.tar.bz2 -C /usr/src/lamp/
[root@li libpng-1.2.37]# cd /usr/src/lamp/libmcrypt-2.5.8/
./configure --with-gnu-ld --enable-static
make ;make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
----------------------------------------------------
mhash-0.9.9.9.tar.bz2
[root@li libmcrypt-2.5.8]# tar xvf /share/soft/lamp/nginx/mhash-0.9.9.9.tar.bz2 -C /usr/src/lamp/
[root@li libmcrypt-2.5.8]# cd /usr/src/lamp/mhash-0.9.9.9/
./configure --with-gnu-ld --enable-maintainer-mode
make; make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
---------------------------------------------------
jpegsrc.v6b.tar.gz
[root@li mhash-0.9.9.9]# tar xvf /share/soft/lamp/nginx/jpegsrc.v6b.tar.gz -C /usr/src/lamp/
[root@li mhash-0.9.9.9]# cd /usr/src/lamp/jpeg-6b/
./configure --enable-shared --enable-static
make ;make install
mkdir -p /usr/local/man/man1
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
-----------------------------------------------------
mcrypt-2.6.6.tar.gz
[root@li jpeg-6b]# tar xvf /share/soft/lamp/nginx/mcrypt-2.6.6.tar.gz -C /usr/src/lamp/
[root@li jpeg-6b]# cd /usr/src/lamp/mcrypt-2.6.6/
./configure --with-libmcrypt-prefix=/usr/local/ --with-libiconv-prefix=/usr/local/ --with-gnu-ld
make ;make install
ldconfig
-----------------------------------------------------
[root@li mcrypt-2.6.6]# tar xvf /share/soft/lamp/nginx/libxml2-2.7.3.tar.gz -C /usr/src/lamp/
[root@li mcrypt-2.6.6]# cd /usr/src/lamp/libxml2-2.7.3/
./configure --with-gnu-ld --enable-ipv6=no(有可能导致yum命令不可用)
make ;make install
注意编译信息
Libraries have been installed in:
/usr/local/lib/python2.4/site-packages
echo /usr/local/lib/python2.4/site-packages >> /etc/ld.so.conf.d/lamp.conf
ldconfig
-------------------------------------------------------------------
gd-2.0.35.tar.gz
[root@li gd-2.0.35]# tar xvf /share/soft/lamp/nginx/gd-2.0.35.tar.gz -C /usr/src/lamp/
[root@li libxml2-2.7.3]# cd /usr/src/lamp/gd-2.0.35/
./configure --with-gnu-ld --with-x --with-libiconv-prefix=/usr/local/ --with-png=/usr/local/ --with-freetype=/usr/local/ --with-fontconfig=/usr --with-jpeg=/usr/local/
** Configuration summary for gd 2.0.34:
Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Fontconfig library: yes
Support for Xpm library: yes
Support for pthreads: yes
make ;make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
[root@xxt401 gd-2.0.35]# make install
cd . && /bin/sh /tmp/jpeg-6b/gd-2.0.35/config/missing –run aclocal-1.9 -I config
aclocal:configure.ac:64: warning: macro `AM_ICONV’ not found in library
cd . && /bin/sh /tmp/jpeg-6b/gd-2.0.35/config/missing –run automake-1.9 –foreign
cd . && /bin/sh /tmp/jpeg-6b/gd-2.0.35/config/missing –run autoconf
configure.ac:64: error: possibly undefined macro: AM_ICONV
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
make: *** [configure] 错误 1
到 http://www.gnu.org/software/gettext/下载了gettext-0.17.tar.gz
cp /usr/lib/libattr.* /lib/ (这个在转载的文章里没说,是因为make的时候报错说没有libattr.la这个文件,所以要复制过去)
tar xzf gettext-0.17.tar.gz
cd gettext-0.17
./configure
make
make install
----------------------------------------
ruby-1.8.6.tar.gz
[root@li gd-2.0.35]# tar xvf /share/soft/lamp/nginx/ruby-1.8.6.tar.gz -C /usr/src/lamp/
[root@li gd-2.0.35]# cd /usr/src/lamp/ruby-1.8.6/
./configure --enable-pthread --enable-shared
make ;make install
ldconfig
---------------------------------------
libart_lgpl-2.3.20.tar.gz
[root@li ruby-1.8.6]# tar xvf /share/soft/lamp/nginx/libart_lgpl-2.3.20.tar.gz -C /usr/src/lamp/
[root@li ruby-1.8.6]# cd /usr/src/lamp/libart_lgpl-2.3.20/
./configure --with-gnu-ld --prefix=/usr
make ;make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
------------------------------------------------
rrdtool-1.2.30.tar.gz
[root@li libart_lgpl-2.3.20]# tar xvf /share/soft/lamp/nginx/rrdtool-1.2.30.tar.gz -C /usr/src/lamp/
[root@li libart_lgpl-2.3.20]# cd /usr/src/lamp/rrdtool-1.2.30/
编译前要先yum install tcl-devel --tcl脚本语言开发环境 产生/usr/lib/tclConfig.sh
./configure --with-gnu-ld --enable-perl-site-install --enable-ruby-site-install --enable-tcl-site --with-tcllib=/usr/lib/tclConfig.sh
Config is DONE!
With MMAP IO: yes
Perl Modules: perl_piped perl_shared
Perl Binary: /usr/bin/perl
Perl Version: 5.8.8
Perl Options:
Ruby Modules: ruby
Ruby Binary: /usr/local/bin/ruby
Ruby Options:
Build Tcl Bindings: yes
Build Python Bindings: yes
Build rrdcgi: yes
Build librrd MT: yes
make ;make install
注意安装信息
Libraries have been installed in:
/usr/local/rrdtool-1.2.30/lib
echo /usr/local/rrdtool-1.2.30/lib >> /etc/ld.so.conf.d/lamp.conf
ldconfig
如果rrdtool安装报下面的错
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no libart-2.0.pc file around.
You may want to set the PKG_CONFIG_PATH variable to point to its
location.
使用下面命令去指定这个环境变量,但这样是临时的
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
永久生效,就加到/etc/profile
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
source /etc/profile --source 使之生效
------------------------------------------------------------------
# rpm -e mysql-devel
# rpm -ivh --force MySQL-devel-community-5.1.39-0.rhel5.i386.rpm
添加环境变量,让编译php的时候能够找到mysql相关文件
# vim /root/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/libexec
修改了环境变量,必须打开新的终端才生效或者su - source /root/.bash_profile
安装php
[root@li rrdtool-1.2.30]# tar xvf /share/soft/lamp/php_source/php-5.2.10.tar.gz -C /usr/src/lamp/
[root@li rrdtool-1.2.30]# cd /usr/src/lamp/php-5.2.10/
编译之前先装几个包
[root@li php-5.2.10]# yum install zlib-devel curl-devel ncurses-devel net-snmp-* bzip2-devel
./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-fastcgi --enable-magic-quotes --disable-ipv6 --with-libxml-dir=/usr/local/ --with-zlib --with-bz2 --enable-calendar --with-curl --with-pcre-dir=/usr/local/ --with-gd=/usr/local/ --with-jpeg-dir=/usr/local/ --with-png-dir=/usr/local/ --with-freetype-dir=/usr/local/ --enable-gd-native-ttf --enable-mbstring --with-mcrypt=/usr/local/ --with-mhash=/usr/local/ --with-mysql=/usr/local/mysql/ --with-mysql-sock=/var/run/mysqld/mysql5.socket --with-ncurses --with-mysqli=/usr/local/mysql/bin/mysql_config --with-snmp --enable-sockets --with-libxml-dir=/usr/local/ --with-iconv-dir=/usr/local/ --enable-zip --enable-zend-multibyte --with-gnu-ld --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-pdo-mysql=/usr/local/mysql/
#make ZEND_EXTRA_LIBS='-liconv' php5.1.13要这个
make;make install
cp /usr/src/lamp/php-5.2.10/php.ini-recommended /usr/local/lib/php.ini
-----------------------------------------------------
查看/usr/local/apache2/conf/httpd.conf
LoadModule php5_module modules/libphp5.so --验证是否自动加了这一句
AddHandler php5-script .php
AddType text/html .php --加上这两句
/etc/init.d/apache restart --重启apache
Mysql
------------------------------------------------------------------------------
解压
5.1.36
# tar xvf /share/soft/lamp/mysql_source/mysql-5.1.36.tar.gz -C /usr/src/
# ./configure --prefix=/usr/local/mysql/ --enable-profiling --enable-local-infile --with-charset=gbk --with-extra-charsets=utf8,gb2312 --with-pthread --with-unix-socket-path=/var/run/mysqld/mysql5.socket --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-low-memory --with-big-tables --with-plugins=innobase,ndbcluster,myisam --enable-proflingi
make; make install
# mkdir /usr/local/mysql/etc
# vim /usr/local/mysql/etc/my.cnf
[mysqld]
port=3307
datadir=/data
--使用
5.0.33版本的数据文件,升级保留原数据
socket=/var/run/mysqld/mysql5.socket
pid-file=/var/run/mysqld/mysql5.pid
general-log
--使用新的
log参数
general-log-file=/var/log/mysqld/mysql5.log
log-error=/var/log/mysqld/mysql5-error.log
[client]
socket=/var/run/mysqld/mysql5.socket
# cp /usr/src/mysql-5.1.36/support-files/mysql.server /etc/init.d/mysql5
# chmod 755 /etc/init.d/mysql5
# vim /etc/init.d/mysql5
conf=/usr/local/mysql/etc/my.cnf --修改这句
mkdir –p /data
mkdir –p /var/run/mysqld
mkdir –p /var/log/mysqld
chown mysql:mysql …….-R
/usr/local/mysql/bin/mysql_install_db –datadir=/data
Chown mysql:mysql /data -R
# /etc/init.d/mysql5
start
LAMP 编译安装
apr (apache protable run-time libiraies,apache移植运行库),主要就是为上层应用程序提供一个可以跨越多操作系统平台使用的底层支持接口库。 tomcat链接优化工具
完整的APR实际上包含了三个开发包,apr apr-iconv apr-util ,每一个版本都独立开发,并拥有自己的版本号。
apr-iconv 是apr的一个子程序,字体函数 apr-iconv -> libiconv ->apr
apr-util 连接的辅助工具
libiconv 是一个开源库,解决多语言编码处理转换等应用问题
pcre (perl compatiable regular expressions) 是一个perl库,包括perl兼容的正规表达式。
/share/soft/lamp/apache_source/apr-1.3.8.tar.gz
/share/soft/lamp/nginx/libiconv-1.13.tar.gz
/share/soft/lamp/apache_source/apr-iconv-1.2.1.tar.gz
/share/soft/lamp/apache_source/apr-util-1.3.9.tar.gz
/share/soft/lamp/nginx/pcre-7.9.tar.gz
[root@li ~]# mkdir /usr/src/lamp
--------------------------------------------
apr-1.3.8.tar.gz
[root@li ~]# tar xvf /share/soft/lamp/apache_source/apr-1.3.8.tar.gz -C /usr/src/lamp/
./configure --disable-ipv6 --with-gnu-ld --with-devrandom=/dev/random
注意查看信息
Libraries have been installed in:
/usr/local/apr/lib
[root@li apr-1.3.8]# vim /etc/ld.so.conf.d/lamp.conf --新建一个lamp有关动态库调用路径文件
/usr/local/apr/lib --加上这一句
[root@li apr-1.3.8]# ldconfig --上述新加的路径生效
-----------------------------------------------
libiconv-1.13.tar.gz
[root@li apr-1.3.8]# tar xvf /share/soft/lamp/nginx/libiconv-1.13.tar.gz -C /usr/src/lamp/
[root@li apr-1.3.8]# cd /usr/src/lamp/libiconv-1.13/
./configure --enable-static=yes --with-gnu-ld
make;make install;ldconfig
------------------------------------------------
apr-iconv-1.2.1.tar.gz
[root@li libiconv-1.13]# tar xvf /share/soft/lamp/apache_source/apr-iconv-1.2.1.tar.gz -C /usr/src/lamp/
[root@li lamp]# cd /usr/src/lamp/apr-iconv-1.2.1/
./configure --with-apr=/usr/local/apr/bin/apr-1-config
make ;make install
echo /usr/local/apache2/lib/iconv >> /etc/ld.so.conf.d/lamp.conf
ldconfig
-------------------------------------------------------
[root@li apr-iconv-1.2.1]# tar xvf /share/soft/lamp/apache_source/apr-util-1.3.9.tar.gz -C /usr/src/lamp/
[root@li apr-iconv-1.2.1]# cd /usr/src/lamp/apr-util-1.3.9/
./configure --with-apr=/usr/local/apr/bin/apr-1-config --with-mysql=/usr/local/mysql/ --with-iconv=/usr/local/
make;make install
查看编译信息
Libraries have been installed in:
/usr/local/apr/lib --上面装apr时已经加入了这个路径,所以直接ldconfig
ldconfig
--------------------------------------------------
pcre-7.9.tar.gz
[root@li apr-util-1.3.9]# tar xvf /share/soft/lamp/nginx/pcre-7.9.tar.gz -C /usr/src/lamp/
[root@li apr-util-1.3.9]# cd /usr/src/lamp/pcre-7.9/
./configure --with-gnu-ld --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-rebuild-chartables --enable-newline-is-any
make;make install
查看编译信息
Libraries have been installed in:
/usr/local/lib
echo /usr/local/lib >> /etc/ld.so.conf.d/lamp.conf
ldconfig
---------------------------------------------------------------------------
httpd-2.2.9.tar.gz
--with-mpm=worker 线程模式运行apache,比较适合跑静态的
--with-mpm=prefork 进程模式,适合与php搭建lamp
[root@li pcre-7.9]# tar xvf /share/soft/lamp/apache_source/httpd-2.2.9.tar.gz -C /usr/src/lamp/
[root@li pcre-7.9]# cd /usr/src/lamp/httpd-2.2.9/
[root@li httpd-2.2.9]# ./configure --enable-modules=all --enable-mods-shared=all --enable-authz-owner --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache --enable-echo --enable-example --enable-case-filter --enable-ext-filter --enable-deflate --enable-charset-lite --enable-mime-magic --enable-logio --enable-expires --enable-headers --enable-unique-id --enable-usertrack --enable-version --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --enable-ssl --enable-http --enable-dav --enable-info --enable-cgi --enable-vhost-alias --enable-rewrite --enable-so --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config --with-pcre=/usr/local/ --with-mpm=prefork
make ;make install
vim /usr/local/apache2/conf/httpd.conf
1,修改家目录
DocumentRoot "/web"
<Directory "/web">
2,修改默认访问权限,改为允许所有
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
3,加上支持php的主页
DirectoryIndex index.php index.html --加上index.php
4,修改语言集
Include conf/extra/httpd-languages.conf --打开注释
vim /usr/local/apache2/conf/extra/httpd-languages.conf
DefaultLanguage zh-CN
LanguagePriority zh-CN en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-TW
5,拷贝服务脚本
cp /usr/local/apache2/bin/apachectl /etc/init.d/apache
vim /etc/init.d/apache --加上下面两句支持chkconfig
# chkconfig: - 86 16
# description: Apache is a World Wide Web server.
chkconfig --add apache
chkconfig apache on
--------------------------------------------------------------
下面要安装的是php,但在安装php之前,先安装php的扩展库
php的扩展库
/share/soft/lamp/nginx/freetype-2.1.10.tar.gz --一个开源的,高质量的且可移植的字体引擎
/share/soft/lamp/nginx/libevent-1.4.11-stable.tar.gz --是一个跨平台的事件驱动库
/share/soft/lamp/nginx/libpng-1.2.37.tar.gz --libpng库,被其他程序用于读写png文件
/share/soft/lamp/nginx/libmcrypt-2.5.8.tar.bz2 --数据加密库
/share/soft/lamp/nginx/mhash-0.9.9.9.tar.bz2 --哈希函数库
/share/soft/lamp/nginx/jpegsrc.v6b.tar.gz --jpg图片处理
/share/soft/lamp/nginx/mcrypt-2.6.6.tar.gz --加密算法扩展库,包括有22种算法
/share/soft/lamp/nginx/libxml2-2.7.3.tar.gz--是一个xml c语言版的解析器
/share/soft/lamp/nginx/gd-2.0.35.tar.gz --graphic device图像设备,图像工具库,在网站上使用GD库用来生成缩略图或者用来对图片加水印
/share/soft/lamp/nginx/ruby-1.8.6.tar.gz --ruby, 一种简单快捷的面向对象编程而创的脚本语言
/share/soft/lamp/nginx/libart_lgpl-2.3.20.tar.gz --libart库,绘制高性能的2D图形
/share/soft/lamp/nginx/rrdtool-1.2.30.tar.gz --一个强大的绘图引擎
------------------------------------
freetype-2.1.10.tar.gz
[root@li lamp]# tar xvf /share/soft/lamp/nginx/freetype-2.1.10.tar.gz -C /usr/src/lamp/
[root@li lamp]# cd /usr/src/lamp/freetype-2.1.10/
./configure --with-gnu-ld
make ;make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
----------------------------------------
ibevent-1.4.11-stable.tar.gz
[root@li freetype-2.1.10]# tar xvf /share/soft/lamp/nginx/libevent-1.4.11-stable.tar.gz -C /usr/src/lamp/
[root@li freetype-2.1.10]# cd /usr/src/lamp/libevent-1.4.11-stable/
./configure --with-gnu-ld
make ; make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
----------------------------------------------
libpng-1.2.37.tar.gz
[root@li libpng-1.2.37]# tar xvf /share/soft/lamp/nginx/libpng-1.2.37.tar.gz -C /usr/src/lamp/
[root@li libevent-1.4.11-stable]# cd /usr/src/lamp/libpng-1.2.37/
./configure --enable-maintainer-mode --with-gnu-ld
make ;make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
-------------------------------------------------
libmcrypt-2.5.8.tar.bz2
[root@li libpng-1.2.37]# tar xvf /share/soft/lamp/nginx/libmcrypt-2.5.8.tar.bz2 -C /usr/src/lamp/
[root@li libpng-1.2.37]# cd /usr/src/lamp/libmcrypt-2.5.8/
./configure --with-gnu-ld --enable-static
make ;make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
----------------------------------------------------
mhash-0.9.9.9.tar.bz2
[root@li libmcrypt-2.5.8]# tar xvf /share/soft/lamp/nginx/mhash-0.9.9.9.tar.bz2 -C /usr/src/lamp/
[root@li libmcrypt-2.5.8]# cd /usr/src/lamp/mhash-0.9.9.9/
./configure --with-gnu-ld --enable-maintainer-mode
make; make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
---------------------------------------------------
jpegsrc.v6b.tar.gz
[root@li mhash-0.9.9.9]# tar xvf /share/soft/lamp/nginx/jpegsrc.v6b.tar.gz -C /usr/src/lamp/
[root@li mhash-0.9.9.9]# cd /usr/src/lamp/jpeg-6b/
./configure --enable-shared --enable-static
make ;make install
mkdir -p /usr/local/man/man1
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
-----------------------------------------------------
mcrypt-2.6.6.tar.gz
[root@li jpeg-6b]# tar xvf /share/soft/lamp/nginx/mcrypt-2.6.6.tar.gz -C /usr/src/lamp/
[root@li jpeg-6b]# cd /usr/src/lamp/mcrypt-2.6.6/
./configure --with-libmcrypt-prefix=/usr/local/ --with-libiconv-prefix=/usr/local/ --with-gnu-ld
make ;make install
ldconfig
-----------------------------------------------------
[root@li mcrypt-2.6.6]# tar xvf /share/soft/lamp/nginx/libxml2-2.7.3.tar.gz -C /usr/src/lamp/
[root@li mcrypt-2.6.6]# cd /usr/src/lamp/libxml2-2.7.3/
./configure --with-gnu-ld --enable-ipv6=no(有可能导致yum命令不可用)
make ;make install
注意编译信息
Libraries have been installed in:
/usr/local/lib/python2.4/site-packages
echo /usr/local/lib/python2.4/site-packages >> /etc/ld.so.conf.d/lamp.conf
ldconfig
-------------------------------------------------------------------
gd-2.0.35.tar.gz
[root@li gd-2.0.35]# tar xvf /share/soft/lamp/nginx/gd-2.0.35.tar.gz -C /usr/src/lamp/
[root@li libxml2-2.7.3]# cd /usr/src/lamp/gd-2.0.35/
./configure --with-gnu-ld --with-x --with-libiconv-prefix=/usr/local/ --with-png=/usr/local/ --with-freetype=/usr/local/ --with-fontconfig=/usr --with-jpeg=/usr/local/
** Configuration summary for gd 2.0.34:
Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Fontconfig library: yes
Support for Xpm library: yes
Support for pthreads: yes
make ;make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
[root@xxt401 gd-2.0.35]# make install
cd . && /bin/sh /tmp/jpeg-6b/gd-2.0.35/config/missing –run aclocal-1.9 -I config
aclocal:configure.ac:64: warning: macro `AM_ICONV’ not found in library
cd . && /bin/sh /tmp/jpeg-6b/gd-2.0.35/config/missing –run automake-1.9 –foreign
cd . && /bin/sh /tmp/jpeg-6b/gd-2.0.35/config/missing –run autoconf
configure.ac:64: error: possibly undefined macro: AM_ICONV
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
make: *** [configure] 错误 1
到 http://www.gnu.org/software/gettext/下载了gettext-0.17.tar.gz
cp /usr/lib/libattr.* /lib/ (这个在转载的文章里没说,是因为make的时候报错说没有libattr.la这个文件,所以要复制过去)
tar xzf gettext-0.17.tar.gz
cd gettext-0.17
./configure
make
make install
----------------------------------------
ruby-1.8.6.tar.gz
[root@li gd-2.0.35]# tar xvf /share/soft/lamp/nginx/ruby-1.8.6.tar.gz -C /usr/src/lamp/
[root@li gd-2.0.35]# cd /usr/src/lamp/ruby-1.8.6/
./configure --enable-pthread --enable-shared
make ;make install
ldconfig
---------------------------------------
libart_lgpl-2.3.20.tar.gz
[root@li ruby-1.8.6]# tar xvf /share/soft/lamp/nginx/libart_lgpl-2.3.20.tar.gz -C /usr/src/lamp/
[root@li ruby-1.8.6]# cd /usr/src/lamp/libart_lgpl-2.3.20/
./configure --with-gnu-ld --prefix=/usr
make ;make install
注意编译信息
Libraries have been installed in:
/usr/local/lib
ldconfig
------------------------------------------------
rrdtool-1.2.30.tar.gz
[root@li libart_lgpl-2.3.20]# tar xvf /share/soft/lamp/nginx/rrdtool-1.2.30.tar.gz -C /usr/src/lamp/
[root@li libart_lgpl-2.3.20]# cd /usr/src/lamp/rrdtool-1.2.30/
编译前要先yum install tcl-devel --tcl脚本语言开发环境 产生/usr/lib/tclConfig.sh
./configure --with-gnu-ld --enable-perl-site-install --enable-ruby-site-install --enable-tcl-site --with-tcllib=/usr/lib/tclConfig.sh
Config is DONE!
With MMAP IO: yes
Perl Modules: perl_piped perl_shared
Perl Binary: /usr/bin/perl
Perl Version: 5.8.8
Perl Options:
Ruby Modules: ruby
Ruby Binary: /usr/local/bin/ruby
Ruby Options:
Build Tcl Bindings: yes
Build Python Bindings: yes
Build rrdcgi: yes
Build librrd MT: yes
make ;make install
注意安装信息
Libraries have been installed in:
/usr/local/rrdtool-1.2.30/lib
echo /usr/local/rrdtool-1.2.30/lib >> /etc/ld.so.conf.d/lamp.conf
ldconfig
如果rrdtool安装报下面的错
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no libart-2.0.pc file around.
You may want to set the PKG_CONFIG_PATH variable to point to its
location.
使用下面命令去指定这个环境变量,但这样是临时的
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
永久生效,就加到/etc/profile
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
source /etc/profile --source 使之生效
------------------------------------------------------------------
# rpm -e mysql-devel
# rpm -ivh --force MySQL-devel-community-5.1.39-0.rhel5.i386.rpm
添加环境变量,让编译php的时候能够找到mysql相关文件
# vim /root/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/libexec
修改了环境变量,必须打开新的终端才生效或者su - source /root/.bash_profile
安装php
[root@li rrdtool-1.2.30]# tar xvf /share/soft/lamp/php_source/php-5.2.10.tar.gz -C /usr/src/lamp/
[root@li rrdtool-1.2.30]# cd /usr/src/lamp/php-5.2.10/
编译之前先装几个包
[root@li php-5.2.10]# yum install zlib-devel curl-devel ncurses-devel net-snmp-* bzip2-devel
./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-fastcgi --enable-magic-quotes --disable-ipv6 --with-libxml-dir=/usr/local/ --with-zlib --with-bz2 --enable-calendar --with-curl --with-pcre-dir=/usr/local/ --with-gd=/usr/local/ --with-jpeg-dir=/usr/local/ --with-png-dir=/usr/local/ --with-freetype-dir=/usr/local/ --enable-gd-native-ttf --enable-mbstring --with-mcrypt=/usr/local/ --with-mhash=/usr/local/ --with-mysql=/usr/local/mysql/ --with-mysql-sock=/var/run/mysqld/mysql5.socket --with-ncurses --with-mysqli=/usr/local/mysql/bin/mysql_config --with-snmp --enable-sockets --with-libxml-dir=/usr/local/ --with-iconv-dir=/usr/local/ --enable-zip --enable-zend-multibyte --with-gnu-ld --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-pdo-mysql=/usr/local/mysql/
#make ZEND_EXTRA_LIBS='-liconv' php5.1.13要这个
make;make install
cp /usr/src/lamp/php-5.2.10/php.ini-recommended /usr/local/lib/php.ini
-----------------------------------------------------
查看/usr/local/apache2/conf/httpd.conf
LoadModule php5_module modules/libphp5.so --验证是否自动加了这一句
AddHandler php5-script .php
AddType text/html .php --加上这两句