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.

install mod_rewrite via whm

Discussion in 'General Discussion' started by ajoudanian, Nov 30, 2011.

  1. ajoudanian

    ajoudanian Registered

    Joined:
    Nov 30, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    hi all
    i have a promblem with mod_rewrite
    It's not configured by default, and i dont have following line in httpd.conf

    LoadModule rewrite_module libexec/mod_rewrite.so



    now i want to insall it via whm, but i cant find it in:
    Main >> Software >> EasyApache (Apache Update)



    how can i install this extension on my servr?
     
    #1 ajoudanian, Nov 30, 2011
    Last edited: Nov 30, 2011
  2. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    mod_rewrite should be configured already by Apache. Open a condol and run this to check:
    Code:
    /usr/local/apache/bin/httpd -D DUMP_MODULES | grep rewrite
    It should return:
    Syntax OK
    rewrite_module (static)
     
  3. NixTree

    NixTree Well-Known Member

    Joined:
    Aug 19, 2010
    Messages:
    386
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    Hello,

    As kernow mentioned, run the given command and if you get the output like his post, mod_rewrite is compiled in to apche fine. The reason for Loadmodule is absent in httpd.conf is, mod_rewrite is compiled in as sttaic module, not shared.

    Thank you,
    Nibin.
     
  4. ajoudanian

    ajoudanian Registered

    Joined:
    Nov 30, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    thanks
    but i test mod_rewrite:


    mydomain.com/mod_test/.htaccess
    mydomain.com/mod_test/index.php


    and when i open index.php i saw 500 internal error



    what should i do?
     
  5. Chris.Bshm

    Chris.Bshm Member

    Joined:
    Oct 20, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Howdy,

    Is that the actual syntax?

    "ewriteEngine On
    RewriteRule ^.*$ index.php "

    If so, it should be:
    RewriteEngine On

    You can check for causes of internal server errors quickly by tailing the Apache error log while refreshing your page:

    tail -f /usr/local/apache/logs/error_log

    If you're servers serving a lot of requests you may want to add a grep for your specific IP while checking for errors:

    tail -f /usr/local/apache/logs/error_log |grep <yourconnectingipaddress>


    Regards,
     
  6. ajoudanian

    ajoudanian Registered

    Joined:
    Nov 30, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    thanks

    excuse me
    in my .htaccess file i wrote RewriteEngine, but here i forget type R

    i checked my Apache errors for mu IP address and result is here:
    Apache.jpg


    thanks again
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    That error message looks to be the result of invalid ownership of the index.php file, rather than your Mod_Rewrite rules. Ensure the file is owned by the account username, and that it's parent directory also has correct ownership.

    Thank you.
     
  8. ajoudanian

    ajoudanian Registered

    Joined:
    Nov 30, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    hello
    i change file's ownership, but again i get these errors:
     
  9. 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
    Premature end of script headers normally means you have spaces after the closing ?> php tag or other issues with the code itself. What content do you have in the index.php file?

    Also, if you are using suPHP, please ensure the file has no higher than 644 file permissions. You can see the PHP handler in WHM > Apache Configuration > PHP and SuExec Configuration area.
     
  10. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    462
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hi,

    Sometimes error
    can occurs when file is being uploaded in ASCII mode.
    In such situations you can try to upload same file through ftp client in binary mode.
     
Loading...

Share This Page