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

HOMEリナックスマスター.JP 公式ブログLinuxエラー対処法 > Ubuntu20.04+Apacheのインストールエラー対策
宮崎智広 この記事の監修:宮崎智広(Linux実務・教育歴20年以上・受講者3,100名超)
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


「このままじゃマズい」と感じていませんか?
参考書を開く気力もない、同年代に取り残される不安——
でも安心してください。プロのエンジニアはコマンドを暗記していません。
「現場で使える型」を効率よく使いこなしているだけです。
図解60P/登録10秒/解除も3秒 / 詳細はこちら

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


無料メルマガで学習を続ける

Linuxの実践スキルをメールで毎週お届け。
登録は1分、解除もいつでも可。

登録無料・いつでも解除できます

暗記不要・1時間後にはサーバーが動く

3,100名以上が実践した「型」を無料で公開中

プロのエンジニアはコマンドを暗記していません。
「現場で使える型」を効率よく使いこなしているだけです。
その「型」を図解60Pにまとめた入門マニュアルを、完全無料でプレゼントしています。

登録10秒/合わなければ解除3秒 / 詳細はこちら

Linux無料マニュアル(図解60P) 名前とメールで30秒登録
宮崎 智広

この記事を書いた人

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

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

趣味は、キャンプにカメラ、トラウト釣り。好きな食べ物は、ラーメンにお酒。休肝日が作れない、酒量を減らせないのが悩み。最近、ドラマ「フライトエンジェル」を観て涙腺が崩壊しました。


Linux無料マニュアル(図解60P) 名前とメールで30秒登録