轻松获取LAMP或LNMP环境编译参数


查看web服务的编译参数

1. 查看nginx的编译参数:

/apps/nginx/sbin/nginx -V
范例:

[root@VM-001 ~]# /apps/nginx/sbin/nginx -V
nginx version: nginx/0.8.50 
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-48) 
configure arguments: --prefix=/app/nginx 

2. 查看apache的编译参数:

cat /home/tests/run/apache/build/config.nice
范例:

[root@VM-002 ~]# cat /home/tests/run/apache/build/config.nice 
#! /bin/sh 
# 
# Created by configure 
"./configure" \ 
"--prefix=/app/apache2.2.9" \ 
"--enable-deflate" \ 
"--enable-headers" \ 
"--enable-modules=so" \ 
"--enable-so" \ 
"--with-mpm=worker" \ 
"--enable-rewrite" \ 
"--enable-cgi" \ 
"$@" 

提示:/home/tests/run/为普通用户起的apache服务命令路径


3.查看MySQL数据库的编译参数:

grep CONFIGURE_LINE /app/mysql/bin/mysqlbug
提示:还发现很多人先cat,在grep,很不专业,应杜绝。
范例:

[root@VM-001~]# grep CONFIGURE_LINE /app/mysql/bin/mysqlbug 
CONFIGURE_LINE="./configure '--prefix=/app/mysql/' '--enable-assembler' '--with-extra-charsets=complex' '--enable-thread-safe-client' '--with-big-tables' '--with-readline' '--with-ssl' '--with-embedded-server' '--enable-local-infile' '--with-plugins=partition,innobase' '--with-plugin-PLUGIN'" 
`test -n "$CONFIGURE_LINE" && echo "Configure command: $CONFIGURE_LINE"`

提示:/app为mysql服务安装路径


4.查看php编译参数:
/app/php/bin/php -i|grep configure

范例:

[root@VM-001 ~]# /app/php/bin/php -i|grep configure 
Configure Command => './configure' '--prefix=/app/php' '--with-apxs2=/app/apache/bin/apxs' '--with-mysql=shared,/app/mysql' '--with-ttf=shared' '--with-freetype-dir' '--with-gd' '--with-zlib' '--with-jpeg-dir' '--with-png-dir' '--with-iconv=/app/libiconv' '--enable-short-tags' '--enable-sockets' '--enable-zend-multibyte' '--enable-soap' '--with-openssl' '--enable-mbstring' '--enable-static' '--enable-gd-native-ttf' '--with-curl' '--with-xsl' '--enable-ftp' '--with-libxml-dir' 

 



posted @ 2016-12-30 11:13  純黑色  阅读(170)  评论(0编辑  收藏  举报