A great linux stuff website

Monthly Archives: March 2016

Sometimes you wish to make the in global PHP.ini file under cpanel server and those changes not reflecting for domain name.
For example if you wish to enable some PHP function for server side all domains then those function not working for your domain or not showing in domain phpinfo file.

It is require to add customize php.ini file for each domain under respective document root path /home/user/public_html/php.ini

” This issue occur because if cagefs enabled for all domains, what is recommendation to update cagefs on server.”

# cagefsctl –update

This will allow to enable php function for globally which will be showing for each domain phpinfo page.

Step1: create a file /home/test.txt and add all databases names there.

Step2: Apply below command which will dump all databases in /home directory.

# for i in `cat test.txt` ; do mysqldump $i > $i.sql ; done”

# for i in `ls -1A | grep -v “\.\./” | grep -v “\./”`; do echo “`find $i | sort -u | wc -l` $i”; done | sort -rn | head -10

# echo “Inode Usage BreakDown: $(pwd)” ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv .|sort`; do c=$(find $d |wc -l) ; printf “$c\t\t- $d\n” ; done ; printf “Total: \t\t$(find $(pwd) | wc -l)\n”

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R=301,L]

# find /home/* -name core.[0-9]* -exec rm {} \;

# find /home/*/public_html -name core.[0-9]*

# find /home/*/public_html -name core.[0-9]* | xargs rm -vf

# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` ethos_db > /var/www/vhosts/ethosclaims.co.uk/httpdocs/ethos_db.sql

# mysql -uadmin -p`cat /etc/psa/.psa.shadow` muzmatchappdb < muzmatchappdb.sql

root@master[~]# grep domain.com /var/log/maillog* | grep retr= | grep -v retr=0 | awk {‘print $11’} | cut -d, -f1 | cut -d= -f2 | awk ‘{t += $1} END { print “total: “, t /1024 /1024 /1024, ” GB transferred over POP3″}’

total: 12.2214 GB transferred over POP3

root@master[~]# grep domain.com /var/log/maillog | grep retr= | awk {‘print $7″ “$1” “$2” “$3” “$11’} | grep -v retr=0