Archive for the Category »Basic Linux «

Redirect loop and LimitInternalRecursion error message.

Most of the time we receive following redirect loop error message.


Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace
To avoid above error message simply use following code in .htaccess file.

RewriteCond %{ENV:REDIRECT_STATUS} 100

RewriteRule .* - [L]


How to define iptables rules save option?



iptables creating rules after restarting the iptables. When iptables service is restarted settings from /etc/sysconfig/iptables file are applied and used with the iptables.

You can either set up iptables rule so that current stat is saved the rule upon restart or stop/start:

You need to make changes in following file as per your requirement for values received in following GREP result.

root@server[~]# grep IPTABLES_SAVE /etc/sysconfig/iptables-config
IPTABLES_SAVE_ON_STOP=”no”
IPTABLES_SAVE_ON_RESTART=”no”
IPTABLES_SAVE_COUNTER=”no”

Or overwrite current settings with iptables-save to /etc/sysconfig/iptables file:

root@server[~]# iptables-save > /etc/sysconfig/iptables

Note : Its always good if we use NO option for following options because some time due to wrong rule we face major problem to access server.

IPTABLES_SAVE_ON_STOP=”no”
IPTABLES_SAVE_ON_RESTART=”no”
IPTABLES_SAVE_COUNTER=”no”


PHP Parse error: syntax error, unexpected T_STRING?



If you receive following error in the error logs

” PHP Parse error: syntax error, unexpected T_STRING”
Then you can add following line in the .htaccess file

php_flag short_open_tag X

Or

If your server is SuExec enabled then you can use following code in php.ini file
short_open_tag = X

How to parse php pages in html page?



You can use following code in .htaccess file to parse php pages in html pages

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

To can check above code is working ir not? by creating one test page with following code

root@gunjan[~]#pico test.html

< html>
< head>
< body>
< h1>
< ?php echo "WORKING FINE!"; ?>
< /h1>
< /body>
< /html>

How to check user who are using boxtrapper?

Now a days boxtrapper is cause high server load in that case we need to check how many users are really using boxtrapper.You can use following simple command to heck the boxtrapper users.

root@gunjan[/home]#find /home/*/etc -iname .boxtrapperenable

Run above command in /home and you will found out all the users who are using boxtrapper

Category: Basic Linux  Tags: , ,  Comments off

How to change nobody ownership to cpanel user?

First you need to found nobody users files than change it to cPanel main user name so that you can change/edit the files without any problem.But its difficult to check ownership one by one for all files in that case you can use following single command

root@gunjan[/home/test]#find ./ -user “nobody” | xargs chown test.test

In above command find will check all files owned by nobody user and after that it chown will change the ownership to test.test where test is cPanel user name

Category: Basic Linux  Tags: , ,  Comments off

htaccess pcfg_openfile unable to check htaccess file (403 error)

If you are receiving 403 error message after browsing your domain than check the Apache error logs.

root@gunjan[~]tail -f /usr/local/apache/logs/error_log

[Tue Nov 17 19:38:32 2009] [crit] [client 192.168.0.2] (13)Permission denied: /home/admin/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

As per above logs it seems that the nobody user is not getting read and executing permission upto any of that folder.So make sure that the public_html and the subdomain are set read and executing permission for nobody user.

How to generate the password from shell (SSH)?

If you use SSH, use mkpasswd command for creating passwords…

root@gunjan[~]#mkpasswd -l 10 -d 3 -C 3 -s 2
L]4P@V6ii3