Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Wednesday, 25 June 2014

[FIX] 403 forbidden error - pcfg_openfile: unable to check htaccess file, ensure it is readable

If you're getting the "403  forbidden error" while accessing your website.  This issue is generally due to permissions.

Step 1:

  • Check error log,

# tailf /usr/local/apache/logs/error_log | grep <Your IP/website name>
 You'll get below error,

 [Wed Jun 25 15:39:08 2014] [crit] [client XX.XX.XX.XX] (13)Permission denied: /home/user_name/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable


Step 2:

  • Most often, setting folder permissions back to 755 should resolve this issue.
The default permissions for folders should be 755. When reviewing your account,I recommend setting these folders back to 755 and then testing again. If you have sub folders within those that are not 755, you'll want to adjust those as well.
  •  # chmod 755 /home/user_name
That's it.



Friday, 13 June 2014

cPanel logs for access, Apache, email, error, ftp, mysql, and WHM

cPanel logs
  • Access logs and user actions    /usr/local/cpanel/logs/access_log
  • Account transfers and misc. logs    /var/cpanel/logs
  • Auditing log (account creations, deletions, etc)    /var/cpanel/accounting.log
  • Backup logs    /usr/local/cpanel/logs/cpbackup
  • Brute force protection (cphulkd) log    /usr/local/cpanel/logs/cphulkd.log
  • Cpanel dnsadmin dns clustering daemon    /usr/local/cpanel/logs/dnsadmin_log
  • Cpanel taskqueue processing daemon    /usr/local/cpanel/logs/queueprocd.log
  • DBmapping    /usr/local/cpanel/logs/setupdbmap_log
  • EasyApache build logs    /usr/local/cpanel/logs/easy/apache/
  • Error log    /usr/local/cpanel/logs/error_log
  • Installation log    /var/log/cpanel
  • License updates and errors    /usr/local/cpanel/logs/license_log
  • Locale database modifications    /usr/local/cpanel/logs/build_locale_database_log
  • Login errors (CPSRVD)    /usr/local/cpanel/logs/login_log
  • Horde    /var/cpanel/horde/log/
  • RoundCube    /var/cpanel/roundcube/log/
  • SquirrelMail    /var/cpanel/squirrelmail/
  • Panic log    /usr/local/cpanel/logs/panic_log
  • Per account bandwidth history (Cached)    /var/cpanel/bandwidth.cache/{USERNAME}
  • Per account bandwidth history (Human Readable)    /var/cpanel/bandwidth/{USERNAME}
  • Service status logs    /var/log/chkservd.log
  • Tailwatch driver tailwatchd log    /usr/local/cpanel/logs/tailwatch_log
  • Update analysis reporting    /usr/local/cpanel/logs/updated_analysis/{TIMESTAMP}.log
  • Update (UPCP) log    /var/cpanel/updatelogs/updated.{TIMESTAMP}.log
  • WebDisk (CPDAVD)    /usr/local/cpanel/logs/cpdavd_error_log
  • Website statistics log    /usr/local/cpanel/logs/stats_log
cPanel access log
  • Access logs and user actions    /usr/local/cpanel/logs/access_log
cPanel apache log
  • Apache restarts done through cPanel and WHM    /usr/local/cpanel/logs/safeapcherestart_log
  • Domain access logs    /usr/local/apache/domlogs/{DOMAIN}
  • Processing of log splitting    /usr/local/cpanel/logs/splitlogs_log
  • suPHP audit log    /usr/local/apache/logs/suphp_log
  • Web server and CGI application error log    /usr/local/apache/logs/error_log

cPanel email log
  • Delivery and receipt log    /var/log/exim_mainlog
  • Incoming mail queue    /var/spool/exim/input/
  • Log of messages rejected based on ACLS or other policies    /var/log/exim_rejectlog
  • Unexpected/Fatal error log    /var/log/exim_paniclog
  • IMAP, POP login attempts, transactions, fatal errors and spam scoring    /var/log/maillog    /var/log/messages
  • Mailman    /usr/local/cpanel/3rdparty/mailmain/logs

MySQL log
  • MySQL error log    /var/lib/mysql/{SERVER_NAME}.err
  • MySQL slow query log (if enabled in my.cnf)    /var/log/slowqueries

[FIX] Reset Bandwidth Limit Exceeded user/domain

If domain is giving the error of “Bandwidth Limit Exceeded” you can Reset/Increase it from WHM or terminal as well.

From WHM :

To bring the website back online and reset the bandwidth exceeded, use the option.
  • WHM >> Account Functions >> Reset  Account Bandwidth Limit
This will reset the bandwidth usage to zero for the account. To increase the bandwidth limit for the account, use the option
  • WHM >> Account Information >> “View Bandwidth Usage”
From Terminal :
  • # vi /var/cpanel/users/USERNAME
change BWLIMIT (Increase the value)
  • # /scripts/updateuserdomains
  • # cd /var/cpanel/bandwidth.cache/
  • # vi domainname.com
Delete the numbers in that file and retype 0 instead of the number 
Save and quit and show bandwidth usage in WHM you will find its 0.

If the above steps doesn’t work well, use the below steps.
  • # cd /var/cpanel/bwlimited/
remove the files related to that user or domain
(or)
rename the fies with suffix _bk/.bak etc.
Example:
user_bk
domainname.com_bk
www.domainname.com_bk

 This will bring the website back online. :-)

Thursday, 12 June 2014

View Pidgin Chat Logs On Your Linux Terminal

If you want to look on your pidgin chat history/conversations in linux, you can easily find the logs in the below location.

# cd ~/.purple/logs/
 Pidgin’s chat logs (chat histories) are saved in HTML files. In the above path, you find more directories to what you actually need.

For example: A Jabber account with username stebu.johny@domain.com‘s log will be found in this path.

You can find various users that the user have chatted with.

Example:

darelegacy stebu.johny@domain.com # pwd
/home/darelegacy/.purple/logs/jabber/stebu.johny@domain.com
darelegacy stebu.johny@domain.com # ll
drwx------  2 darelegacy darelegacy  4096 Mar 18 05:03 abhijith.pm@domain.com
drwx------  2 darelegacy darelegacy  4096 Jun  6 13:55 abhilash@domain.com
drwx------  2 darelegacy darelegacy  4096 Apr 10 08:40 abin@domain.com
drwx------  2 darelegacy darelegacy  4096 Jun  3 13:07 ajay.joseph@domain.com
Go to the directories that you want to check the logs.

Example: 

 # cd abhijith.pm@domain.com

You'll get the log files for that user.

Example:
 -rw-r--r--  1 darelegacy darelegacy   912 Mar  5 07:21 2014-03-05.005451+0530IST.html
-rw-r--r--  1 darelegacy darelegacy  3404 Mar  7 06:47 2014-03-07.033705+0530IST.html
-rw-r--r--  1 darelegacy darelegacy 23804 Mar 18 05:14 2014-03-18.050323+0530IST.html
Open the .html log using the command below.
  # elinks -dump -dump-color-mode 1 <file>.html

Thats it. :-)




Saturday, 7 June 2014

Extract Images From Videos Using ffmpeg

If you want to extract images from a video file. You can use ffmpeg to get images from a video.

ffmpeg
ffmpeg is a very useful command line program which can be used to transcode media files. It is part of the FFmpeg leading multimedia framework that has many functionalities such as the ability to  decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.

There are many various tools included in the framework each of which has a specific role. For example the ffserver is used to stream multimedia for live broadcasts, ffprobe is used to analyze multimedia stream, ffplay can be used as a simple media player and ffmpeg has the ability to convert multimedia files between formats.
Steps:
 You need to install the ffmpeg command line utility in your linux machine for extracting images from the video file.

Ubuntu users can easily install the ffmpeg utility by typing and running the following command in their terminal.
  • sudo apt-get install ffmpeg
Fedora/Centos users can install ffmpeg directly from the repos.
  • yum install ffmpeg
After that,
  • cd /usr/local/src/wget http://www.ffmpeg.org/releases/ffmpeg-2.2.3.tar.bz2
  •  ./configure
  • tar -xvjf ffmpeg-2.2.3.tar.bz2
  •  cd ffmpeg-*
  • ./configure
Note: If the following error occurs,
yasm/nasm not found or too old. Use --disable-yasm for a crippled build.
 Execute the command below.
  • ./configure --disable-yasm
continue by compiling,
  •   make
Once the compile is finished run the following command to install ffmpeg.
  • su -c 'make install'
Note: Everything has been finished now, you have to type a few commands in your terminal and you will be able to extract images from any type of video file.

Before going any further make sure you are in the same directory with the video file from which you want to extract images from. Use the cd command to navigate to the right directory. Since the video I am using for the purpose of this tutorial is in my Desktop i use the following command to navigate to my desktop.

  • cd <file_location>

Then I use the following command to extract images from my video file.
  •  ffmpeg -i "Exapmle_video.mp4" -r 1 -q:v 2 -f image2 image-3%d.jpeg
The -i option serves to get the input which in my case is the video file named "Exapmle_video.mp4", the -r option sets the number of frames to be extracted as images every second. I like to extract one frame every second.

Then a very important option that should be mentioned and I like to use is the -q:v which is used to set the image quality of the images being extracted. I  always get high quality images when extracting them from a video by using the value of 2.

FFmpeg Basic Commands

Here is the list of few ffmepg basic commands list.

  • ffmpeg -version        :         show version
  • ffmpeg -formats       :         show available formats
  • ffmpeg -codecs         :        show available codecs
  • ffmpeg -decoders     :        show available decoders
  • ffmpeg -encoders     :        show available encoders
  • ffmpeg -bsfs             :        show available bit stream filters
  • ffmpeg -protocols    :        show available protocols
  • ffmpeg -filters          :        show available filters
  • ffmpeg -pix_fmts      :        show available pixel formats
  • ffmpeg -layouts        :        show standard channel layouts
  • ffmpeg -sample_fmts:        show available audio sample formats

Try it :-)

Wednesday, 4 June 2014

The uninstallation and installation procedures for Nginx and Apache webserver.


Step 1: Login to the server as root, Please refer the following commands

Installation of Nginx

  • cd /usr/local/src
  • wget http://nginxcp.com/latest/nginxadmin.tar(download stable release)
  • tar xf nginxadmin.tar
  • cd publicnginx
  • ./nginxinstaller install

Note: You may need to run the pythonfix script if you are installing it in first time.

As It's a major release so if you have previously installed the any version of the nginx, please uninstall and then perform the installation.

Uninstallation of Nginx

  • cd /usr/local/src
  • wget http://nginxcp.com/latest/nginxadmin.tar (download stable release)
  • tar xf nginxadmin.tar
  • cd publicnginx
  • ./nginxinstaller uninstall

Installation Apache server.


Please refer the following commands.

Step 1      : Download the latest stable release.

Step 2      : Extract the Apache Files.

Example  : gunzip -d httpd-2_0_NN. tar. gz
                  tar xvf httpd-2_0_NN.tar

Step 3      : Configuring Your Server for Apache.
                   ./configure

Step 4     : Build Apache.
                    make
                    make install

Step 5     : Customize Apache. (Configuration file edit ie, httpd.conf).

Step 6     : Restart httpd service.
                  service httpd restart

Inorder to unistall Apache.

We can use "yum" command by executing the command.

  • yum erase httpd --nodeps

Note: There is no need to remove httpd from the server, you may stop the httpd service permanently by executing the commands below.

  • service httpd stop
  • chkcfg httpd off

Please note that the packages for the server may differ according server configuration and it is strongly recommended to make sure all before proceeding.

Sunday, 1 June 2014

FIXED [Temporary Blocks: IP:X.X.XX.XXX Port: Dir:in TTL:3600 (lfd - *Port Scan* detected from X.X.XX.XXX ]

If you have getting following the error while checking IP block for the specific IP.

# csf -g <IP>
Temporary Blocks: IP:X.X.XX.XXX Port: Dir:in TTL:3600 (lfd - *Port Scan* detected from X.X.XX.XXX (KE/Kenya/X.X.XX.XXX.domain.com). 6 hits in the last 255 seconds)

Use the below command to remove temporary IP block from the CSF firewall.

Exapmle:

# csf -tr <IP>
DROP  all opt -- in !lo out *  X.X.XX.XXX  -> 0.0.0.0/0 
csf: X.X.XX.XXX temporary block removed
csf: There are no temporary IP allows