How to resolve httpd error – Invalid command IndexOptions

While starting httpd with, systemctl httpd startyou may get the following error.

# service httpd status
Redirecting to /bin/systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2021-1-01 10:42:33 EDT; 1s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 17601 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 17601 (code=exited, status=1/FAILURE)

July 06 10:42:33 Mellon-02 systemd[1]: Starting The Apache HTTP Server...
July 06 10:42:33 Mellon-02 httpd[17601]: AH00526: Syntax error on line 16 of /etc/httpd/conf.d/autoindex.conf:
July 06 10:42:33 Mellon-02 httpd[17601]: Invalid command 'IndexOptions', perhaps misspelled or defined by a module not included in the server configuration
July 06 10:42:33 Mellon-02 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
July 06 10:42:33 Mellon-02 systemd[1]: Failed to start The Apache HTTP Server.
July 06 10:42:33 Mellon-02 systemd[1]: Unit httpd.service entered failed state.
July 06 10:42:33 Mellon-02 systemd[1]: httpd.service failed.

  • To resolve this error, check to see if the module that manages IndexOptions is installed and enabled. The above error Invalid command IndexOptions requires the mod_autoindex module installed and configured as below.

LoadModule autoindex_module modules/mod_autoindex.so

  • To configure this option, find the relevant module file in $HTTPD_HOME/conf.modules.d/00-base.conf file (for Apache 2.4) and $HTTPD_HOME/conf/httpd.conf file (for Apache 2.2).

Leave a Reply

Your email address will not be published. Required fields are marked *