Path to Perl :: /usr/bin/perl
Path to Sendmail :: /usr/sbin/sendmail
Path to Date :: /bin/date
Path to Python :: /usr/bin/python
Path to my files :: /home/username/public_html/
400 – Bad Request
401 – Authorization Required
403 – Forbidden
404 – Page Not Found
500 – Internal Server Error
Do you want to block some site to be browsed from personal computer which have windows operatiing system.
Ok then do this just Go to.
C:\WINDOWS\system32\drivers\etc
Open a “host” file in notepad. At the bottom of the line, you can see as per below
127.0.0.1 localhost
Add the following line at end now
127.0.0.1
www.blocksitename.com put there the site name to which you want to block
MYSQL Password Reset Its easy to reset the password of mysql by going inside the mysql prompt but what if the mysql command doesnt take inside mysql prompt?
Well in that case just fire following command and you will be able to reset the mysql password.
first locate your mysql’s hostname.pid file then
kill `cat /mysql-data-directory/host_name.pid`
mysqld_safe –skip-grant-tables &
mysqladmin -u root flush-privileges password “newpassword”
New password will be the password that you want to set now.
Path to Perl —————- /usr/bin/perl OR /usr/local/bin/perl
Path to Sendmail —————- /usr/sbin/sendmail
Path to home directory —————- /home/username
Path to Date —————- /bin/date
Path to cURL —————- /usr/bin/curl OR /usr/local/bin/curl
Path to OpenSSL —————- /usr/lib/openssl
Path to tcl —————- /usr/lib/tcl
Path to gpg ——————–/usr/bin/gpg
Path to ImageMagicK ——–/usr/local/bin/convert OR /usr/bin/convert
Path to python———-/usr/local/bin/python OR /usr/local/man/man1/python.1.gz
Path to php.ini———-/usr/local/lib/php.ini
Path to mailman——-/usr/local/cpanel
/3rdparty/mailman/bin
Path to pear————/usr/bin/pear
To upgrade your perl on the Cpanel server you need to
go through the below steps.You need to perform all the steps
on the shell :
1. Firstly ,you need to download the latest perl installer tar file
from http://layer1.cpanel.net :
wget http://layer1.cpanel.net/perl587installer.tar.gz
tar -vzxf perl587installer.tar.gz
cd perl587installer
./install
2. Secondly ,after installation you need to run
upcp on the server.
/usr/local/cpanel/bin/checkperlmodules
/scripts/upcp –force
3. Thirdly,you should checkout the perl version after upgradation.
You can checkout the perl version through below command :
perl -v
You should place the following lines in the .htaccess file to allow SSI directives to be included in the .html or .htm files
Cron allows users to automate repetitive system administration tasks such as tape backups, database reorganization, and general file cleanups (such as emptying log files and queues).
The Crontab File’s Syntax
To tell cron what you want it to run, and how often you want it to run it, you need to create a crontab file. A crontab file is just a text file with the following syntax:
Code:
minute hour day-of-month month-of-year day-of-week command
Each of the above columns can be in one of the following formats (these examples are for the minute column):
30
Run command at 30 minutes past the hour.
0-59/10
Run command once every 10 minutes, for entire hour.
15-30
Run command once every minute, from 15 to 30 minutes past the hour.
0,10,50
Run command at 0 minutes past the hour, 10 minutes past the hour, and 50 minutes past the hour.
*
Run command once every minute.
And here’s the range of numbers available for each of the time and date columns:
Minute : 0-59
Hour : 0-23
day-of-month : 0-31
month-of-year : 1-12
day-of-week : 0-6
(0=Sun, 1=Mon, 2=Tue, 3=Wed, 4=Thu, 5=Fri, 6=Sat)
Here’s an example crontab file:
Code:
30 0 * * * ./backup.sh
0,10,50 9-15 * * * ./compute.sh
0-59/10 * * * 1,3,5 ./netgrab.sh
30 0 * * * ./backup.sh
Run the backup.sh script (located in your home directory) at half-past (30) midnight (0), on every day of the month (*), and every day of the year (*), and every day of the week (*).
0,10,50 9-15 * * * ./compute.sh
Run the compute.sh script every 0 minutes, 10 minutes, and 50 minutes past the hours (0,10,50), between 9am and 5pm (9-15), every day of the year.
0-59/10 * * * 1,3,5 ./netgrab.sh
Run the netgrab.sh script every 10 minutes (0-59/10), every Monday, Wednesday, and Friday (1,3,5).
Creating and Submitting Your Crontab File to Cron
There are two methods to create/modify and submit a crontab file:
Method 1
Create a crontab file in a text editor. You can call it whatever you want and save it wherever you like. Now you have to submit the crontab file. To do this enter:
crontab filename
…replacing filename with the location and name of your crontab file e.g. if the file was named crontab and was in your current directory you would enter:
crontab crontab
Method 2
crontab -e
To open your default editor (which is Vi). When saving the file just enter :wq without specifying a Filename; to quit Vi, and automatically submit the crontab file.
Note
When you sumbit a file, a copy of it is stored in the /var/spool/cron directory, with your username as the filename. So if I submitted the file mycron whilst logged into the account laurence, a copy would be stored as /var/spool/cron/laurence. It’s this file the cron daemon uses, and not the master file you created if you used method 1. If you used Method 2 then only one copy of the file exists. Never directly edit files in /var/spool/cron. Cron will not be updated and you can potentially mess things up. Instead use either Method 1 or 2 again, to modify your crontab file.
Listing and Removing Your Crontab File
To display the contents of your crontab file held in the /var/spool/cron directory, enter:
crontab -l
And to remove your crontab file from the /var/spool/cron directory, enter:
crontab -r
Restricting Users
By default only root can submit and modify a crontab file. To allow users to have their own crontab file add their username to the /etc/cron.allow file, e.g:
john
julie
Indicating that john and julie are now permitted to submit their own crontab file.
Putting Theory Into Practice
Here’s a handy little automation exercise for you to try out. It will backup the contents of your home directory to a .tar.gz file each morning at 2.30a.m.
If you haven’t already done so, enter:
su -c ‘pico /etc/cron.allow’
…and add your username to this file to allow you to submit crontab files.
- 1 -
If you’re not already in your home directory, enter:
cd
- 2 -
Enter:
pico backup
…and enter the following:
rm backup.tar.gz
tar cfz backup.tar.gz .
…then press Ctrl+o to save the file, and Ctrl+x to exit.
- 3 -
Now make the script executable by entering:
chmod +x backup
- 4 -
Enter:
crontab -e
- 5 -
Press i to enter Insert mode and enter the following:
30 2 * * * ./backup
…then press Esc to return to Command mode, and enter:
:wq
…to exit Vi and submit your crontab file. That’s all there is to it. Now you can spend hours thinking of bigger and better ways to make your life as a system administrator an easy one.
If you don’t have access to cron, consult your local admin. And
remember, in shell you can access the cron manual by doing :
man cron
Or
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00 # global default, although everything should be something.
FILE 00 # normal file
DIR 01;34 # directory
LINK 01;36 # symbolic link
FIFO 40;33 # pipe
SOCK 01;35 # socket
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 01;05;37;41 # orphaned syminks
MISSING 01;05;37;41 # … and the files they point to
—————
Rookit Hunter is another tool to scan the server for rootkits
#wget http://downloads.rootkit.nl/rkhunter-1.0.9.tar.gz
#tar zxf rkhunter-1.0.9.tar.gz
#cd rkhunter
#./installer.sh
#rkhunter -c