第一步:找到apache启动命令:
ps -ef|grep httpd
root 10575 1 0 19:45 ? 00:00:03 /usr/sbin/httpd -k start
myuser 15356 2982 0 Jan19 ? 00:00:00 /home/apache/bin/httpd -f /home/apache/conf/httpd.conf -k start
如果看到 httpd命令使用了-f选项,则可以直接得到配置文件目录。
如果httpd命令没有使用-f选项,如:
ps -ef|grep httpd
root 10575 1 0 19:45 ? 00:00:03 /usr/sbin/httpd -k start
apache 10577 10575 0 19:45 ? 00:00:00 /usr/sbin/httpd -k start
apache 10583 10575 0 19:45 ? 00:00:00 /usr/sbin/httpd -k start
apache 10584 10575 0 19:45 ? 00:00:00 /usr/sbin/httpd -k start
apache 10587 10575 0 19:45 ? 00:00:00 /usr/sbin/httpd -k start
apache 10590 10575 0 19:45 ? 00:00:00 /usr/sbin/httpd -k start
apache 10591 10575 0 19:45 ? 00:00:00 /usr/sbin/httpd -k start
则执行第二步。
第二步:执行httpd -S命令,找出配置文件路径
/usr/sbin/httpd -S
VirtualHost configuration:
211.157.8.76:80 is a NameVirtualHost
default server wap.wapwu.com (/etc/httpd/conf/httpd.conf:1041)
port 80 namevhost wap.wapwu.com (/etc/httpd/conf/httpd.conf:1041)
port 80 namevhost wapu.wapwu.com (/etc/httpd/conf/httpd.conf:1052)
wildcard NameVirtualHosts and _default_ servers:
_default_:443 211.157.8.76 (/etc/httpd/conf.d/ssl.conf:88)
Syntax OK
从apache输出的日志信息中可以看到配置文件是在/etc/httpd/conf/ 目录下。
root@raykaeso ~]# netstat -ntlp //查看服务器运行的进程服务和监听端口Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:8005 0.0.0.0:* LISTEN 16725/java
tcp 0 0 0.0.0.0:8009 0.0.0.0:* LISTEN 16725/java
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 2138/mongod
tcp 0 0 0.0.0.0:8010 0.0.0.0:* LISTEN 14335/java
tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 859/memcached
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 16725/java
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 872/httpd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 873/sshd
tcp6 0 0 :::3306 :::* LISTEN 23443/mysqld
tcp6 0 0 :::11211 :::* LISTEN 859/memcached
tcp6 0 0 :::22 :::* LISTEN 873/sshd
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)