thaimor

Registered
PartnerNOC
Jul 17, 2007
2
0
51
Hi,

We have a problem with cPanel IP Deny Manager on one account.
When ever we try to add some IP through IP deny Manager, it's trowing out error:

Error: while opening /usr/local/apache/htdocs/.htaccess

That cPanel user does not have rights to write in that file, but I can't find why is it even trying to write there.
Funny thing is that IP is properly added in that account's .htaccess:

/home/$username/public_html/.htaccess

DocumentRoot for that account is set properly:

DocumentRoot /home/$username/public_html

So, it's working, but there is that error every time.

It's happening only for one account on that server, other accounts are OK.

It's a VPS, running cPanel 11, Release.

Here is a full error from cPanel error log:


Code:
touch: cannot touch `/usr/local/apache/htdocs/.htaccess': Permission denied
touch: cannot touch `/usr/local/apache/htdocs/.htaccess': Permission denied
2009-01-09 08:33:04 warn [Cpanel::FileUtils::TouchFile] Failed to create /usr/local/apache/htdocs/.htaccess: No such file or directory at /usr/local/cpanel/Cpanel/FileUtils/TouchFile.pm line 69
        Cpanel::FileUtils::TouchFile::touchfile('/usr/local/apache/htdocs/.htaccess') called at /usr/local/cpanel/Cpanel/DenyIp.pm line 32
        Cpanel::DenyIp::_HtaccessCompatCheck() called at /usr/local/cpanel/Cpanel/DenyIp.pm line 188
        Cpanel::DenyIp::DenyIp_adddenyip('195.29.150.3') called at (eval 73) line 1
        eval 'Cpanel::DenyIp::DenyIp_adddenyip(@{$argref});' called at cpanel.pl line 1637
        main::exectag('<cpanel DenyIp="adddenyip($FORM{\'ip\'})">') called at cpanel.pl line 4742
        main::dotag(undef) called at cpanel.pl line 4625
        main::cpanel_parseblock(SCALAR(0x93a5ef0)) called at cpanel.pl line 4577
        main::cpanel_parse(GLOB(0x96c4988)) called at cpanel.pl line 1303
touch: cannot touch `/usr/local/apache/htdocs/.htaccess': Permission denied
touch: cannot touch `/usr/local/apache/htdocs/.htaccess': Permission denied
2009-01-09 08:33:05 warn [Cpanel::FileUtils::TouchFile] Failed to create /usr/local/apache/htdocs/.htaccess: No such file or directory at /usr/local/cpanel/Cpanel/FileUtils/TouchFile.pm line 69
        Cpanel::FileUtils::TouchFile::touchfile('/usr/local/apache/htdocs/.htaccess') called at /usr/local/cpanel/Cpanel/DenyIp.pm line 260
        Cpanel::DenyIp::DenyIp_adddenyip('195.29.150.3') called at (eval 73) line 1
        eval 'Cpanel::DenyIp::DenyIp_adddenyip(@{$argref});' called at cpanel.pl line 1637
        main::exectag('<cpanel DenyIp="adddenyip($FORM{\'ip\'})">') called at cpanel.pl line 4742
        main::dotag(undef) called at cpanel.pl line 4625
        main::cpanel_parseblock(SCALAR(0x93a5ef0)) called at cpanel.pl line 4577
        main::cpanel_parse(GLOB(0x96c4988)) called at cpanel.pl line 1303
Any idea would be appreciated.

Thanks
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Does the account in question have a domain that is a sub-domain of the server hostname?
 

thaimor

Registered
PartnerNOC
Jul 17, 2007
2
0
51
Hi,

Yes. As the matter of fact, domain used in server's hostname is added as parked domain on that account.
In that case, should changing hostname to mian domain from that account help?
 

crazyaboutlinux

Well-Known Member
Nov 3, 2007
939
1
66
is this useful tool ??

if i block an IP or domain will it work for a domain or whole server ??

same thing will work for incoming/outgoing emails ??????
 
Last edited:

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
15
313
Houston, TX
cPanel Access Level
Root Administrator
is this useful tool ??

if i block an IP or domain will it work for a domain or whole server ??

same thing will work for incoming/outgoing emails ??????
The IP Deny Manager in the cPanel interface (not to be confused with Host Access Control in WHM) will only work for HTTP and HTTPS traffic for the websites hosted by that cPanel account. It will not work for other services (such as email) nor affect other users on the server.

This is very useful if you want to prevent someone or a group of people from visiting your website. This can be particularly effective if you run an internet forum and want to go beyond just using the ban feature built into the software and block people from your entire website.