Saturday, April 12, 2008

I am not able to use WGET ?

cp /usr/bin/wget /usr/bin/mywget

chmod 751 /usr/bin/mywget

How to remove the blocked ip using iptables

  1. First check that ip is blocked or not
  2. iptables –L –n | grep

DROP all -- 125.99.10.123 216.240.157.91

  1. to unblock the ip give the command

iptables -D INPUT -s 125.99.10.123 -d 216.240.157.91 -j DROP

Now the ip is unblocked.

- How to block the IP using iptables

=>

/sbin/iptables -A INPUT -s 81.91.64.167 -j DROP

Awstats just disappeared from the cpanel

  1. Login to the WHM of the server for that domain.
  2. Go to Server configuration->Tweak setting
  3. Just click on the “Awstats stats” option in Stats program.
  4. It will take 1-2 hours to reflect the changes.
Now login to the cpanel of the user and you can see the awstats option in Web FTP/stats.

How to make empty file?

echo –n >filename

OR

cat > filename (then press Ctl+d. The file will be be empty)

How directly run webstat through IE ( i.e domainname.com/webstat)

cd /home/username/public_html

ln -s ../tmp/webalizer webstat

cd ..

chmod 755 tmp

cd tmp

chmod 755 webalizer

Client only wants horde to work for the mail and not neomail or roundcube or squirrelmail. The soution is as follows:

1)create subdomain name

2)add these in .htaccess

RewriteEngine on

RewriteCond %{HTTP_HOST} ^email.cedenar.com.co$ [OR]

RewriteCond %{HTTP_HOST} ^www.email.cedenar.com.co$

RewriteRule ^(.*)$ http://email.cedenar.com.co:2095/horde/login.php [R=301,L]

3)create a test email account and check it.

How to check the mail queuefor the particular account on the server

exim –bp | exiqsumm > spamm.txt

After executing this a command you will get the result in spamm.txt file. This command takes time for execussion. Execute this command when the load of the server is below 5.

How to enable port 26 for SMTP on the server

Please refer the following steps :

1. Login to server WHM. Go to Main >> Service Configuration >> Service Manager
2. At the botom add the number 26 at "exim on another port"
3. In /etc/apf/conf.apf add the port 26 at this line "EG_TCP_CPORTS"
4. apf –r

How to set limit to remove the Frozen Maiils Automatically ?

vi /etc/exim.conf

timeout_frozen_after = 8d ( 8 Days )

/scripts/restartsrv_exim

How to install squirrelmail lanuage package

cd /usr/local/cpanel/base/3rdparty/squirrelmail
wget http://switch.dl.sourceforge.net/sourceforge/squirrelmail/all_locales-1.4.5-20050904.tar.gz
tar -xvzf all_locales-1.4.5-20050904.tar.gz

OR

wget http://easynews.dl.sourceforge.net/sourceforge/squirrelmail/all_locales-1.4.5-20050904.tar.gz

tar -xvzf all_locales-1.4.5-20050904.tar.gz

How to detect spam

tail -f /var/log/exim_mainlog|grep /tmp

tail –f /var/logs/exim_mainlog |grep public_html

tail –f /var/logs/exim_mainlog |grep sendmail

check mail queue

How to configure Logwatch on the server?

vi /etc/log.d/logwatch.conf

Scroll to MailTo =

Replace the lines with

MailTo = root

to

MailTo = support@udsquare.net,wlu@gazzin.com

also change the line

details=Low

to

details=High

How to set _globals off/on?

Just create a .htaccess file in the folder where the script is, and write only this

"php_flag register_globals off"

1

It works for me.

OR

You can also do it this way:

php_value register_globals 0 --------------- for Off

php_value register_globals 1 --------------- for On

This too works.

OR

In general what ever function you want to enable or disable, this is the general format:

php_value function 0 or 1 ---------------for disable or enable respectively.

How to increase ftp upload limit?

a) first check the ftp running ie pure-ftp or pro-ftp.

b) likewise edit the file proftpd.conf or pure-ftpd.conf .

c) edit pure-ftpd.conf

d) search for word “quota”

1. uncomment it and it is in the format 1000:10

The first number is the max number of files. The second number is the max size of megabytes. So 1000:10 limits every user to 1000 files and 10 Mb.

How to trace the DDOS attack on the server ?

1. Your should have following setting at the time of DDOS attack in httpd.conf:

TimeOut = 20

KeepAlive Off

MaxClients 384

MinSpareServers 20

MaxSpareServers 25

2. in /usr/local/ddos/ddos.conf

NO_OF_CONNECTIONS=20

3. You should have 7 SSH session and 1 WHM at the time of DDOS.

4. Check the domlogs to trace out a particular website for the DDOS. Use the following command to check the latest updated domlog file for the website.

ll -lt |less

5. You should keep the following command to check the DDOS.

top, access_logs, error_logs,

ps aux | grep php

check the apache status in the WHM

cd /root/nobody_check

./apachetrace

cd /tmp

ls and check suspected scripts.

6. If necessary reboot the server. This will kill the http process which is causing the DOS. When the server is up, that process will start again and at that time you can trace it and kill it.

7. You can change the permission of the suspected domain. Make the DNS changes to 127.0.0.1 . please use TTL 20 for fast dns propagation. Don't set the redirectio for the website in httpd.conf.

8. After the DDOS attacker is trace down, don't forget to revert back the changes make to https.conf.

9. Suspend the suspected domain and mail the client about this.

check queue by whm

if queue is high I will check queue by whm

I will scroll bottom I will see which domain is most of time or aol

If I find any I will click on id I will see his email headers so we ill get spammer.

I know all mails are not spamer in such case we will delete mails. Only

Tail –f /var/log/exim_mainlog |grep sendmail

Tail –f /var/log/exim_mainlog |grep tmp

Tail –f /var/log/exim_mainlog |grep public_html

Tail –f /var/log/exim_mainlog |grep hostname


Or

Cd /var/spool/cron

Check if someone is sending mail or bulk list.

2)check aol mails

if we find continuously mails from AOL

logged at server

check mail queue who is sending mail to AOL id check header and suspend the account.

As per apache load.

Ps auw |grep nobody

We check is there any old or bad process kill it

We check apache status.

We check access_logs

We check domlogs of domain

For control

1)cap domain name for ip limit

2)if ddos 127.0.0.1 update client

3)if accessing only one file redirect it

4)if ~access ban by mod_sec

in ddos we used following method

In DDOS ON mode usually the best setting is

/usr/local/ddos/ddos.conf

NO_OF_CONNECTIONS=100

/etc/httpd/conf/httpd.conf

Timeout =10

KeepAlive = OFF

mod_evasive = uncomment

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

In DDOS OFF mode

/usr/local/ddos/ddos.conf

NO_OF_CONNECTIONS=650

/etc/httpd/conf/httpd.conf

Timeout =50

KeepAlive = On

mod_evasive = comment

Ddos mode should be off when attack stop.

We check proc/pid too

mysqladmin processlist

if one database again and again we suspend him.

Cpanel default page

When you dive domain name on the browser, it give you cpanel’s default page.

1. login to the shell.

2. killall nobody.

3. /scripts/restartsrv_httpd

4. then the error is solved.

If you are still getting the error please you have to check the error_logs for the apache.

Unable to Publish web using http:// but can publish using ftp://

Unable to Publish web using http:// but can publish using ftp://

/scripts/initfpsuexec

How to suspend anyone using .htaccess

RedirectMatch .* http://caglewebcreations.com/suspended.page/

Options -Includes -Indexes –ExecCGI

Turning safe mode on or off for a single account

In their www directory add / edit the .htaccess with following lines

php_value safe_mod 0


0=off

1=on

How to disable directory or file listing for particular website?

a)vi .htaccess

Options All -Indexes

save the changes.

OR

a)vi .htaccess

add this to the file

IndexIgnore *

Find help on this link for most of the general soultions regarding directory listing:

http://www.clockwatchers.com/htaccess_dir.html

How to allow visitors to view the files in website? (directory or file listing)?

To get a folder views please follow these instructions:

a) Create a file named. htaccess if not created. This can be done in any text editor.

Make sure you save the file as .htaccess (a period at the beginning of file name)

b) In the first line of this file type in

Options +Indexes

c) Save the file

d) Now, upload the file to your web space, specifically the directory in which you

want visitors to see the file listing.

How to access mysql database remotely or third party tools.

Please refer the following steps :

1)login into cpanel

2)click on mysql database option

3)add % in access text box

4)click on add access host

DEBUG MODE

Mysql error

DEBUG MODE

SQL Error: 1016 can’t open file: 'phpbb_config. MYI’. (errno: 144)

SELECT * FROM phpbb_config

Line: 235

File: /home/speedjun/public_html/forum/common.php

=>

go to cd /var/lib/mysql/speedjun_phpbb2

Miasmic -o phpbb_config. MYI

Fantastico missing from Rvskin

Please follow the given steps :

cd /home/rvadmin
mv .fantasticodata/ /backup/oldcpanel/
mv .rvnewfantastico /backup/oldcpanel/

How to fix quota issue?

Error:- run fixquota problem is still there.

=>

a)run fixquota on the server please run following command

b)if fixquota will not solve the problem

c) find / -user username > 1.txt

d)less 1.txt and find the backup files which is using the space delete the file.

( Please run fixquota at the time when many user or domain name have the problem )

How to change reseller username?

Please refer the following given steps :

  • 1) login on whm
  • 2) click on reseller center.
  • 3) select user and remove reseller privileges (please copy or note down reseller info for
  • example disk space bandwidth and other user).
  • 4) modify username..
  • 5) add reseller privileges.
  • 6) change ownership of other user and set with same reseller.

Fantastico not working?

Fantastico not working?

eg: 404 "not found" error at this url:

Solutions :

run script

#/root/fantfix

WebHost Manager that aren't showing Domain

The client is saying, “I've added accounts in WebHost Manager that aren't showing up.

What's wrong ? “

=> Your domain database has not been updated, you need to run:

#/scripts/updateuserdomains