輕鬆獲取LAMP,LNMP環境編譯參數配置[轉載]


大家是否遇到過去了新公司,公司內的LAMP,LNMP等所有的環境都是配置好的(已經在提供服務了),公司又沒有留下部署文檔,甚至安裝LAMP,LAMP等環境的人已經和你交接完離職了,那麼線上服務器(lamp,lnmp)的編譯環境等就成了黑盒,如果不改造還好,當服務器需要遷移改造時,我們(新手的你)沒有老的環境編譯情況,就會很鬱悶,生怕編譯錯了影響線上程序運行。
其實,很多時候,是可以看到軟件的編譯的情況的,下面老男孩就以lamp,lnmp環境爲例爲大家一一道來。

1)查看web服務的編譯參數
a.查看nginx的編譯參數:
/home/oldboy/run/nginx/sbin/nginx -V
範例1:

  1. [root@VM-001 ~]# /home/oldboy/run/nginx/sbin/nginx -V
  2. nginx version: nginx/0.8.50
  3. built by gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
  4. configure arguments: --prefix=/app/nginx

提示:/home/oldboy/run/爲普通用戶起的nginx服務命令路徑 
b.查看apache的編譯參數:
cat /home/oldboy/run/apache/build/config.nice 
範例2:

  1. [root@VM-002 ~]# cat /home/oldboy/run/apache/build/config.nice
  2. #! /bin/sh
  3. #
  4. # Created by configure
  5. "./configure" \
  6. "--prefix=/app/apache2.2.9" \
  7. "--enable-deflate" \
  8. "--enable-headers" \
  9. "--enable-modules=so" \
  10. "--enable-so" \
  11. "--with-mpm=worker" \
  12. "--enable-rewrite" \
  13. "--enable-cgi" \
  14. "$@"

提示:/home/oldboy/run/爲普通用戶起的apache服務命令路徑

2)查看MySQL數據庫的編譯參數:
grep CONFIGURE_LINE /app/mysql/bin/mysqlbug
提示:還發現很多人先cat,在grep,很不專業,應杜絕。
範例3:

  1. [root@VM-001~]# grep CONFIGURE_LINE /app/mysql/bin/mysqlbug
  2. 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'"
  3. `test -n "$CONFIGURE_LINE" && echo "Configure command: $CONFIGURE_LINE"`

提示:/app爲mysql服務安裝路徑
3)查看php編譯參數:
/app/php/bin/php -i|grep configure
範例4:

  1. [root@VM-001 ~]# /app/php/bin/php -i|grep configure
  2. 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服務安裝路徑

本文出自 “老男孩的linux博客” 博客

人生其實就這樣,睜一隻眼,閉一隻眼,就這樣過去了
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章