2

I try to start httpd on centos 6 / apache 2.2 but get the following error:

/etc/init.d/httpd start
Starting httpd: [Sun Nov 08 20:47:36 2015] [warn] module php5_module is already loaded, skipping
Syntax error on line 5 of /etc/httpd/conf/extra/httpd-directories.conf:
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
                                                           [FAILED]

After searching i found some solutions like changing

Order deny,allow
Deny from all

to

Require all denied

But this is for apache 2.4 and i'm running 2.2

Kinda stuck here and all the websites are down. Can anybody help me out?

EDIT:

This is my httpd-directories.conf file:

<Directory />
    Options SymLinksIfOwnerMatch
        AllowOverride None

        Order Deny,Allow
        Deny from All
</Directory>

<Directory /home>
        AllowOverride AuthConfig FileInfo Indexes Limit Options=Includes,IncludesNOEXEC,Indexes,ExecCGI,MultiViews,SymLinksIfOwnerMatch,None
        Options IncludesNoExec Includes SymLinksIfOwnerMatch ExecCGI

        <Limit GET POST OPTIONS PROPFIND>
                Order allow,deny
                Allow from all
        </Limit>
        <LimitExcept GET POST OPTIONS PROPFIND>
                Order deny,allow
                Deny from all
        </LimitExcept>
</Directory>

<Directory /var/www/html>
        Options SymLinksIfOwnerMatch
        AllowOverride AuthConfig FileInfo Indexes Limit Options=Includes,IncludesNOEXEC,Indexes,ExecCGI,MultiViews,SymLinksIfOwnerMatch,None

        Order allow,deny
        Allow from all
        <IfModule mod_suphp.c>
                suPHP_Engine On
                suPHP_UserGroup webapps webapps
                SetEnv PHP_INI_SCAN_DIR
        </IfModule>
</Directory>

<Directory /var/www/cgi-bin>
        AllowOverride None
        Options None

        Order allow,deny
        Allow from all
</Directory>
6
  • Does that httpd-directories.conf file look exactly like this? github.com/dmikusa-pivotal/cf-php-apache-buildpack/blob/master/… Please post the full contents. Also please verify your Apache version: httpd -v
    – JayMcTee
    Nov 8, 2015 at 20:34
  • @JayMcTee Edited my original question with the content of my httpd-directories.conf file
    – RoRo
    Nov 8, 2015 at 20:37
  • Did you explicitly verify the httpd version with httpd -v? And do check this module is there too: httpd -M | grep authz_host
    – JayMcTee
    Nov 8, 2015 at 20:45
  • Why did you restart it? Did you make any changes ?
    – user9517
    Nov 8, 2015 at 20:46
  • @Iain i needed it to restart after upgrading php
    – RoRo
    Nov 8, 2015 at 20:51

2 Answers 2

3

It looks like you're missing the authz_host module, ensure that your /etc/httpd/conf/httpd.conf file has a line like

LoadModule authz_host_module modules/mod_authz_host.so

in it. If I comment that line out of my httpd.conf, I get the same error as you see.

5
  • Where should i add that line? because i don't see any other *.so modules getting loaded in that file
    – RoRo
    Nov 8, 2015 at 21:01
  • If this is a standard C6 system then the file I mention is where it should go. If it's a non standard system who knows.
    – user9517
    Nov 8, 2015 at 21:04
  • I don't really know if this is a standard or none standard system, i'm not the most experienced system admin. When i edit the file like you said i get the error /etc/init.d/httpd start Starting httpd: [Sun Nov 08 22:11:24 2015] [warn] module php5_module is already loaded, skipping Syntax error on line 2 of /etc/httpd/conf/extra/httpd-php-handlers.conf: Invalid command 'AddHandler', perhaps misspelled or defined by a module not included in the server configuration [FAILED]
    – RoRo
    Nov 8, 2015 at 21:11
  • 1
    Your config is seriously boned. It's probably time to take off and nuke it from orbit.
    – womble
    Nov 8, 2015 at 21:13
  • This is a cpanel sysetm ?
    – user9517
    Nov 8, 2015 at 21:16
-1

Some untested thoughts:

Should the / in the opening tag be quoted?

<Directory "/">

Also, the documentation shows lowercase for Deny and Allow directives.

Order deny,allow

Example:

<Directory "/">
    Options SymLinksIfOwnerMatch
        AllowOverride None
        Order deny,allow
        Deny from All
</Directory>
1
  • I have working systems where the directory paths are not quoted. The same systems have Allow and Deny.
    – user9517
    Nov 8, 2015 at 22:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .