Filed Under (cPanel/WHM, Linux) by WebScHoLaR on 24-02-2011
cPanel allows php to be configured as DSO, suPHP and FastCGI. PHP can be reconfigured using /usr/local/cpanel/bin/rebuild_phpconf script. This also allows to set the default PHP version (4 or 5) and enable/disable SuExec. Script has multiple command line parameters that can be passed to it. Script itself shows the available parameters:
[root@Server ~]# /usr/local/cpanel/bin/rebuild_phpconf
Usage: /usr/local/cpanel/bin/rebuild_phpconf [--dryrun] [--no-restart] [--no-htaccess] [--current|--available]
–dryrun : Only display the changes that would be made
–no-restart : Don’t restart Apache after updating the php.conf link
–no-htaccess : Don’t update user configurable PHP mime mapping.
–current : Show current settings
–available : Show available handlers and PHP SAPIs
: Version of PHP to set as default handler for .php files
: Type of Apache module to use in serving PHP requests
: enabled, disabled, 1 or 0
Read the rest of this entry »
Filed Under (cPanel/WHM, Linux) by WebScHoLaR on 24-02-2011
cPanel allows custom modification to any website Virtual Host section. httpd.conf in cPanel server is no longer used as a data store and it is rebuilt based on information stored at /var/cpanel/userdata mostly. A directory is created for each user at /var/cpanel/userdata that contains information about the websites. Virtual host section is added for each website that is setup in cPanel. Any custom settings can be added to Virtual Host using include file that should be created at following path:
Read the rest of this entry »
1. Check for processes holding the rpm database open (usually in MUTEX/FUTEX states):
lsof | grep /var/lib/rpm
If it finds any, kill -9 them all.
2. Delete any temporary DB files:
rm -fv /var/lib/rpm/__*
3. Rebuild your RPM database:
rpm –rebuilddb -v -v
If you still have problems, a reboot is probably quickest, then repeat steps 2 and 3 above.
Filed Under (cPanel/WHM, Linux) by WebScHoLaR on 16-02-2011
pure-ftp is a popular FTP Server. By default has a display limit of 2000 files, this prevents the server from showing more then 2000 files when you browse a directory with a FTP client. If there will be more than 2000 files, then the FTP client will only show the first 2000 files and rest of the files will not appear. You will most likely see following error:
226-Options: -l
226 Output truncated to 2000 matches
In pure-ftp, this limit can be raised. LimitRecursion is the parameter that defines this limit. It is usually specified inside pure-ftpd.conf. In order to raise the limit the parameter can be set as:
LimitRecursion 5000 15
The first argument is the maximum number of files to be displayed. The second one is the max subdirectories depth. FTP server needs to be restarted after this change so that the new settings can be applied:
/etc/init.d/pure-ftpd restart
Filed Under (Linux, Windows) by WebScHoLaR on 29-01-2011
tw_cli is the management utility for 3ware Raid card. In case the cache needs to be enabled on raid card, this can be done as:
root@server [~]# /path/to/tw_cli
//server> /c0/u0 set cache=on
Setting Write Cache Policy on /c0/u0 to [on] … Done.
mysqldump is the utility to backup mysql databases. By default it generate backup for the complete database. In case only backup of stored procedures is required, this can be done as:
mysqldump –routines –no-create-info –no-data –no-create-db –skip-opt database_name > /path/to/database_name.sql
Filed Under (Linux) by WebScHoLaR on 11-12-2010
Permissions are changed by chmod command in Linux. -r flag can be used with chmod command to recursively change permissions but it will change permissions for all files and folders. If different permissions need to be set for files and folder, this can be done as:
For directories, type should be d:
find /path/to/chmod -type d | xargs chmod -v 755
For files, type should be f:
find /path/to/chmod -type f | xargs chmod -v 644
Filed Under (Linux, MySQL, Windows) by WebScHoLaR on 11-12-2010
mysqldump can be used to generate SQL Script for the complete database or any specific table. In case we need to generate sql script for specific rows or need to extract rows on any criteria, this can be done as:
mysqldump DATABASENAME TABLENAME “–where=’WRITE QUERY HERE’;” > DUMP.sql
e.g we need to extract the rows for scholar database user only from MySQL user and db table. This can be done as:
mysqldump mysql user “–where=’user.User like ‘scholar%’;” > dbusers.sql
mysqldump mysql db “–where=db.User like ‘scholar%’ and Host=’%';” > db.sql
DNS zone files in Bind are refreshed by increasing the serial number that is in the format yyyymmddXX (e.g 2010121101 i.e 11th December, 2010 and serial number is 01). In case all DNS zone files on the server need to be refreshed by incrementing serial number, this can be done as:
for i in `ls /var/named/*.db` ; do cat $i | sed ‘s/[0-9]\{10\}/2010121101/g’ > $i.new; mv -f $i.new $i; chown named.named $i ;done
This will set serial for all DNS zone files to 2010121101. Make sure to reload BIND after wards as:
[root@System ~]# rndc reload
server reload successful
Filed Under (DirectAdmin, Linux, MySQL) by WebScHoLaR on 11-12-2010
The default MySQL installations on Linux have root user as the Admin user that has full access. DirectAdmin setups another Database user da_admin as Super database user. Password for it is stored inside /usr/local/directadmin/conf/mysql.conf. MySQL prompt can be accessed directly on DirectAdmin as:
mysql –user=da_admin –password=`cat /usr/local/directadmin/conf/mysql.conf | grep passwd |cut -d= -f2`
To access mysqladmin on DirectAdmin system, use:
mysqladmin –user=da_admin –password=`cat /usr/local/directadmin/conf/mysql.conf | grep passwd |cut -d= -f2` processlist