Chinaunix首页 | 论坛 | 博客
  • 博客访问: 455971
  • 博文数量: 61
  • 博客积分: 507
  • 博客等级: 下士
  • 技术积分: 1185
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-20 00:19
文章分类

全部博文(61)

文章存档

2014年(13)

2013年(21)

2012年(27)

分类:

2014-05-28 10:59:20

原文地址:LAMP install 作者:ANHUI

1)openssl-0.9.8j.tar.gz 安装
 
./config --prefix=/LAMP/openssl
make
make install

2)zlib-1.2.3.tar.gz 安装

./configure --prefix=/LAMP/zlib/
make
make install

3)jpeg-6b.tar.gz  安装
./configure --prefix=/LAMP/jpeg/ --enable-shared --enable-static
make
mkdir -p /LAMP/jpeg/include/
mkdir -p /LAMP/jpeg/lib/
mkdir -p /LAMP/jpeg/bin/cjpeg
mkdir -p /LAMP/jpeg/man/man1/
make install


4)freetype-2.3.8.tar.gz  安装 (make需要3.8以上版本)
cd  freetype-2.3.8/builds/unix
./configure --prefix=/LAMP/jpeg/
make
make install

5)libpng-1.2.8-config.tar.gz 安装

./configure --prefix=/LAMP/libpng/
make
make install

6)gd-2.0.35.tar.gz  安装 (autoconf需要2.58以上)

./configure --prefix=/LAMP/gd/   --with-png=/LAMP/libpng/ --with-freetype=/LAMP/freetype/ --with

-jpeg=/LAMP/jpeg/ --with-zlib=/LAMP/zlib/
cp /LAMP/libpng/pngconf.h  .
cp /LAMP/libpng/png.h  .
make
make install

gd-2.0.35]# make
cd . && /bin/sh /data/soft/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 /data/soft/gd-2.0.35/config/missing --run automake-1.9 --foreign
cd . && /bin/sh /data/soft/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] Error 1

包上面的错误时请安装gettext-0.17

[root@localhost gettext-0.17]# ./configure

 

7)mysql-5.0.67.tar.gz 安装

./configure --prefix=/LAMP/mysql --with-extra-charsets=all  --with-openssl=/LAMP/openssl/ --with

-zlib-dir=/LAMP/zlib/  --with-charset=utf8 --with-unix-socket-path=/tmp/mysql.sock  --enable-

assembler


 --with-openssl= 支持SSL连接的
 --enable-thread-safe-client 客户端支持线程的
 --with-charset=utf8 指定缺省字符集为utf8
 --with-extra-charsets=all 将MySQL所有支持的字符集编译进来


make


make install

mkdir /LAMP/mysql/var

cp support-files/my-medium.cnf /LAMP/mysql/var/my.cnf

/LAMP/mysql/bin/mysql_install_db

 


Mysql编译安装参数优化
1. -static  13%
   --with-client-ldflags=-all-static
   --with-mysqld-ldflags=-all-static
静态链接提高13%性能

2. -pgcc  1%
   CFLAGS="-O3 -mpentiumpro -mstack-align-double" CXX=gcc \
     CXXFLAGS="-O3 -mpentiumpro -mstack-align-double \
     -felide-constructors -fno-exceptions -fno-rtti"
如果是Inter处理器,使用pgcc提高1%性能

3. Unix Socket  7.5%
   --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
使用unix套接字链接提高7.5%性能,所以在windows下mysql性能肯定不如unix下面

4. --enable-assembler
允许使用汇编模式(优化性能)

--without-debug \去除debug模式
--with-extra-charsets=gb2312 \添加gb2312中文字符支持
--enable-assembler \使用一些字符函数的汇编版本
--without-isam \去掉isam表类型支持 现在很少用了 isam表是一种依赖平台的表
--without-innodb \去掉innodb表支持 innodb是一种支持事务处理的表,适合企业级应用
--with-pthread \强制使用pthread库(posix线程库)
--enable-thread-safe-client \以线程方式编译客户端
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \以纯静态方式编译服务端和客户端
--with-federated-storage-engine 支持federated存储引擎

 


8)httpd-2.2.11.tar.gz 安装

./configure --prefix=/LAMP/apache/  --enable-so --enable-ssl   --enable-cgi   --enable-rewrite -

-enable-cache  --with-mpm=MPM --enable-mods-shared=all --with-ssl=/LAMP/openssl  --with-

z=/LAMP/zlib  --with-mysql=/LAMP/mysql

--with-mpm=MPM          Choose the process model for Apache to use.
                          MPM={beos|event|worker|prefork|mpmt_os2}
模块选项
有两种使用模块的方法:一是静态连接进核心,二是作为DSO模块动态加载;如果编译中包含任何DSO模块,则

mod_so会被自动包含进核心。如果希望核心能够装载DSO,但不实际编译任何DSO模块,则需明确指定"--

enable-so=static"。
--enable-MODULE=shared  将MODULE编译为DSO(可用于所有模块)
--enable-mods-shared=all  将MODULE-LIST中的所有模块都编译成DSO(可用于所有模块)

--enable-cache          dynamic file caching
--enable-rewrite        rule based URL manipulation

 

9) php-5.2.8.tar.gz 安装
./configure --prefix=/LAMP/php/ --with-apxs2=/LAMP/apache/bin/apxs --with-gd=/LAMP/gd/ --with-

jpeg-dir=/LAMP/jpeg/ --with-zlib=/LAMP/zlib/ --with-png-dir=/LAMP/libpng/ --with-freetype-

dir=/LAMP/freswetype --with-mysql-sock=/tmp/mysql.sock --with-mysql=/LAMP/mysql --enable-

mbstring=all --enable-gd-native-ttf --with-ttf --enable-gd-jis-conv  --enable-xml --enable-sockets

make

make test
make install

添加httpd.conf文件如下两行:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

cp php.ini-dist /LAMP/php/include/php.ini
把PHP源文件目录下的php.ini-disk拷贝到/usr/local/lib/php.ini.
通过修改php.ini里面的upload_max_filesize = 2M,把2M换大的好像就行了,

 

对php编译选项的解释:

--prefix=/usr/local/php   //指定PHP的安装目录

--with-apxs2=/usr/local/apache2/bin/apxs      //支持Apache模块

--with-mysql=/usr/local/mysql    //支持MySQl

--with-gd=/usr/local/libgd     //支持GD库

--enable-gd-native-ttf     //激活对本地 TrueType 字符串函数的支持

--with-ttf     //激活对 FreeType 1.x 的支持

--with-freetype-dir=/usr/local/freetype    //激活对 FreeType 2.x 的支持

--with-jpeg-dir=/usr/local/libjpeg //激活对 jpeg-6b 的支持

--with-png-dir=/usr   //激活对 png 的支持

--with-zlib-dir=/usr/local/zlib //激活对zlib 的支持

--enable-mbstring    //激活mbstring模块

--enable-gd-jis-conv //使JIS-mapped可用,支持日文字体

--with-mail   //支持Mail函数

--enable-xml     //支持XML

--enable-sockets      //支持套接字

10)ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz 安装
sh install.sh

阅读(1120) | 评论(0) | 转发(0) |
0

上一篇:lvs+keepalived搭建

下一篇:ZendGuardLoader配置

给主人留下些什么吧!~~