Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 20
  1. #1
    mms
    mms is offline
    Member
    Join Date
    Aug 2010
    Posts
    11

    Default how to activate mod_rewrite

    Hello
    How can i activate mod_rewrite

    there's only one code working
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^my ip [NC]
    RewriteRule ^(.*)$ /~ll22ll/upload$1 [L,R=301]

    =================================My htaccess=============
    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName ll22ll.com
    AuthUserFile /home/ll22ll/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/ll22ll/public_html/_vti_pvt/service.grp

    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </IfModule>


    RewriteEngine on
    ExpiresActive On
    ExpiresByType image/gif "access 1 week"
    ExpiresByType image/jpg "access 1 week"
    ExpiresByType image/jpeg "access 1 week"
    ExpiresByType image/png "access 1 week"
    ExpiresByType application/x-shockwave-flash "access 1 week"
    ExpiresByType application/x-javascript "access 1 week"


    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^my ip [NC]
    RewriteRule ^(.*)$ /~ll22ll/upload$1 [L,R=301]

    it's not working i get 404 page
    RewriteEngine on
    RewriteRule ^view\/([0-9]+)\/(.*)$ do.php?id=$1
    RewriteRule ^download\/([0-9]+)\/(.*)$ do.php?id=$1
    RewriteRule ^delete\/([0-9]+)\/(.*)$ go.php?go=del&cd=$2
    RewriteRule ^([0-9]+)/folder/([0-9]+)$ index.php
    RewriteRule ^([0-9]+)$ index.php
    RewriteRule ^status.php$ go.php?go=rules
    RewriteRule ^status.php?do=status$ go.php?go=stats



    i Spock with the support they told me
    Hello,

    you will need to check apache documentation for mod_rewrite.

    Ticket Details
    how

    thanks
    Last edited by mms; 08-26-2010 at 02:12 AM.

  2. #2
    Member kuldeep_'s Avatar
    Join Date
    Apr 2010
    Posts
    54

    Default

    If you are sure that rules you have mentioned are correct then refer to following steps:

    If you have root access to server then check if mod_rewrite is enabled on server.

    To check use following command.
    root@server [~]# httpd -l |grep mod_rewrite
    mod_rewrite.c
    If mod_rewrite is installed and still rules not working then try placing the rule in the top section of .htaccess file. Or comment out other rules for checking and only keep rules active that are not working and give it a try.

  3. #3
    cPanel Staff cPanelJared's Avatar
    Join Date
    Feb 2010
    Location
    Houston, TX
    Posts
    1,032

    Default mod_rewrite is included by default

    mod_rewrite is included by default in the Apache that is built by EasyApache. It is compiled in so there is no LoadModule or AddModule directive in the httpd.conf file. To confirm that it is present, you can use httpd -l and then use grep to narrow down the output:

    Code:
    # /usr/local/apache/bin/httpd -l|grep rewrite
      mod_rewrite.c
    mod_rewrite uses regex to match patterns. What I would suggest is using an online mod_rewrite testing tool to evaluate the patterns you are trying to use. A Google search for "mod_rewrite tester" returned some good possibilities at the top of the search results, such as the following:

    Test your RewriteRules for Apache mod_rewrite
    For hands-on assistance, please reference our new support information page: Where should I go for support?
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation


    -- Jared Ryan, Technical Analyst, cPanel Technical Support

  4. #4
    mms
    mms is offline
    Member
    Join Date
    Aug 2010
    Posts
    11

    Default

    /root$ httpd -l |grep mod_rewrite
    mod_rewrite.c

    Linux Apache mod_rewrte Test Tutorial

    Please Give Us Your Comments

    LINK 1 = LINK 1 Does NOT use Mod Rewrite. LINK 1 uses standard URL: rewrite.php?link=1
    i get
    You are not using mod_rewrite - Try LINK2

    LINK 2 = LINK 2 - Yes, Uses Apache's Mod Rewrite using this URL:: link2.html
    404 Not Found

    The server can not find the requested page:
    My ip/~ll22ll/link2.html (port 80)

    Apache Error logos
    Code:
    [Thu Aug 26 13:26:39 2010] [error] [client ] File does not exist: /usr/local/apache/htdocs/home
    [Thu Aug 26 13:26:45 2010] [error] [client my ip] File does not exist: /home/ll22ll/public_html/upload/sys_cpanel, referer: http:///~ll22ll/upload/status.php
    
    [Thu Aug 26 13:40:48 2010] [error] [client my ip] File does not exist: /usr/local/apache/htdocs/home
    [Thu Aug 26 13:40:48 2010] [error] [client my ip] File does not exist: /home/ll22ll/public_html/sys_cpanel, referer: http:///~ll22ll/link2.html
    Hello................

  5. #5
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by mms View Post
    The server can not find the requested page:
    My ip/~ll22ll/link2.html (port 80)
    Have you ensured the desired URL can be accessed directly, before setting the redirect to use it in the Apache .htaccess file? The URL being entered requires mod_userdir URLs to be allowed/enabled, but this can only be configured via root (Administrator) access to WebHost Manager (WHM) or manually via root SSH/console access.

    Please test to verify if you can access URLs like the following without receiving an error; replacing "$server" with the server hostname or IP address and replace "$username" with your cPanel account username:
    Code:
    http://$server/~$username/

  6. #6
    mms
    mms is offline
    Member
    Join Date
    Aug 2010
    Posts
    11

    Default

    Quote Originally Posted by cPanelDon View Post
    Have you ensured the desired URL can be accessed directly, before setting the redirect to use it in the Apache .htaccess file? The URL being entered requires mod_userdir URLs to be allowed/enabled, but this can only be configured via root (Administrator) access to WebHost Manager (WHM) or manually via root SSH/console access.

    Please test to verify if you can access URLs like the following without receiving an error; replacing "$server" with the server hostname or IP address and replace "$username" with your cPanel account username:
    Code:
    http://$server/~$username/
    it's working fine
    my ip/~ll22ll

    but after i add this line in http.conf
    PHP Code:
    LoadModule rewrite_module modules/mod_rewrite.so 
    i get after i tried to restart
    Restarting Apache Web Server

    Apache restart failed. Unable to load pid from pid file and no httpd process found in process list.

    If apache restart reported success but it failed soon after, it may be caused by oddities with mod_ssl.

    You should run /scripts/ssl_crt_status as part of your troubleshooting process. Pass it --help for more details.

    Also be sure to examine apache's variouse log files.
    Apache Restart Output:
    httpd: Syntax error on line 38 of /usr/local/apache/conf/httpd.conf: module rewrite_module is built-in and can't be loaded

    Log:

  7. #7
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    There is no extra configuration required in order to load "mod_rewrite" -- this module is compiled-into Apache when built/installed by EasyApache.

    I recommend using a redirect destination of a domain name installed on the cPanel account instead of attempting to use mod_userdir URLs. Attempting to use mod_userdir and mod_rewrite can easily incur unnecessary difficulty.

    What was used to configure your custom redirects? Were the entries input manually into the Apache .htaccess file(s) or were they setup by a script or some other method?

  8. #8
    mms
    mms is offline
    Member
    Join Date
    Aug 2010
    Posts
    11

    Default

    I just try to log in into cpanel by
    http://my ip /cpanel
    500 Internal Server Error ?
    i can only log in cpanel
    by
    my ip:2026

  9. #9
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by mms View Post
    I just try to log in into cpanel by
    http://my ip /cpanel
    500 Internal Server Error ?
    i can only log in cpanel
    by
    my ip:2026
    I recommend contacting your web hosting service provider so that they may assist with troubleshooting difficulty accessing cPanel; the service provider will have direct access to the server and they are in the best position to investigate and apply any necessary corrections.

  10. #10
    mms
    mms is offline
    Member
    Join Date
    Aug 2010
    Posts
    11

    Default

    When i try to update the

    Easy::Apache v3.2.0 Build 5186

    on
    # 5. Short Options List
    # →
    # 6. Exhaustive Options List


    there no option to activate the Mod_rewrite

    whhhhhhhhhhhhhy

  11. #11
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by mms View Post
    When i try to update the

    Easy::Apache v3.2.0 Build 5186

    on
    # 5. Short Options List
    # →
    # 6. Exhaustive Options List

    there no option to activate the Mod_rewrite

    whhhhhhhhhhhhhy
    As previously indicated, there is no additional configuration required to load the Apache/httpd module "mod_rewrite"; by default, mod_rewrite is -always- installed by EasyApache and it is not optional.

  12. #12
    mms
    mms is offline
    Member
    Join Date
    Aug 2010
    Posts
    11

    Default

    Okay but after i update the Apache
    i get
    easyapache3] Build Failure: Build id: 1282970491. Report id: 4111461

  13. #13
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by mms View Post
    Okay but after i update the Apache
    i get
    easyapache3] Build Failure: Build id: 1282970491. Report id: 4111461
    Thank you for the Build and Report ID information. It appears the build could not complete due to insufficient memory resources while attempting to compile the FileInfo module for PHP 5.3:
    Code:
    virtual memory exhausted: Cannot allocate memory
    make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
    !! 'make' failed with exit code '512' !!
    Please access the Exhaustive Options List in EasyApache and deselect, that is, disable, the FileInfo option for PHP 5.3. The FileInfo PHP module requires an unusually large amount of available memory (RAM) resources in order to compile successfully.

    Please also ensure to remove any customizations from the Apache/httpd configuration:
    Quote Originally Posted by mms View Post
    [...] i add this line in http.conf
    Code:
    LoadModule rewrite_module modules/mod_rewrite.so

  14. #14
    mms
    mms is offline
    Member
    Join Date
    Aug 2010
    Posts
    11

    Default

    thanks now the build complete

    some of threads on google
    said the problem it could be form
    # Mod Security
    is that true

  15. #15
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by mms View Post
    thanks now the build complete

    some of threads on google
    said the problem it could be form
    # Mod Security
    is that true
    It is possibile for a mod_security rule to look for specific criteria and subsequently force a specific HTTP status code (such as 404: Not Found); however, if you're able to access the same mod_userdir URL directly I would then believe that the issue may stem from the specific redirect configuration of mod_rewrite entries in the applicable Apache .htaccess file(s).

    If it is related to mod_security I recommend searching its audit log; this can be performed using WebHost Manager via the following menu path: WHM: Main >> Plugins >> Mod Security

    The mod_security audit log can be monitored for new entries via root SSH/console access, and may be found at one of the following paths:
    Code:
    /usr/local/apache/logs/modsec_audit.log
    /usr/local/apache/logs/audit_log
    Here are two example commands for the above log paths:
    Code:
    # tail -fvn0 /usr/local/apache/logs/modsec_audit.log
    # tail -fvn0 /usr/local/apache/logs/audit_log

Similar Threads & Tags
Similar threads

  1. Re-activate neomail?
    By kempes in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 08-28-2007, 08:47 PM
  2. how do i activate rotatelogs?
    By ::Gomez:: in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-02-2007, 10:56 AM
  3. Why does everything take so long to activate?
    By ibanez0r in forum New User Questions
    Replies: 3
    Last Post: 05-12-2006, 05:16 AM
  4. Activate SSL
    By spage in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 03-30-2005, 04:41 AM
  5. how can i activate fantastico??
    By kayzer in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-29-2005, 01:33 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube