Languages
[Edit]
EN

Linux apache2 FIX - apachectl[12915]: Invalid command 'ProxyPreserveHost', perhaps misspelled or defined by a module not included in the server configuration

4 points
Created by:
martineau
1350

Problem:

Invalid command 'ProxyPreserveHost', perhaps misspelled or defined by a module not included in the server configuration

Full problem:

root@server:/# systemctl status apache2.service
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2021-10-10 15:28:48 CEST; 9s ago
     Docs: https://httpd.apache.org/docs/2.4/
  Process: 12915 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Oct 10 15:28:48 server systemd[1]: Starting The Apache HTTP Server...
Oct 10 15:28:48 server apachectl[12915]: AH00526: Syntax error on line 3 of /etc/apache2/sites-enabled/my-domain.com.conf:
Oct 10 15:28:48 server apachectl[12915]: Invalid command 'ProxyPreserveHost', perhaps misspelled or defined by a module not included in the server configuration
Oct 10 15:28:48 server apachectl[12915]: Action 'start' failed.
Oct 10 15:28:48 server apachectl[12915]: The Apache error log may have more information.
Oct 10 15:28:48 server systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Oct 10 15:28:48 server systemd[1]: apache2.service: Failed with result 'exit-code'.
Oct 10 15:28:48 server systemd[1]: Failed to start The Apache HTTP Server.

Solution:

sudo a2enmod proxy
sudo /etc/init.d/apache2 restart

 

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join