h0feer

Member
Nov 24, 2016
15
1
3
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.
 
Last edited by a moderator:

h0feer

Member
Nov 24, 2016
15
1
3
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?
 

SysSachin

Well-Known Member
Aug 23, 2015
604
49
28
India
cPanel Access Level
Root Administrator
Twitter
Error while opening /home/mywebsite/.htaccess: Permission denied
Are you sure the .htaccess file path is showing that or it's /home/USERname/public_html/.htaccess ?
 

SysSachin

Well-Known Member
Aug 23, 2015
604
49
28
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
 

h0feer

Member
Nov 24, 2016
15
1
3
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
 

NOC_Serverpoint

Well-Known Member
Jul 3, 2016
103
7
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,
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
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.