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.

noob! help needed on mod rewrite

Discussion in 'General Discussion' started by kdoublei, Feb 21, 2007.

  1. kdoublei

    kdoublei Member

    Joined:
    Feb 21, 2007
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    im a complete noob at owning my own server. i tried to install a htaccess and i got this message:

    '[Tue Feb 20 17:01:12 2007] [alert] [client 24.208.187.191] /home/xxxxx/public_html/.htaccess: Invalid command 'RewriteRule', perhaps mis-spelled or defined by a module not included in the server configuration'

    i know everything is spelled right because i used the exact same htaccess on a shared server and it works fine. i have a few questions about this.
    1. how can i tell if mod rewrite is active on the server?
    2. if its not active, how can i add this feature?
    3. is there a tutorial on adding features like this?
     
  2. erik@delphi

    erik@delphi Well-Known Member

    Joined:
    Jul 9, 2005
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Belgium
    if you do not know the answer to basic stuff like that i strongly recommend you get a server management contract.Not to insult you personally or anything but to ensure your system is kept secure by somebody who knows what he / she is doing.

    1)

    PHP:
    <?php
    phpinfo
    (INFO_MODULES);
    if the "loaded modules" section mentions "mod_rewrite" you have it enabled

    2)in your httpd.conf file there should be lines like

    • LoadModule rewrite_module libexec/mod_rewrite.so
    • AddModule mod_rewrite.c

    if you don't have the "mod_rewrite.so" file (so shared object) then you need to recompile apache with mod_rewrite enabled ...

    Also the verry first line of your ".htaccess" should be

    Code:
    RewriteEngine On;
    
     
  3. kdoublei

    kdoublei Member

    Joined:
    Feb 21, 2007
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    im looking at server management companies but im trying to get a site up and running to afford it. for the answer of #1 what does this mean and how do i get to it?
    PHP:
    <?php
    phpinfo
    (INFO_MODULES);
    #2. how do i get to the httpd.conf file?
    remember, im a complete noob whose trying to get by until i can afford someone to do it all for me
     
  4. erik@delphi

    erik@delphi Well-Known Member

    Joined:
    Jul 9, 2005
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Belgium
    #1 this is a PHP script you need to save it to somefile.php upload it to your server and then run it from your webbrowser (remove the file when you are done as it shows some sensitive system information)

    #2 the location of httpd.conf depends on how your server whas compiled But on CPanel servers it is usually "/etc/httpd/conf/" so in an ssh prompt type

    Code:
    cd /etc/httpd/conf
    pico -w httpd.conf
    
    be VERRY CAREFULL if youu edit this file this file is the "heart" from your server ....
     
Loading...

Share This Page