Archive for the hosting Category

how to delete files is older then n no of days on centos linux

You may be having lakhs of files on a folder which is taking chunk out of you from your server.

Its hard to list all the files even on a GUI file manger on KDE or on GNOME.

Without worries, this can done with a simple command.

find /home/username/foldername -mtime +10 -exec rm {} \;

with the above command, we can delete the files older then 10 days on the location /home/username/foldername change the path that points your local OS files or folder location

Processing single domains statistics on Plesk Windows

Running statistics on Windows Plesk Servers will take huge time to complete.

What, If you wanted to know the current usage of one domains ?
What If you wanted to  once domains stats immediately ?

Well, you dont have to run the statistics.exe command of plesk and wait for long time.

I have searched the Internet a lot for processing only one domains statistics on the Plesk Windows Platform. I cant fine one.

So, this is for some one who wanted.

Once you logged into the server through RDP, open a cmd prompt and type >>  cd %plesk_bin%
C:\Program Files (x86)\Parallels\Plesk\admin\bin>
Type the below command, and change the earneasy.net domain to your domain name

statistics --disk-usage --process-domains=earneasy.net

unable to remove files using rm command /bin/rm: Argument list too long

I had faced issues in deleting files using rm command which caused our linux BOX struggle to work with Mysql Databases.
I came to see an nice article from simplehelp.net and thought of sharing the same.

which will help to take your headache.

# /var/spool/clientmqueue # rm -Rf SAS*
#/bin/rm: Argument list too long.

Ever seen this error in Linux when you have too many files in a directory and you are unable to delete them with a simple rm -rf *? I have run into this problem a number of times. After doing a bit of research online I came across a neat solution to work around this issue.

find . -name ‘SAS*’ | xargs rm

In the above instance the command will forcefully delete all files in the current directory that begin with SAS. You can replace the SAS-* with anything you like. You can also replace it with just a * if you want to remove all files in the folder.

find . -name ‘*’ | xargs rm

Thanks who ever wrote this.

/var/cpanel/bandwidth causing issue on /var full in cpanel

Issue : /var/cpanel/bandwidth causing issue on /var full in cpanel

When you get the issue of /var is full,

normally it happens because the following using the more space
1. Bandwidth files of the domains hosted.
2. Logs files of the server, which includes cpanel, mail, mysql & all other services running the Server
3. Due to Mysql Usage.

Here we are going to resolve the issue which caused due tot he bandwidth files.

Generally the Location will be /var/cpanel/bandwidth
This files are not not log files, which cannot rotated and even if you rotate it will not help you in reducing the files size.

Instead of deleting the directory, move the files to a location where you have more storage, then sym link to the old location

Use the Below Commands :
# mv /var/cpanel/bandwidth /home/bandwidth
# ln -s /home/bandwidth /var/cpanel/bandwidth

viewing & finding contents from the mail logs on Linux centos cpanel

To viewing & finding contents from the logs on Linux centos cpanel

Use the below commands view or find the email or domains transaction logs.

/var/log/exim_mainlog
/var/log/maillog

# grep domainname /var/log/exim_mainlog  for finding logs of a particular domain

and

# grep emailaddress /var/log/exim_mainlog for finding logs of a particular email address.

how to restart linux cpanel apache tomcat

To restart the Linux servers, Apache TOMCAT installed with cpanel

/scripts/restartsrv tomcat

checking the folder size – The /usr partition on this server is running out of disk space

If you have 1000s of accounts on cpanel, you would probably get the error message

The /usr partition on this server is running out of disk space. WHM operation has been temporarily suspended to prevent something bad from happening. Please ask your system admin to remove any files not in use on that partition.

Here, you will left alone to find what files are taking too much space on the /usr partition

Normally,

/usr/local/cpanel
/usr/local/apache
If you have ASSP or some kind of Antispam Engine installed it would take logs of space for storing the messages & logs
for ASSP
/usr/local/assp

First, Login to ssh
use the below command
du -h --max-depth=1 /usr/

If you find any specific folder taking more space, you do denote the specific folder by

du -h --max-depth=1 /usr/local

here you can increase depth to 2, 3 & etc.. to see the space used in depth.

To sort the foldersize in ascending order user
du -h --max-depth=1 /usr/ | sort -n -r

Once you have found, You can remove the logs of cpanel, apache, assp & etc…

ASP.NET tab on IIS Manager does not show while you check the properties of a website configured

While you check the properties for a website in Internet Information Services (IIS), ASP.NET tab does not appear.

The cause of the issue is that the IIS on 64Bit OS is running on 32Bit.

so. you should configure Windows 2003 64 Bit to load the IIS in 64Bit mode.

To enable IIS 6.0 to run 32-bit applications on 64-bit Windows

Open a command prompt change the directory to admins script

1. cd %systemdrive%\Inetpub\AdminScripts

2. Type >> cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 “true”

3. Press ENTER.

And restard the Webserver by typing iisreset /restart

It should work for  your.

else

Just do a OS restart.

Editing Network Ipaddress on Linux OS cent-os

Make sure that you have Network Card is physically installed on the PC/Server.

And enable the Network card. by command >> service network start

Now, use any editor, here i use nano for editing the configuration of the networking IP Addres
nano /etc/sysconfig/network-scripts/ifcfg-<interface-name>

From here you can edit/remove/add any Ipaddres.

making the cpanel user to create the database name with the username as prefix

If your users are create databases in different like what ever the name they want, we cannot able to identify the user who is abusing the server.

Only by the username of the account, we can easily identify the abuser.

If this featured is disabled, We can enable the same.
Just follow the steps.

You can disabled this by changing in
/var/cpanel/cpanel.config
database_prefix=0
to
database_prefix=1
and restarting cpsrvd.
/usr/local/cpanel/etc/init/stopcpsrvd
/usr/local/cpanel/etc/init/startcpsrvd