我的Apache2不能工作,当我尝试运行apache2 --version或任何其他apache命令时,它会出现以下错误:
AH00526: Syntax error on line 89 of /etc/apache2/apache2.conf:
Invalid command 'LockFile', perhaps misspelled or defined by a module not included in the server configuration我的/etc/apache2/apache2.conf (没有无穷无尽的注释)如下所示:
LockFile ${APACHE_LOCK_DIR}/accept.lock
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
User ${APACHE_RUN_USER} Group ${APACHE_RUN_GROUP}
AccessFileName .htaccess
Order allow,deny
Deny from all
Satisfy all
DefaultType None
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
Include mods-enabled/*.load
Include mods-enabled/*.conf
Include ports.conf
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
Include conf.d/
Include sites-enabled/
SetHandler application/x-httpd-php发布于 2020-05-12 19:59:02
读httpd 2.4升级文档。在这些更改中,删除了LockFile指令:
指令AcceptMutex、LockFile、RewriteLock、SSLMutex、SSLStaplingMutex和WatchdogMutexPath已被单个互斥指令替换。您需要在2.2配置中评估这些已删除指令的使用情况,以确定它们是否可以被删除或需要使用Mutex替换。
https://serverfault.com/questions/1016847
复制相似问题