轻松获取LAMP,LNMP环境编译参数配置

作者:Mr.Xiong /分类:系统管理 
字号:L M S
 
 

大家是否遇到过去了新公司,公司内的LAMP,LNMP等所有的环境都是配置好的(已经在提供服务了),公司又没有留下部署文档,甚至安装LAMP,LAMP等环境的人已经和你交接完离职了,那么线上服务器(lamp,lnmp)的编译环境等就成了黑盒,如果不改造还好,当服务器需要迁移改造时,我们(新手的你)没有老的环境编译情况,就会很郁闷,生怕编译错了影响线上程序运行。
    其实,很多时候,是可以看到软件的编译的情况的,下面以lamp,lnmp环境为例为大家一一道来。

1)查看web服务的编译参数
  a.查看nginx的编译参数:
   /home/oldboy/run/nginx/sbin/nginx -V
 范例1:

 
1
2
3
4
[root@VM-001 ~]# /home/oldboy/run/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

提示:/home/oldboy/run/为普通用户起的nginx服务命令路径 
b.查看apache的编译参数:
    cat /home/oldboy/run/apache/build/config.nice 
 范例2:

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@VM-002 ~]# cat /home/oldboy/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/oldboy/run/为普通用户起的apache服务命令路径

2)查看MySQL数据库的编译参数:
grep CONFIGURE_LINE /app/mysql/bin/mysqlbug
提示:还发现很多人先cat,在grep,很不专业,应杜绝。
范例3:

 
1
2
3
4
5
[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服务安装路径
3)查看php编译参数:
/app/php/bin/php -i|grep configure
 范例4:

 
1
2
3
4
5
6
[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'

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

命令如下:

查看mysql编译参数:
cat /usr/local/mysql/bin/mysqlbug | grep CONFIGURE_LINE
查看apache编译参数:
cat $apachehome$/build/config.nice
查看nginx编译参数:
#/usr/local/nginx/sbin/nginx -V
查看php编译参数:
$PHP$/bin/php -i | grep configure
本文老男孩老师的http://oldboy.blog.51cto.com/2561410/929333文章的分享!

最新文章

  1. log4j分离日志输出 自定义过滤 自定义日志文件
  2. 11月1日上午PHP批量删除
  3. 转载 r.js打包经验
  4. 这世上倒底有没有神仙——说“Excel不是数据库,是不是犯了白马非马论的错误??
  5. jquery怎么跳出当前的each循环
  6. mongo学习笔记(五):分片
  7. Js闭包函数
  8. CCPC网赛,HDU_5832 A water problem
  9. poj 1819 Disks
  10. java 版本SQLHelper
  11. C#框架类
  12. linux读书笔记1
  13. Tomcat connecttimeout sessiontimeout
  14. 【log4j】使用注意事项
  15. iOS常用的代码块整理
  16. SQLServer数据库还原:无法在已有的mdf文件上还原文件
  17. js new关键字
  18. SOS does not support the current target architecture解决方法
  19. Arrow function restore
  20. Plotly绘图工具(多用于统计)

热门文章

  1. abap seach help 搜索帮助
  2. 由于SID连接不匹配,监听器拒绝连接。
  3. 分享我积攒的测试相关的资料收集awesome-test
  4. ca认证(https)
  5. USACO1.6 Superprime Rib
  6. css实现毛玻璃效果
  7. HTML简单介绍(个人角度)
  8. poj2478(欧拉函数)
  9. [转帖] Linux 下面 perl 命令的简介
  10. Spring(四)--bean的属性赋值