buy tb500

Archive for the ‘Linux’ Category

How do I enable anonymous uploads with Pure-FTPd? WHM

Thursday, August 26th, 2010

Find this in the Pure-FTPd configuration file (/etc/sysconfig/pure-ftpd):

  • # disallow uploads for anonymous users
  • #–anonymouscantupload

Make sure the second line has the # in front of it, then restart PureFTPd.

Where is the PureFTPd configuration file? WHM

Thursday, August 26th, 2010

/etc/sysconfig/pure-ftpd

thank you.

How can I fix “ndc connection refused” errors? WHM

Thursday, August 26th, 2010

Run the following scripts:

  1. /scripts/updatenow
  2. /scripts/fixndc
  3. /scripts/fixndc
    • The fixndc script needs to be run twice.

How do I reinstall FrontPage extensions for the entire server? WHM

Thursday, August 26th, 2010

Issue the following commands in a terminal session:

  • rpm -Uvh http://httpupdate.cpanel.net/fp-5.0-upgrade/frontpage/frontpage-5.0-0.i386.rpm

How do I reinstall Interchange?

Thursday, August 26th, 2010

Issue the following commands in a terminal session:

  1. /scripts/rebuildinterchangecfg
  2. /usr/local/cpanel/bin/startinterchange

How do I fix WHM News if it’s broken?

Thursday, August 26th, 2010

Issue the following command in a terminal session:

  • rm -f /var/cpanel/objcache/whmnews

How do I restart a daemon ? Services

Thursday, August 26th, 2010

Most of the services can be restarted from WHM; however, you may need to restart them from the shell. You must be logged in as root to do this. All standard Linux services, such as HTTP, FTP, exim, cPanel/WHM, Interchange, MySQL, etc, have init scripts in /etc/rc.d/init.d/

root@host [~]# ls /etc/rc.d/init.d/
./ atd* exim* httpd.tmpeditlib kdcrotate* named* nscd* rawdevices* snmpd* yppasswdd*
../ autofs* filelimits* identd* keytable* netfs* portmap* rstatd* sshd* ypserv* 
anacron* bandmin* functions* ipaliases* killall* network* portsentry* rusersd* syslog* ypxfrd*
antirelayd* chkservd* gpm* ipchains* kudzu* nfs* proftpd* rwalld* xfs* 
apmd* cpanel3* halt* iptables* lpd* nfslock* radvd* rwhod* xinetd* 
arpwatch* crond* httpd@ isdn* mysql* nofsck* random* single* ypbind*

This is typical of what you will find in this directory. The main ones you should be concerned with are:

  • cpanel3 — starts/stops cPanel and WHM. This includes Interchange, cppop, and cluster management services as well.
  • exim — starts/stops the exim mail server.
  • httpd — starts/stops the Apache web server.
  • mysql — starts/stops the MySQL database server.
  • named — Starts/stops the BIND DNS server.
  • proftpd — Starts/stop the ProFTPd or Pure-FTPd (depending on which is enabled) FTP server.

Using these scripts is very easy. Let’s say that named/BIND is down and we need to restart it. As root, type:

  • /etc/rc.d/init.d/named start

You should see it start up, with a green [OK] message on the left side of the shell/terminal window.

If you see a red [FAILED] message, check the message log.

  • tail /var/log/messages

You should be able to see the error. If you cannot fix it yourself, contact tech support. Some of these services have more options than just “start” and “stop,” and other ways to do them.

Let’s say you have a lot of domains using your DNS server and you don’t want to stop and restart named just because you edited one domain. Type:

  • ndc reload

If you make a minor change to the /usr/local/apache/conf/httpd.conf, but don’t want to restart it, type:

  • /etc/rc.d/init.d/httpd graceful to do a graceful restart. A graceful restart finishes current requests before killing the child processes.

If you want to learn more about the commands a script offers, you can simply run the script without passing any arguments to it.

root@saturn [~]# /etc/rc.d/init.d/cpanel3 <br />Usage: /etc/rc.d/init.d/cpanel3 {start|stop|status|restart}

This lets us know we can start, stop, check the running status of the service(s), or restart it. If you can’t get a service to start, and don’t know how to fix it, contact tech support for assistance.

References

http://docs.cpanel.net/twiki/bin/view/AllDocumentation/AllFAQ/WHMsFAQ

How do I block an IP address from my server?

Thursday, August 26th, 2010

If you want to block access to your server for whatever reason, you will need to log into the shell as root. Your server should either have ipchains or iptables to help accomplish this. In this example, the attacking IP is 192.168.56.210.

Issue the appropriate command in a terminal session:

  • If you are using ipchains: ipchains -A input -j DENY -p all -l -s 192.168.56.210/32
  • If you are using iptables: iptables -A INPUT -s 192.168.56.210/32 -j DROP

If you just want to block access to one port from an IP :

  • iptables -A INPUT -s 192.168.56.210/32 -p tcp –destination-port 23 -j DROP

The above would drop all packets from 192.168.56.210/32 to port 23 (Telnet) on the server.

There are many in-depth tutorials available on the Internet. Consult your favorite search engine for more information.

refereces

http://docs.cpanel.net/twiki/bin/view/AllDocumentation/AllFAQ/WHMsFAQ

fatal error or timeout occurred while processing this directive

Thursday, August 26th, 2010

Seems there problem with ownership of the files.
How to fix.

Go to /home
Let assume cPanel username sagar

execute following commands in /home
chown sagar.sagar sagar -R
chown sagar.mail sagar/etc -R
chown sagar.nobody sagar/public_html
rm -rf sagar/.cpanel

This is should fix the issue.

cron job in cpanel

Thursday, August 26th, 2010

How to setup Basic Cron Jobs.

Ok. Many people are yelling that they cannot configure the crons properly.
Here is a short tutorial which will help you set them. I have tried my best to explain the concept but there can be more advanced configurations.

Basically you will want to run a PHP script file in specific intervals. Suppose you want to execute a php file called maintanence.php every one hour. This is what you do :-

[ :P This tutorial is for noobs, Dont go into detail. Just do as instructed :P ]

The CRON Command is in the Following Format

[ Minute - Hour - Day - Month - Weekday ] - Command

The COMMAND, can be broken down in

[PATH OF PHP] [ARGUMENTS] [PATH OF PHP SCRIPT]

So the COMPLETE CRON command can be written as

[ Minute - Hour - Day - Month - Weekday ]  [PATH OF PHP] [ARGUMENTS] [PATH OF PHP SCRIPT]

The timing is spedified using * symbols

* * * * * => Execute every minute
0 * * * * => Execute every Hour
0 0 * * * => Execute every mid-night
0 0 0 * * => Execute every Month
0 0 0 0 * => Execute every Weekday

If you did not understand anything till now.. Good, this means you are a noob.. Read ahead :P

Since this is a UNIX command, You will have to Mention the PATH of PHP. At Astahost,

PATH TO PHP  : /usr/local/bin/php

( it also same at trap17, if users over there want to use it )

These are the Possible Command line Arguments you can use. This will effect the output. In our case, we will use the -q ( Quiet mode ) argument.

  -a               Run interactively
  -b <address:port>|<port> Bind Path for external FASTCGI Server mode
  -C               Do not chdir to the script's directory
  -c <path>|<file> Look for php.ini file in this directory
  -n               No php.ini file will be used
  -d foo[=bar]     Define INI entry foo with value 'bar'
  -e               Generate extended information for debugger/profiler
  -f <file>        Parse <file>.  Implies `-q'
  -h               This help
  -i               PHP information
  -l               Syntax check only (lint)
  -m               Show compiled in modules
  -q               Quiet-mode.  Suppress HTTP Header output.
  -s               Display colour syntax highlighted source.
  -v               Version number
  -w               Display source with stripped comments and whitespace.
  -z <file>        Load Zend extension <file>.

The Path of the PHP file Must be Complete absolute path.
If you have an Account at TRAP, And your USERNAME is “tom”, Your path will be
“/home/tom/public_html/”

I assume you are familier with the PUBLIC_HTML directory. That is the Root folder where you store your html files.

So lets say that Tom wants to execute my script “maintenance.php” every hour. And it is stored in “public_html/cron/maintenance.php”;

So the Complete CRON command would be,

0 * * * * /usr/local/bin/php -q /home/tom/public_html/cron/maintenance.php

If tom wants to execute it every minute, he would use.

* * * * * /usr/local/bin/php -q /home/tom/public_html/cron/maintenance.php

If tom wants to execute it every Month, he would use.

0 0 0 * * /usr/local/bin/php -q /home/tom/public_html/cron/maintenance.php

There are more Complex forms of Assigning the TIMINGS for these scripts. You can go to CPANEL => Cron Jobs => Standard and set exact time when the script will be executed.

Also, this method used php, you can also use Curl .

refer to the URL below

http://www.knowledgesutra.com/forums/topic/6321-cron-jobs-cron-jobs-in-cpanel/