Latest blog entry

error: PIX_FMT_RGBA32 undeclared

September 30, 2009    |   Posted by admin   |    Category: Linux Administration

The error message “Unable to load dynamic library ‘/usr/lib64/php/modules/ffmpeg.so” is received when you add the ffmpeg.so extension to the PHP configuration file i.e. php.ini file and tries to run PHP. You can easily reproduce the error message by executing “php -v”:

PHP Warning:  PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/ffmpeg.so’ – /usr/lib64/php/modules/ffmpeg.so: undefined symbol: _php_create_ffmpeg_frame in Unknown on line 0

You may also notice the “PIX_FMT_RGBA32” error message while compiling ffmpeg-php

ffmpeg-php-0.5.0/ffmpeg_frame.c:495: error: ‘PIX_FMT_RGBA32′ undeclared (first use in this function)

The above error messages is the result of incorrect function declared in the ffmpeg_frame.c file under the ffmpeg-php-0.x.0 directory.

Solution:

Goto the the ffmpeg-php-0.x.0 directory and edit the ffmpeg_frame.c file

vi ffmpeg-php-0.x.0/ffmpeg_frame.c

Now replace every instance of ‘PIX_FMT_RGBA32’ with ‘PIX_FMT_RGB32’ in the file by executing

:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32

OR

replace “PIX_FMT_RGBA32” “PIX_FMT_RGB32” — ffmpeg_frame.c

Save the file and compile ‘ffmpeg-php’ again using the following steps

cd ffmpeg-php-0.x.0
make clean
./configure
make
make install

Once done, ffmpeg should work along with PHP now.

Grant privileges to a Mysql user from Mysql Command line?

September 28, 2009    |   Posted by admin   |    Category: Mysql & PostGres SQL

HowTo GRANT privileges to a Mysql user from the command line? This can be done by logging to the server via SSH. Once you are logged in, goto the Mysql prompt with the mysql user and password.

# mysql -uroot -p<mysql-pass-here>

Once at the prompt, create a database:

mysql> create database dbname;

The database with ‘dbname’ has been created. Now we need to create a user who will have access to the database. This can be done by granting privileges using ‘grant’ command

mysql> grant all on dbname.* to 'dbuser'@'localhost' identified \
by 'password';

The user ‘dbuser’ will now have access to database ‘dbname’ using the password ‘password’. This user can access only from the local server and not from external machine.

To allow user to access the database remotely, say from IP 1.2.3.4, execute:

mysql> grant all on dbname.* to 'dbuser'@'1.2.3.4' identified \
by 'password';

Using the above command, you can grant privileges to multiple users to access a database.

Comments Off on Grant privileges to a Mysql user from Mysql Command line?

Correcting ownership of all cPanel Users

September 28, 2009    |   Posted by admin   |    Category: Scripts

If you mess up with the ownership of all the users on a cPanel server, following script will help you to correct the ownership:

#  for i in `cat /etc/trueuserdomains | awk ‘{print $2}’`
> do
> /bin/chown $i.$i /home/$i -R;

> /bin/chown $i.mail /home/$i/etc -R;
> /bin/chown $i.nobody /home/$i/public_html;
> done;

The ownership of the home directory of a user, etc and public_tml will be corrected in a one go.

Comments Off on Correcting ownership of all cPanel Users

Know cPanel logs in detail OR List of different log files in cPanel

September 27, 2009    |   Posted by admin   |    Category: cPanel Management

The  path to various logs files on a cPanel server for different services is listed below:

Apache Web Server Logs:

/usr/local/apache/logs/access_log
/usr/local/apache/logs/error_log

Exim (Email) Logs:

/var/log/exim_mainlog
/var/log/exim_paniclog
/var/log/exim_rejectlog

Ftp Logs:

/var/log/messages

Mysql Logs:

/var/lib/mysql/server.hostname.err

Cronjob Logs:

/var/log/cron

Server Logs:

/var/log/messages

SSH Logs:

/var/log/secure

cPanel Installation Logs:

/var/log/cpanel-install-thread0.log

ChkServd (cPanel Monitoring Daemon) Logs:

/var/log/chkservd.log

Named (Bind) Logs:

/var/log/messages

Last successful login attempts to the server:

/var/log/wtmp (but to view the details, execute the command “last”)

 

Last unsuccessful login attempts to the server:

/var/log/utmp (To view the logs, execute “lastb” command)

Domlogs of an Account:

/usr/local/apache/domlogs/domainname.tld

Mod Security Logs:

/usr/local/apache/logs/modsec_audit.log
/usr/local/apache/logs/modsec_debug_log

Apache SUEXEC Logs:

/usr/local/apache/logs/suexec_log

cPanel Access and Error Logs:

/usr/local/cpanel/logs/access_log
/usr/local/cpanel/logs/error_log

Stats Execution Logs:

/usr/local/cpanel/logs/stats_log

cPanel License Logs:

/usr/local/cpanel/logs/license_log

cPanel Backup Logs:

/usr/local/cpanel/logs/cpbackup/*.log

Tomcat Logs:

/usr/local/jakarta/tomcat/logs/catalina.err
/usr/local/jakarta/tomcat/logs/catalina.out

Comments Off on Know cPanel logs in detail OR List of different log files in cPanel

Delete Frozen Emails

September 27, 2009    |   Posted by admin   |    Category: cPanel Management, Linux Administration

Howto check number of emails in the mail queue:

exim -bpc

To check the email ID, sender and receiver of the each email:

exim -bp | more

To delete frozen emails from the mail queue, execute:

exim -bp | grep ‘frozen’ | awk ‘{print $3}’ | xargs exim -Mrm

similarly, to delete emails sent using a script’

exim -bp | grep ‘<>’ | awk ‘{print $3}’ | xargs exim -Mrm

Comments Off on Delete Frozen Emails