Page 1 of 1

Apache keeps failing

PostPosted: Thu Jun 16, 2016 1:12 pm
by kevin
Hi guys,
I'm starting to get frustrated with this issue.

The apache service fails on boot and I cant get it to start up again.

For example:

Code: Select all
vici2:~ # sudo service apache start                                               
Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xn" for details.
vici2:~ # systemctl status apache2.service
apache2.service - The Apache Webserver
   Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled)
   Active: failed (Result: exit-code) since Thu 2016-06-16 14:00:17 EDT; 14s ago
  Process: 21950 ExecStop=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k graceful-stop (code=exited, status=1/FAILURE)
  Process: 21945 ExecStart=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k start (code=exited, status=1/FAILURE)
 Main PID: 21945 (code=exited, status=1/FAILURE)

Jun 16 14:00:17 vici2 start_apache2[21945]: AH00526: Syntax error on line 7 of...:
Jun 16 14:00:17 vici2 start_apache2[21945]: Invalid command 'Order', perhaps m...n
Jun 16 14:00:17 vici2 start_apache2[21950]: AH00526: Syntax error on line 7 of...:
Jun 16 14:00:17 vici2 start_apache2[21950]: Invalid command 'Order', perhaps m...n
Jun 16 14:00:17 vici2 systemd[1]: Failed to start The Apache Webserver.
Hint: Some lines were ellipsized, use -l to show in full.
vici2:~ # journalctl -xn
-- Logs begin at Wed 2016-06-15 11:32:58 EDT, end at Thu 2016-06-16 14:00:31 EDT.
Jun 16 14:00:06 vici2 CRON[21860]: pam_unix(crond:session): session closed for use
Jun 16 14:00:16 vici2 sudo[21934]: root : TTY=pts/12 ; PWD=/root ; USER=root ; COM
Jun 16 14:00:16 vici2 sudo[21934]: pam_unix(sudo:session): session opened for user
Jun 16 14:00:17 vici2 start_apache2[21945]: AH00526: Syntax error on line 7 of /et
Jun 16 14:00:17 vici2 start_apache2[21945]: Invalid command 'Order', perhaps missp
Jun 16 14:00:17 vici2 start_apache2[21950]: AH00526: Syntax error on line 7 of /et
Jun 16 14:00:17 vici2 start_apache2[21950]: Invalid command 'Order', perhaps missp
Jun 16 14:00:17 vici2 systemd[1]: Failed to start The Apache Webserver.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has failed.
--
-- The result is failed.
Jun 16 14:00:17 vici2 sudo[21934]: pam_unix(sudo:session): session closed for user
Jun 16 14:00:31 vici2 kernel: SFW2-INext-ACC-TCP IN=eth0 OUT= MAC=00:********




- ViciBox v.7.0.2-160325

Re: Apache keeps failing

PostPosted: Thu Jun 16, 2016 2:50 pm
by chornyi_taras
kevin wrote:
Code: Select all

Jun 16 14:00:17 vici2 start_apache2[21945]: AH00526: Syntax error on line 7 of...:
Jun 16 14:00:17 vici2 start_apache2[21945]: Invalid command 'Order', perhaps m...n
Jun 16 14:00:17 vici2 start_apache2[21950]: AH00526: Syntax error on line 7 of...:
Jun 16 14:00:17 vici2 start_apache2[21950]: Invalid command 'Order', perhaps m...n
Jun 16 14:00:17 vici2 systemd[1]: Failed to start The Apache Webserver.
Hint: Some lines were ellipsized, use -l to show in full.





You have an erorr in apache config " Invalid command 'Order'"
have you recently upgraded apache to 2.4 ?

Re: Apache keeps failing

PostPosted: Thu Jun 16, 2016 3:03 pm
by williamconley
chornyi_taras wrote:
kevin wrote:
Code: Select all
...
Jun 16 14:00:17 vici2 start_apache2[21950]: Invalid command 'Order', perhaps m...n
...





You have an erorr in apache config " Invalid command 'Order'"
have you recently upgraded apache to 2.4 ?

Or perhaps you modified /etc/apache2/default-server.conf (or anothe apache2 conf file) and broke something. The option "Order" has to be in a specific location or it will be misinterpreted as a command ... which does not exit. 8-)

Re: Apache keeps failing

PostPosted: Thu Jun 16, 2016 6:51 pm
by kevin
Oh i changed something in /etc/apache2/conf.d/vicirecord.conf to be able to access the the recordings it looks like this.
Did put in a wrong command?

Code: Select all
 Alias /RECORDINGS/ "/var/spool/asterisk/monitorDONE/"

<Directory "/var/spool/asterisk/monitorDONE">
        Options Indexes MultiViews
        AllowOverride None
        Require all granted
        Order Allow,Deny
        Allow from all
        <files *.mp3>
                Forcetype application/forcedownload
        </files>
</Directory>

Re: Apache keeps failing

PostPosted: Thu Jun 16, 2016 7:11 pm
by williamconley
Um ... what is Require all granted?

IE: Change it back to the original and find out if that fixes it.

Here's the original:
Code: Select all
Alias /RECORDINGS/ "/var/spool/asterisk/monitorDONE/"

<Directory "/var/spool/asterisk/monitorDONE">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
        <files *.mp3>
                Forcetype application/forcedownload
        </files>
</Directory>

Re: Apache keeps failing

PostPosted: Thu Jun 16, 2016 7:22 pm
by kevin
This is what i got back after the change
Code: Select all
Jun 16 20:20:13 vici2 start_apache2[6363]: AH00526: Syntax error on line 6 of /etc/apache2/conf.d/vicirecord.conf:
Jun 16 20:20:13 vici2 start_apache2[6363]: Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
Jun 16 20:20:13 vici2 start_apache2[6370]: AH00526: Syntax error on line 6 of /etc/apache2/conf.d/vicirecord.conf:
Jun 16 20:20:13 vici2 start_apache2[6370]: Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
Jun 16 20:20:13 vici2 systemd[1]: Failed to start The Apache Webserver.

Re: Apache keeps failing

PostPosted: Thu Jun 16, 2016 7:25 pm
by kevin
And this is the apache version I'm running on

Server version: Apache/2.4.18 (Linux/SUSE)

Re: Apache keeps failing

PostPosted: Thu Jun 16, 2016 7:35 pm
by kevin
Ok I resolved it apparently apache v2.2 uses
Code: Select all
   Order allow,deny
    Allow from all


But in v2.4 it switch over to this
Code: Select all
Require all granted


It's in "In this example, all requests are allowed." in the link below:
https://httpd.apache.org/docs/current/upgrading.html

Re: Apache keeps failing

PostPosted: Thu Jun 16, 2016 8:17 pm
by williamconley
Perhaps you just can't use both. I swear I have some 2.4 servers without that error. However: perhaps it is a recent change within 2.4, not all of 2.4 ...?

Re: Apache keeps failing

PostPosted: Fri Jun 17, 2016 4:44 am
by chornyi_taras
You can use IfVersion


Code: Select all
<Directory /srv/www/htdocs/somedir>
  <IfVersion >= 2.4>
    Require all denied
  </IfVersion>
  <IfVersion < 2.4>
    Order allow,deny
   Deny from all
  </IfVersion>
</Directory>