Ubuntu20.04+Apacheのインストールエラー対策

HOMEリナックスマスター.JP 公式ブログLinuxエラー対処法 > Ubuntu20.04+Apacheのインストールエラー対策

図解60p「Linuxサーバー構築入門マニュアル」無料
登録10秒/自動返信でDL/合わなければ解除3秒
Ubuntu20.04にApacheをインストールした際、
次のエラーが発生した場合の対処法を紹介します。

・Invalid command 'RewriteEngine'
・Invalid command 'SSLEngine'
・Invalid command 'Header'

Invalid command 'RewriteEngine'

エラー内容

Jan 19 03:14:28 linuxmaster-01 apachectl[2433]: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration


対応手順

$ sudo a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
systemctl restart apache2


Invalid command 'SSLEngine'

エラー内容

Jan 19 03:15:25 linuxmaster-01 apachectl[2485]: Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration


対応手順

$ sudo a2enmod ssl
Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Enabling module socache_shmcb.
Enabling module ssl.
See /usr/share/doc/apache2/README.Debian.gz on how to configure SSL and create
self-signed certificates.
To activate the new configuration, you need to run:
systemctl restart apache2


Invalid command 'Header'

エラー内容

Jan 19 03:18:15 linuxmaster-01 apachectl[2599]: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration


対応手順

$ sudo a2enmod headers
Enabling module headers.
To activate the new configuration, you need to run:
systemctl restart apache2




無料プレゼント
図解60p「Linuxサーバー構築入門マニュアル」
独学で詰まる前に、“型(手順書)”で最初の環境構築をサクッと終わらせましょう。
登録10秒/自動返信でDL/合わなければ解除3秒
無料で受け取る ※メールアドレスだけでもOK(必須項目は最小限)

宮崎 智広

この記事を書いた人

宮崎 智広(みやざき ともひろ)

株式会社イーネットマーキュリー代表。現役のLinuxサーバー管理者として15年以上の実務経験を持ち、これまでに累計3,100名以上のエンジニアを指導してきたLinux教育のプロフェッショナル。「現場で本当に使える技術」を体系的に伝えることをモットーに、実践型のLinuxセミナーの開催や無料マニュアルの配布を通じてLinux人材の育成に取り組んでいる。

<<関連記事>>
・rpmdbが壊れた場合の修復手順
・FortiGuardのスパムメールブロックを解除方法
・LinuxにUSB外付けHDDを接続する(NTFSフォーマットの場合要注意)
・vi(vim)で「readonly」エラーの対処法 sudoを忘れた編集を消さず保存する方法(強制保存の裏技も)
・yumコマンドがロックファイルエラーになった時の対処


図解60pのLinux無料マニュアル
登録10秒/自動返信でDL
無料で受け取る