php –ini
vi /opt/atomic/atomic-php52/root/etc/php.ini
fix path:
session.save_path = “/var/lib/php/session”
to “/tmp”
Category Archives: Hosting
cpanel block domain for sending emails
touch /etc/blockeddomains
echo “domain.com” >> /etc/blockeddomains
WHM > Exim Configuration Editor > Advanced Editor
domainlist blocked_domains = lsearch;/etc/blockeddomains
#route
democheck:
driver = redirect
require_files = “+/etc/demouids”
condition = “${if eq {${lookup {$originator_uid} lsearch {/etc/demouids} {$value}}}{}{false}{true}}”
allow_fail
data = :fail: demo accounts are not permitted to relay email
reject_domains:
driver = redirect
# RBL Blacklist incoming hosts
domains = blocked_domains
allow_fail
data = :fail: Connection rejected: SPAM source $domain is manually blacklisted.
apt-get update apt-get: /usr/local/lib/libz.so.1: no version information available (required by /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12)
rm /usr/local/lib/libz.so.1.2.3
rm /usr/local/lib/libz.so.1
ln -s /usr/lib/libz.so.1.2.3.4 /usr/local/lib/libz.so.1
cpanel is not a tty on scp
vi ~/.bashrc
if [ $(expr index “$-” i) -eq 0 ]; then
return
fi
cpanel block mail() function for account
If you are running whm with cloudlinux it works:
php=`su – cpanel_username -s /bin/bash -c “php -v | grep ^PHP | cut -d”.” -f1-2″ | awk ‘{print $2}’`
su – cpanel_username -s /bin/bash -c “echo disable_functions=mail >> /etc/cl.php.d/alt-php$php/custom_php.ini”
/scripts/rebuildhttpdconf && service httpd restart
mail.add_x_header variable php 5.3 >
vi /usr/local/lib/php.ini
mail.add_x_header = On
mail.log = /tmp/mail.log
it helps find spammer on your server.
nagios/icinga webpage polling interval
If you want faster refresh your icinga or nagios, please take a look at cgi refresh rate is configurable in the cgi.cfg file:
CODE: SELECT ALL
# REFRESH RATE
# This option allows you to specify the refresh rate in seconds
# of various CGIs (status, statusmap, extinfo, and outages).
refresh_rate=60
manually change domain in magento
Update your core_config_data table to edit the two records for web/unsecure/base_url and web/secure/base_url
Delete the contents of WEBROOT/var/cache
Update / edit any .htaccess domain redirects you may have added
Restart Apache
Make sure Apache has write permissions to WEBROOT/var
If you created a new DB, ensure that the WEBROOT/app/etc/local.xml is pointing to it.
If you’re using Chrome, clear your browser cache! (Chrome caches 301s)
create mysql timestamp from bash
date +’%F %T’
directadmin install Zend Optimizer/Guard, and/or Ioncube
For Zend, type:
cd /usr/local/directadmin/custombuild
./build set zend yes
./build zend
after changing php versions, it’s recommended you install zend again.
Note that Zend Guard is the new name for Zend Optimizer, and is used for newer versions of php. Custombuild will install the correct one for your system.
For Ioncube, type:
cd /usr/local/directadmin/custombuild
./build set ioncube yes
./build ioncube
redirecting www to non-www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^my-domain\.com$ [NC]
RewriteRule ^(.*)$ http://my-domain.com/$1 [R=301,L]
redirecting non-www to www with .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
wordpress – Notice: Undefined Index and Cannot modify header
It occurs when WP_DEBUG is enabled:
The WP_DEBUG option, added in WordPress, controls the reporting of some errors and warnings and enables use of the WP_DEBUG_DISPLAY and WP_DEBUG_LOG settings. The default value is false.
NOTE: The true and false values in the example are not set in apostrophes (‘) because they are boolean values.
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG’, false );
Additionally, if you are planning on modifying some of WordPress’ built-in JavaScript or Cascading Style Sheets, you should add the following code to your config file:
define( ‘SCRIPT_DEBUG’, true );
Then the uncompressed versions of scripts and stylesheets in wp-includes/js, wp-includes/css, wp-admin/js, and wp-admin/css will be loaded instead of the .min.css and .min.js versions.
php exec vs shell_exec
exec — Execute an external program
system — Execute an external program and display the output
shell_exec — Execute command via shell and return the complete output as a string
/usr/sbin/hiawatha not found – Kloxo
If you are trying reboot kloxo after Kloxo-MR update and you get this error:
/usr/sbin/hiawatha not found
yum install hiawatha
/etc/init.d/kloxo restart