我想在我的 Apache Web 服务器配置文件中添加一些配置,这样任何人都可以帮助我在 Linux/Ubunbtu 中使用命令。
首先找到您的 httpd 进程:
ps -ef | grep httpd
root 14124 1096 0 21:46 ? 00:00:00 /opt/apache/bin/httpd -k start
httpd 14125 14124 0 21:46 ? 00:00:00 /opt/apache/bin/httpd -k start
httpd 14126 14124 0 21:46 ? 00:00:00 /opt/apache/bin/httpd -k start
httpd 14127 14124 0 21:46 ? 00:00:00 /opt/apache/bin/httpd -k start
httpd 14240 6263 0 21:49 pts/0 00:00:00 grep --color=auto http
Run Code Online (Sandbox Code Playgroud)
这会告诉你:
-f CONFIG-FILE。对于情况 2.,你就完成了!在情况 1 中,转到 httpd 进程所在的目录并运行以下命令:
cd /opt/apache/bin
./apachectl -V
Server version: Apache/2.4.37 (Unix)
Server built: Jun 21 2019 21:32:47
Server's Module Magic Number: 20120211:83
Server loaded: APR 1.6.5, APR-UTIL 1.6.1
Compiled using: APR 1.6.5, APR-UTIL 1.6.1
Architecture: 64-bit
Server MPM: worker
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-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 DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/opt/apache"
-D SUEXEC_BIN="/opt/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Run Code Online (Sandbox Code Playgroud)
现在你就拥有了!最后一行:-D SERVER_CONFIG_FILE="conf/httpd.conf"告诉你配置文件是conf目录下的httpd.conf。由于它是绝对路径,因此请查看 的值HTTPD_ROOT以了解此 Apache 的根目录在哪里。这里是-D HTTPD_ROOT="/opt/apache"。
所以完整路径是:HTTPD_ROOT/SERVER_CONFIG_FILE。这里,/opt/apache/conf/httpd.conf。
另一种方法:
cd /opt/apache/bin
./httpd -S
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助!
| 归档时间: |
|
| 查看次数: |
7786 次 |
| 最近记录: |