You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu部署Laravel至AWS遇Apache报错:ServerAdmin命令无效(拼写错误)

解决Apache重载时"Invalid command 'ServerAdmin'"错误

问题原因

你的Apache虚拟主机配置文件存在两处拼写错误:

  • SeverAdmin 应为 ServerAdmin(缺少字母'r')
  • SeverAlias 应为 ServerAlias(缺少字母'r')

Apache无法识别拼写错误的指令,因此重载服务时抛出"Invalid command"错误。

修正后的完整配置

<VirtualHost *:80>
    ServerAdmin ...@gmail.com
    ServerName domain.com
    ServerAlias www.domain.com
    DocumentRoot /var/www/domain/public
    
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/domain>
        Require all granted
        AllowOverride All
        Options Indexes Multiviews FollowSymLinks
    </Directory>
</VirtualHost>

验证与重载

修正配置后,先检查配置文件语法是否正确:

sudo apache2ctl configtest

如果输出Syntax OK,再重载Apache服务:

sudo systemctl reload apache2.service

内容的提问来源于stack exchange,提问作者Nay Aung Lin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 05:10:23