免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 10348 | 回复: 9

[Web] 如何确定当前apache使用的是哪个配置文件 [复制链接]

论坛徽章:
0
发表于 2007-11-12 12:28 |显示全部楼层
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是用的哪个配置文件?

论坛徽章:
0
发表于 2007-11-12 16:58 |显示全部楼层
netstat -tlnp


找到80端口监听的pid


ps ux  找到对应的进程,最后一列显示使用的哪个httpd.

论坛徽章:
0
发表于 2007-11-12 17:08 |显示全部楼层
/etc/httpd/conf/httpd.conf
进入/etc/httpd/conf/
查看!

论坛徽章:
0
发表于 2007-11-12 18:12 |显示全部楼层
原帖由 level 于 2007-11-12 17:08 发表
/etc/httpd/conf/httpd.conf
进入/etc/httpd/conf/
查看!

斑竹,就是发现这个文件与实际WEB发布的路径不符合,才怀疑用了别的配置文件,否则也不会提问了

论坛徽章:
0
发表于 2007-11-12 18:21 |显示全部楼层
原帖由 ccc77 于 2007-11-12 16:58 发表
netstat -tlnp


找到80端口监听的pid


ps ux  找到对应的进程,最后一列显示使用的哪个httpd.


找到httpd有什么用呢? 我的问题是httpd用的哪个配置文件(就是并没有用/etc/httpd/conf/httpd.conf文件)

论坛徽章:
0
发表于 2007-11-13 11:17 |显示全部楼层
/path/to/httpd -V
/path/to/apache -V

论坛徽章:
0
发表于 2007-11-13 14:31 |显示全部楼层
原帖由 linuxnextyear 于 2007-11-13 11:17 发表
/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发布的情况不符,真是奇怪!

论坛徽章:
0
发表于 2007-11-13 20:26 |显示全部楼层
看看 /etc/rc.local 里面,httpd 启动的参数

如果是非默认的配置文件,需要参数载入

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

论坛徽章:
0
发表于 2007-11-14 20:19 |显示全部楼层
原帖由 lhbc 于 2007-11-13 20:26 发表
看看 /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:

论坛徽章:
0
发表于 2007-11-19 10:41 |显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP