The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't Enable Mod_Rewrite

Discussion in 'General Discussion' started by stellarbytes, Sep 10, 2011.

  1. stellarbytes

    stellarbytes Member

    Joined:
    Aug 26, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    Here's my setup:

    WHM 11.30.3 (build 4)
    CENTOS 5.6 x86_64 standard

    The problem is it appears mod_rewrite is not enabled which I badly need for an ecommerce store:

    Code:
    http:// cupargardencentre . com/phptest.php
    I have added the following to httpd.conf:

    PHP:
    LoadModule rewrite_module modules/mod_rewrite.so
    AddModule mod_rewrite
    .
    When I go to WHM>Restart Apache and click Yes to restart Apache, I get the following error:

    It is quite evident adding these lines to httpd.conf breaks apache, because as soon as I remove them, I can restart apache and the sites work fine.

    There appears to be no 'Rewrite' module which can be built with EasyUpdate, presumably this option has been deprecated since I last installed this module a few months ago on an older version of cPanel.


    Can anyone offer any pointers as to why this isn't working?

    Thanks
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. stellarbytes

    stellarbytes Member

    Joined:
    Aug 26, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Thank you - I had a look at the thread, when I log in as root and type:

    Code:
    httpd -l | grep -i rewrite
    I get:

    Code:
    -bash: httpd: command not found
    I have interpreted "httpd -l | grep -i rewrite" as "httpd -(lowecase L) PIPE grep -i rewrite" - so what is the problem? Even 'httpd -l' is not working, returning the same error?

    Here is the content of httpd.conf if that helps:
    -removed-

    Is there something missing or broken here? Thanks

    Other than this problem, the server seems to be running OK.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Are you logged in as root user?
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Sometimes the symlink for /usr/sbin/httpd doesn't exist to /usr/local/apache/bin/apachectl, so you cannot simply run that command. Try this command instead:

    Code:
    /usr/local/apache/bin/apachectl -l | grep -i rewrite
     
  6. stellarbytes

    stellarbytes Member

    Joined:
    Aug 26, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Yes, I am logged in via SSH as the root user.

    I tried the above and this time I get:
    It appears even simple command line entries don't work, citing bash 'command not found' errors, however this file definitely exists as I have browsed via FTP and located it in that exact path. I just checked for cPanel updates and upgraded to the latest Release version. Any idea where to look to solve these issues as the upgrade hasn't fixed anything in relation to these problems.

    I have looked at both /usr/local/apache/logs/error_log and /usr/local/cpanel/logs/error_log and do not see anything out of the ordinary except quite a few of these, it happened six times during the night.

    Code:
    [Tue Sep 13 08:15:26 2011] [notice] Graceful restart requested, doing restart
    Any ideas?:confused:
     
    #6 stellarbytes, Sep 13, 2011
    Last edited: Sep 13, 2011
  7. stellarbytes

    stellarbytes Member

    Joined:
    Aug 26, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Ok I found a thread on here which says to check the $PATH location, I have done so, and here it is, I don't think this is right...

    Code:
    /usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin
    
    I checked all these paths:

    /usr/local/jdk/bin - does NOT exist

    /usr/kerberos/sbin - exists

    /usr/kerberos/bin - exists

    /usr/local/sbin - exists

    /usr/local/bin - exists

    /usr/sbin - does NOT exist, but /usr/local/sbin/ does - is this correct?

    Any ideas?
     
    #7 stellarbytes, Sep 13, 2011
    Last edited: Sep 13, 2011
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The command you tried wasn't the right command. You tried this path:

    I told you this path:

    There is a bin in the path I provided. If the correct command isn't used, the output will error out. It would not be that simple commands do not work, it is that the right command must be entered.
     
  9. stellarbytes

    stellarbytes Member

    Joined:
    Aug 26, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Yep, you were right, I missed the 'bin' out. I have run this in SSH and it reports back:

    mod_rewrite.c

    Not sure what this means, but mod_rewrite definitely does not seem to be working. When I enable the SEO module in my shopping cart, it reports that mod_rewrite cannot be found on the server and is not installed. Support say it's not a problem with the software but a problem with mod_rewrite on my server. ARGH!
     
  10. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    This means that mod_rewrite is enabled, which was going to be the outcome as it is default installed.

    Please provide the exact error you receive when you enable the SEO module on your shopping cart. You likely have the wrong file permissions on the files needed to run the module or are using rewrite rules that aren't supported by the server type.
     
Loading...

Share This Page