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 Gzip Compression

Discussion in 'General Discussion' started by h0feer, Nov 24, 2016.

  1. h0feer

    h0feer Member

    Joined:
    Nov 24, 2016
    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    serbia
    cPanel Access Level:
    Root Administrator
    Hello to everyone,


    I have build a website and i bought a server... i have chose cPanel to install into my server and i was trying how to enable Gzip Compression to my server from cpanel features,

    into cpanel there is a feature "Optimize website" and i chose compress whole website , but after that i get one error like this :

    Code:
    An error was encountered while attempting to apply the specified options. OptimizeWS::eek:ptimizews(all,text/html text/plain text/xml) failed: Error while opening /home/mywebsite/.htaccess: Permission denied
    
    
    What should i do , any idea?



    Thanks.
     
    #1 h0feer, Nov 24, 2016
    Last edited by a moderator: Nov 24, 2016
  2. NOC_Serverpoint

    NOC_Serverpoint Well-Known Member

    Joined:
    Jul 3, 2016
    Messages:
    102
    Likes Received:
    6
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    Hi,

    Can you please check the permission of the '.htaccess' file under you '/home/mywebsite/.htaccess' ?

    If you have command line access , please use the below command:
    --
    ls -l /home/mywebsite/.htaccess
    --
     
  3. h0feer

    h0feer Member

    Joined:
    Nov 24, 2016
    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    serbia
    cPanel Access Level:
    Root Administrator
    Hello,

    Thanks for your reply,

    i tired using command line but i get one error "no such file or directory" but i checked .htaccess permission using FTP
    Permission of .htaccess is : 0644


    any idea?
     
  4. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    543
    Likes Received:
    39
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Are you sure the .htaccess file path is showing that or it's /home/USERname/public_html/.htaccess ?
     
  5. h0feer

    h0feer Member

    Joined:
    Nov 24, 2016
    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    serbia
    cPanel Access Level:
    Root Administrator
    Yes,


    it's like this /home/usernameofFTP/public_html/.htaccess


    any idea what to do please?
     
  6. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    543
    Likes Received:
    39
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Login to server through SSH client and check the .htaccess file permission.

    ---
    ls -l /home/UserName/public_html/.htaccess
    -----

    Permission should be 644
     
  7. h0feer

    h0feer Member

    Joined:
    Nov 24, 2016
    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    serbia
    cPanel Access Level:
    Root Administrator
    Hello,

    Here is what i get


    -rw-r--r-- 1 root username 258 Sep 7 21:26 /home/username/public_html/.htaccess

    Permission are : 0644

    Still i get the same error,


    But, i logged in through FTP and i changed .htaccess owner status from "Username" to "Root" also group from username to root,

    and it worked properly , but is there any bad thing that i changed this ? anything risky ?

    also when i check gzip compression status its still giving me that it's not enabled
     
  8. NOC_Serverpoint

    NOC_Serverpoint Well-Known Member

    Joined:
    Jul 3, 2016
    Messages:
    102
    Likes Received:
    6
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    Hello,

    Before enabling gzip compression , please check if ' mod_deflate' is enabled in your server. If mod_deflate module is not enabled then run easyapache on the server to enable that module.

    How to run easyapache?

    1. Login to your cPanel server via SSH as root and run the below command :

    /scripts/easyapache

    Recompile apache with the mod_deflate module enabled

    OR

    2. You can also run easyapache via WHM

    Login to WHM (Web Host Manager) and click on "EasyApache (Apache Update)" Under Software

    Home » Software » EasyApache (Apache Update)

    Enable the mod_deflate module and do the steps to enable compression from cPanel "optimize website" under "software and services"

    Thank you,
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The "Optimize Website" feature uses the .htaccess file in the account's home directory, as opposed to the one in the account's public_html directory.

    Please revert the ownership values on the .htaccess file back to the account username. Also, after enabling "Optimize Website" via cPanel, post the contents of the .htaccess file and let us know it's permission/ownership values:

    Code:
    stat /home/$username/.htaccess
    cat /home/$username/.htaccess
    Ensure to replace any real domain names or IP addresses with examples.

    Thank you.
     
Loading...

Share This Page