Month: May 2007

Introduction to cPanel (part-1)

Introduction to cPanel (part-1)

Introduction –

In this article we will cover cPanel directory structure and configuration files –
When you install cPanel on your web Server, cPanel configuration files, setting, script, admin templates and 3rd party modules are stored in following three directories –


1) /usr/local/cpanel – This is the main directory for cPanel, most of the setting is stored here.


a) /usr/local/cpanel/bin –This directory contains only scripts and binaries which provide installation and configuration of many cPanel managed services…

b) /usr/local/cpanel/logs –

This directory contains access log ,error log and license log of cPanel control panel.

* Access log format –

[source address] – [username] [[date]] [status] [url] [browser agent]

root@arunbagul:~#tail -f /usr/local/cpanel/logs/access_log – root [31/May/2006:23:11:31 -0500] “” 500 0
“https://www/” “Mozilla/5.0 (X11; U; Linux
i686; en-US; rv: Gecko/20060512 Firefox/” – root [31/May/2006:23:11:31 -0500] “” 500 0
“” “Mozilla/5.0 (X11; U; Linux i686; en-US;
rv: Gecko/20060512 Firefox/”


* Error log –

root@arunbagul:~# tail -f /usr/local/cpanel/logs/error_log
Can’t locate Net/AIM/ in @INC (@INC contains: /scripts /usr/lib/perl5/5.8.7/i686-
linux… /usr/lib/perl5/site_perl/5.8.7/i686-linux /usr/lib/perl5/site_perl/5.8.7 /
usr/lib/perl5/site_perl/5.8.5 /usr/lib…. /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /
usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site… /usr/lib/perl5/site_perl .) at /
usr/lib/perl5/site_perl/5.8.7/Net/ line 37.
BEGIN failed–compilation aborted at /usr/lib/perl5/site_perl/5.8.7/Net/ line 37.
Compilation failed in require at /scripts/cPScript/ line 14.
BEGIN failed–compilation aborted at /scripts/cPScript/ line 14.
Compilation failed in require at /scripts/wwwacct line 18.
BEGIN failed–compilation aborted at /scripts/wwwacct line 18.

* License log file –

root@arunbagul:~# tail -f /usr/local/cpanel/logs/license_log
License Update Request at: Wed May 13
02:16:13 2007
License Server returned: Key Accepted
License Server returned: Key Follows
License Updated Successfully

* Stat log –

root@arunbagul:~# tail -f /usr/local/cpanel/logs/stats_log
Update for config
With data in log file “/usr/local/apache/domlogs/”…
Phase 1 : First bypass old records, searching new record…
Direct access to last remembered record is out of file.
So searching it from beginning of log file…
Phase 2 : Now process new records (Flush history on disk after
20000 hosts)…
Jumped lines in file: 0
Parsed lines in file: 14
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 10 new qualified records.



c) /usr/local/cpanel/base –

This is the base directory for cPanel admin panel web server(apache). It also contains directory
/usr/local/cpanel/base/frontend – this directory content control pannel themes like x ,x2 , xmail, monsoon etc…


d) /usr/local/cpanel/base/etc –

This directory contains conf files for cPanel admin panel, template files for FTP, HTTP, mail, zone files..


e) Extra 3rd party modules for cPanel –

3rd party module which are not part of cPanel base, can be installed in /usr/local/cpanel/3rdparty directory.. like ioncube etc


Thank you,
Arun Bagul

File Descriptor error while mounting proc file system

File Descriptor error while mounting proc file system


One day I was just playing with device files in /dev directory. While next reboot I met a new error “Mounting proc filesystem Bad file descriptor No such partition found …” I have no idea why this is happening! I stuck with this problem for two days and with lot of search on internet I found that this is due to /dev/null is modifed as “regular file“!! To fix this, I login in to rescue mode and then remounted the root(/) file system as read-write and restore the /dev/null file!

bash-arun~# mount -n -o remount,rw /
bash-arun~# rm -f /dev/null

bash-arun~# mknod -m 0666 /dev/null c 1 3

That’s it!!

root@arunbagul:~# ls -l /dev/null
crw-rw-rw- 1 root root 1, 3 2008-02-29 09:22 /dev/null

* As shown above the /dev/null is character device file…

command(1) mknod – this command is used to create “Block device” or “Character device” special files….

mknod [options]… NAME TYPE [MAJOR MINOR]

Options –

-m, –mode=MODE
set permission mode (permission need to be numeric format)
–help display this help and exit

output version information and exit

Both MAJOR and MINOR must be specified when TYPE is b, c, or u, and they must be omitted when TYPE is p. If MAJOR or MINOR begins with 0x or 0X, it is interpreted as hexadecimal; otherwise, if it begins with 0, as octal; otherwise, as decimal.

TYPE may be –

b –> create a block (buffered) special file

c, u –> create a character (unbuffered) special file

p –> create a FIFO

Example –

root@arunbagul:~# mknod /tmp/arun p
root@arunbagul:~# ls -l /tmp/arun
prw-r–r– 1 root root 0 2008-04-18 23:31 /tmp/arun

root@arunbagul:~# mknod -m 666 /tmp/block_device b 12 16
root@arunbagul:~# ls -l /tmp/block_device
brw-rw-rw- 1 root root 12, 16 2008-04-18 23:32 /tmp/block_device

Arun Bagul

PHP4 and PHP5

PHP4 and PHP5

Introductions –

First starts with PHP4 features. PHP4 started up with object-oriented concepts like as c++. PHP4 got almost all the OOPs features. With little difference in functionality…


Below are PHP4 added features –


  1. class

  2. extends

  3. Constructors

  4. Scope Resolution Operator (::)

  5. parent

  6. Serializing objects – objects in sessions

  7. The magic functions __sleep and __wakeup

  8. References inside the constructor

  9. Comparing objects


PHP 5 now came up with new Object Model. Even php4 contains the object model functionalities but PHP5 handling of objects has been completely rewritten, allowing for better performance and more features.

Features Of PHP5 –

  1. Constructors and Destructor

  2. Visibility

  3. Scope Resolution Operator (::)

  4. Static Keyword

  5. Class Constants

  6. Class Abstraction

  7. Object Interfaces

  8. Overloading

  9. Object Iteration

  10. Patterns

  11. Magic Methods

  12. Final Keyword

  13. Object cloning

  14. Comparing objects

  15. Reflection

  16. Type Hinting

  17. Late Static Binding


Some of the above features are in PHP4. But still PHP5 has got improved functionalities on above features. Some of the syntaxes are changed.

Thank you,

Santhosh Tirunahari