首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Apache2:无效命令'LockFile‘

Apache2:无效命令'LockFile‘
EN

Server Fault用户
提问于 2020-05-12 19:22:13
回答 1查看 2.3K关注 0票数 0

我的Apache2不能工作,当我尝试运行apache2 --version或任何其他apache命令时,它会出现以下错误:

代码语言:javascript
复制
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 (没有无穷无尽的注释)如下所示:

代码语言:javascript
复制
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
EN

回答 1

Server Fault用户

回答已采纳

发布于 2020-05-12 19:59:02

httpd 2.4升级文档。在这些更改中,删除了LockFile指令:

指令AcceptMutex、LockFile、RewriteLock、SSLMutex、SSLStaplingMutex和WatchdogMutexPath已被单个互斥指令替换。您需要在2.2配置中评估这些已删除指令的使用情况,以确定它们是否可以被删除或需要使用Mutex替换。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1016847

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档