Showing posts with label Common issues. Show all posts
Showing posts with label Common issues. Show all posts

Sunday, March 9, 2014

Remove session files under /tmp weekly

Remove session files under /tmp weekly


root@host [/scripts]# ll | grep cleanup.sh
-rwxr-xr-x  1 root root      39 Nov 21 10:41 cleanup.sh*
root@host [/scripts]# cat cleanup.sh
find /tmp/  -name "sess_*" | xargs rm

root@host [/scripts]#
================================
weekly on sunday 1 PM
00 1 * * 7  /scripts/cleanup.sh
================================

Saturday, March 6, 2010

repquota 100% with high load

The root process repquota is running with high cpu usage .

#ps afuxww | grep -i quota

->
root 10966 0.0 0.0 3276 528 ? D 05:14 0:00 | \_ /usr/sbin/repquota -auv
root 10556 0.0 0.0 3280 644 ? D 05:13 0:00 | \_ quota -v
root 10646 0.0 0.0 2916 644 ? D 05:13 0:00 | \_ quota -v
root 10745 0.0 0.0 1948 644 ? D 05:14 0:00 | \_ quota -v
root 10814 0.0 0.0 3284 640 ? D 05:14 0:00 | \_ quota -v

I have tried to kill repquota process but it is not getting killed.

This issue could be related to a read-only file system or file system corruption.

The following should help to determine if there is a read-only file-system

#touch testfile

If the "touch" command fails to create the files it should display an error, such as indicating there is a read-only file system.

You can reboot the server to resolve this.

If you are constantly facing repquota issue on server you can permanently disable the quotas

Run the command
quotaoff -a
Then remove the entry userquota from fstab, It will help you.

you can make changes in /etc/mtab and /etc/fstab for this.

Then mount it
#mount -a

Monday, March 1, 2010

htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

How to solve “.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable”

My error log shows:-
[sat Jan 13 01:15:32 2009] [crit] [client 218.208.xxx.xxx] (13)Permission denied: /home/mydomain/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

And the site is showing “403 Forbidden Error”.
At first, I suspect it’s .htaccess problem, but actually it’s caused by Frontpage Extension.

To solve “.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable” follow the steps below:-

* Login into your CPanel account
* Click on “Frontpage Extensions” icon
* Click on “Reinstall extensions” button beside your problem domain.
*If you do not use any frontpage extensions, it’s good to uninstall this extension
* Done. The “.htaccess pcfg_openfile: unable to check htaccess file” problem has been fixed.

Reverse DNS: how to check it?

Check RDNS using NSLOOKUP command ,HOST (on linux server ) command or centralops.net.

NSLOOKUP
--------------
1)You can check RDNS is setup or not from command prompt using nslookup command
Server which has RDNS set-

C:\>nslookup 10.11.12.13

Server: vnsc-pri.sys.gtei.net
Address: 4.2.2.1
Name: host.myhostname.com
Address: 10.11.12.13

Here if "Name" is your "hostname" then RDNS is setup for this server.


If RDNS is not setup you will see the "datacenter name " in front of "Name" as below.
C:\>nslookup 11.12.13.14
Server: vnsc-pri.sys.gtei.net
Address: 14.13.12.11
Name: bc.d3.7bae.static.theplaneet.com
Address: 11.12.13.14

Here "Name" is not your hostname, thus rdns is not set up for this server.


Using HOST command (on linux server)
-----------------------------------------------
1)on server
root@shell [~]# host 10.11.12.13
output-
13.12.11.10.in-addr.arpa domain name pointer host.myhostname.com.
=> If output line is ended with hostname, then rdns is setup for this.

2)on linux server -
root@shell [~]# host 1.2.3.4
output-
4.3.2.1.in-addr.arpa domain name pointer bc.d3.7bae.static.theplanet.com.
=> output line is not ended with hostname, thus rdns is not set for this .


Use centralops.net
---------------------------------------
browse http://centralops.net
1) open browser http://centralops.net/co/ >> Domain Dossier
put ip in it and see dns report
canonical name should be your hostname
and in dns report

13.12.11.10.in-addr.arpa IN PTR host.myhostname.com

ptr line should contain hostname.


3) open browser http://centralops.net/co/ >> Domain Dossier
put ip in it and see dns report
canonical name should be your hostname
and in dns report

"4.3.2.1.in-addr.arpa IN PTR ba.d3.7bae.static.theplanet.com"

ptr line does not contain hostname, thus no rdns set for this.

Sunday, April 12, 2009

SET HOSTNAME

hostname - Changing server host name

Before starting ensure that your desired hostname is resolving

to the server . Steps in changing the hostname on a plain Red Hat Enterprise Linux server are:

1. Modifying /etc/sysconfig/network (replace XXX.XXX.XXX.XXX

with your gateway IP )

NETWORKING=yes
HOSTNAME="plain.ev1servers.net"
GATEWAY="XXX.XXX.XXX.XXX"
GATEWAYDEV="eth0"
FORWARD_IPV4="yes"

2. Modify /etc/hosts (
replace YYY.YYY.YYY.YYY with server ip)
replace server1.company.com with your server name.
replace server1 with your first part of your desired hostname.

127.0.0.1 localhost.localdomain localhost
YYY.YYY.YYY.YYY server1.company.com server1

3. restart kernel logging services

/etc/rc.d/init.d/syslog restart

4. To verify, type the following at prompt

hostname

==========================

Monday, March 2, 2009

Wget Error

for wget http://where.the.rpm it returns:

Code:

# wget http://------.rpm
bash: wget: command not found

**Fixed my wget problem with:

#yum install wget

Monday, February 23, 2009

htaccess file:

php_value register_globals 0
========================================
DirectoryIndex index.php index.html
=====================================
php_value upload_max_filesize 20M
========================================
php_value display_errors off
========================================

How to redirect a website using .htaccess

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.mysite.com$
RewriteRule ^(.*)$ http://www.mysite.com/forum/$1 [R=301,L]

Using the above code www.mysite.com will be redirected to www.mysite.com/forum

You can redirect your domain to any other domains.