歡迎您光臨本站 註冊首頁

如何確定當前apache使用的是哪個配置文件

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

如何確定當前apache使用的是哪個配置文件

centOS 做了個apache+php+mysql的論壇(服務商提供),我看裡面裝了Apache/2.0.52

LUCY:/home/lywang#uname -a
Linux server 2.6.9-42.0.3.ELsmp #1 SMP Fri Oct 6

06:21:39 CDT 2006 i686 i686 i386 GNU/Linux
LUCY:/home/lywang#find / -name httpd.conf
/etc/httpd/conf/httpd.conf
LUCY:/home/lywang#

但我打開httpd.conf 文件看到配置卻不是現在web發布的實際路徑,現在想改個配置
但真正的配置文件找了半天卻找不到,有什麼方法可以確定現在的WEB是用的哪個配置文件?
《解決方案》

netstat -tlnp


找到80埠監聽的pid


ps ux  找到對應的進程,最後一列顯示使用的哪個httpd.
《解決方案》

/etc/httpd/conf/httpd.conf
進入/etc/httpd/conf/
查看!
《解決方案》

原帖由 level 於 2007-11-12 17:08 發表 http://bbs.chinaunix.net/images/common/back.gif
/etc/httpd/conf/httpd.conf
進入/etc/httpd/conf/
查看!
斑竹,就是發現這個文件與實際WEB發布的路徑不符合,才懷疑用了別的配置文件,否則也不會提問了:em08:
《解決方案》

原帖由 ccc77 於 2007-11-12 16:58 發表 http://bbs.chinaunix.net/images/common/back.gif
netstat -tlnp


找到80埠監聽的pid


ps ux  找到對應的進程,最後一列顯示使用的哪個httpd.

找到httpd有什麼用呢? 我的問題是httpd用的哪個配置文件(就是並沒有用/etc/httpd/conf/httpd.conf文件)
《解決方案》

/path/to/httpd -V
/path/to/apache -V
《解決方案》

原帖由 linuxnextyear 於 2007-11-13 11:17 發表 http://bbs.chinaunix.net/images/common/back.gif
/path/to/httpd -V
/path/to/apache -V

LUCY:/home/lywang#httpd -V
Server version: Apache/2.0.52
Server built:   Jul 14 2007 11:53:18
Server's Module Magic Number: 20020903:9
Architecture:   32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

LUCY:/home/lywang#df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3            151668928  47564352  97941080  33% /
/dev/sda1               101086     14046     81821  15% /boot
none                    516252         0    516252   0% /dev/shm

LUCY:/home/lywang#find / -name httpd.conf
/etc/httpd/conf/httpd.conf

系統只找到這個httpd.conf了,但裡面配置明顯和實際WEB發布的情況不符,真是奇怪!
《解決方案》

看看 /etc/rc.local 裡面,httpd 啟動的參數

如果是非默認的配置文件,需要參數載入

find 可能找不到,配置的文件名不一定是 httpd.conf
《解決方案》

原帖由 lhbc 於 2007-11-13 20:26 發表 http://bbs.chinaunix.net/images/common/back.gif
看看 /etc/rc.local 裡面,httpd 啟動的參數

如果是非默認的配置文件,需要參數載入

find 可能找不到,配置的文件名不一定是 httpd.conf

LUCY:/etc#ls -al rc.local
lrwxrwxrwx  1 root root 13 Sep 23 19:11 rc.local -> rc.d/rc.local
LUCY:/etc#cat rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/sbin/ethtool -s eth0 speed 100 duplex full autoneg off > /dev/null 2>&1
/etc/init.d/post_install_agent

毫無頭緒。。。:em11:
《解決方案》

http://www.phpower.net/thread-68-1-1.html

[火星人 ] 如何確定當前apache使用的是哪個配置文件已經有354次圍觀

http://coctec.com/docs/service/show-post-34261.html