I'm trying to track down the cause of an intermittent Apache Internal Server Error during MediaWiki edits and uploads. Some sources tell me to check .htaccess for errors.
I can audit for .htaccess with:
sudo find /var -name '.htaccess' -exec ls -al {} \;
However, I don't know what the Apache command is to test the .htaccess file. That is, I don't know what to plug into the -exec part of find.
I've looked at apachectl and tried apachectl test, but it looks like a dead end:
$ apachectl test
Usage: /usr/sbin/httpd [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed vhost settings
-t -D DUMP_RUN_CFG : show parsed run settings
-S : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG
-t -D DUMP_MODULES : show all loaded modules
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files
-T : start without DocumentRoot(s) check
-X : debug mode (only one worker, do not detach)
I have SSH access to the box, and that's how I perform the maintenance. There's no browser available, but I could probably work with lynx if required.
How do I test the various .htaccess shown below from the command line?
$ sudo find /var -name '.htaccess' -exec ls -l {} \;
-rw-r----- 1 root apache 180 Aug 9 2015 /var/www/html/wiki/images/.htaccess
-rw-r----- 1 root apache 14 Aug 9 2015 /var/www/html/wiki/images/deleted/.htaccess
-rw-r----- 1 root apache 14 May 25 2015 /var/www/html/wiki/languages/.htaccess
-rw-r----- 1 root apache 14 May 25 2015 /var/www/html/wiki/serialized/.htaccess
-rw-r----- 1 root apache 14 May 25 2015 /var/www/html/wiki/cache/.htaccess
-rw-r----- 1 root apache 14 May 25 2015 /var/www/html/wiki/includes/.htaccess
-rw-r----- 1 root apache 14 May 25 2015 /var/www/html/wiki/maintenance/archives/.htaccess
-rw-r----- 1 root apache 14 May 25 2015 /var/www/html/wiki/maintenance/.htaccess
-rw-r----- 1 root apache 180 Aug 9 2015 /var/www/html/.htaccess
$ apachectl -v
Server version: Apache/2.4.6 (CentOS)
Server built: May 12 2016 10:27:23