lamp编译之常用参数

来源:互联网 发布:php去掉html标签函数 编辑:程序博客网 时间:2024/05/16 07:17

apache 2.2.22:

./configure  --prefix=/application/apache2.2.22  --enable-deflate  --enable-expires  --enable-headers  --enable-modules=most  --enable-so --with-mpm=worker 


./configure 参数说明:

--prefix=/application/apache2.2.22指定apache的安装路径,如果不指定默认为/usr/local/apache2

--enable-deflate:提供对内容的压缩传输编码,此时apache调优的一个重要选项。

--enable-expirees:激活允许通过配置文件控制http的"Expires"and "Cache-Control"头内容,即对图片,css,js等内容提供客户端浏览器缓存,这是apache调优的一个重要选项。

--enable-header:允许对http请求头的控制

--with-mpm=worker:选择apache mpm模式为worker模式,因worker模式的原理是使用线程来处理请求,所以能处理更多的并发请求,系统资源的开销小于基于进程的MPM prefork,如果不指定这个参数,默认为prefork默认,此是apache调优的一个选项。

--enable-rewrite:提供基于url规则的重写功能

--enable-so:激活apache的dso模块的支持,即在以后可以以DSO方式编译安装共享模块。


mysql-5.1.62:

./configure \
--prefix=/usr/local/mysql \
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \
--localstatedir=/usr/local/mysql/data \
--enable-assembler \
--enable-thread-safe-client \
--with-mysqld-user=mysql \
--with-big-tables \
--without-debug \
--with-pthread \
--enable-assembler \
--with-extra-charsets=complex \
--with-readline \
--with-ssl \
--with-embedder-server \
--enable-local-infile \
--with-plugins=partition,innobase \
--with-plugin-PLUGIN \
--with-mysqld-ldflags=-all-static \
--with-client-idflags=-all-static


--prefix=/usr/local/mysql \

--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock\

--localstatedir=/usr/local/mysql/data \#数据文件路径

--enable-assembler \

--enable-thread-safe-client \ #以线程安全方式编译客户端

--with-mysqld-user=mysql \

--with-big-tables \

--without-debug \ #使用非debug模式

--with-pthread \ #强制使用pthread线程程序库编译

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

--with-extra-charsets=complex \

--with-readline \

--with-ssl \

--with-embedder-server \

--enable-local-infile \

--with-plugins=partition,innobase \

--with-plugin-PLUGIN \

--with-mysqld-ldflags=-all-static \ #服务器使用静态库(优化性能)

--with-client-idflags=-all-static #客户端使用静态库(优化性能)


php5.3.10:


./configure \
--prefix=/application/php5.3.10 \
--with-apxs2=/application/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-xmlrpc \
--with-openssl \
--with-zlib \
--with-freetpe-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 \


以下为解决msn robot "Call to undefined function pcntl_fork()"报错而加,适合nagios的php环境
--enable-sigchild \
--enable-pcntl \
--enable-bcmath



【文章作者】曾健生

【作者邮箱】zengjiansheng1@126.com

【作者QQ】190678908

【作者博客】blog.csdn.net/newjueqi