Install memcached

memcached is a high-performance, distributed memory object caching system, generic in nature,
but intended for use in speeding up dynamic web applications by alleviating database load.

1) Install memcached.
—————–
Enable rpmforge respository to install latest memcached rpm using yum.

For i386 / i686

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

For x86_64

rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

Use yum to install memcached

yum -y install memcached

As soon as memcached installation completed, edit options for memcached in /etc/sysconfig/memcached to meet your need.

vi /etc/sysconfig/memcached

PORT=”11211″                #define on which port to urn
USER=”nobody”           #same as apache user
MAXCONN=”1024″     #maximum number of connections allowed
CACHESIZE=”64″         #memory used for caching
OPTIONS=””                   #use for any custom options

Save the file. All options can be seen by using following command

memcached -h

Start memcached

/etc/init.d/memcached start
Starting Distributed memory caching (memcached):           [  OK  ]

To check the running status of memcached

/etc/init.d/memcached status
memcached (pid 6475) is running…

and

netstat -anp | grep 11211
tcp  0  0 :::11211    :::*  LISTEN      6475/memcached
udp 0  0 0.0.0.0:11211  0.0.0.0:* 6475/memcached

2) Install PHP Extension.
———————

Download and install latest stable memcache version from PECL.
—–>   http://pecl.php.net/packages.php

cd /usr/src
wget http://pecl.php.net/get/memcache-2.2.5.tgz
tar zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
phpize
./configure
make
make install

memcache.so will be install in php modules directory, now enable memcache.so extension in php.ini

To find out your php.ini location, execute following command

php -i | grep php.ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini

vi /usr/local/lib/php.ini

extension = “memcache.so”

save the file and restart httpd server.

/etc/init.d/httpd restart

To check is memcache extension loaded in php, execute following command.

php -i | grep memcache
memcache
memcache support => enabled
memcache.allow_failover => 1 => 1
memcache.chunk_size => 8192 => 8192
memcache.default_port => 11211 => 11211
memcache.default_timeout_ms => 1000 => 1000
memcache.hash_function => crc32 => crc32
memcache.hash_strategy => standard => standard
memcache.max_failover_attempts => 20 => 20
Registered save handlers => files user sqlite memcache
PWD => /usr/src/memcache-2.2.5
_SERVER[“PWD”] => /usr/src/memcache-2.2.5
_ENV[“PWD”] => /usr/src/memcache-2.2.5

This information can also be seen after creating phpinfo page.

Unable to change mail quota

When you get permission denied for changing mail quota.

Please remove the ‘maildirsize’ present in the mail account folder via backend.

———–

cd /home/<cpaneluser>/mail/
rm -f maildirsize
/scripts/generate_maildirsize –confirm –allaccounts –verbose <cpaneluser>

Then in ‘.cpanel’ folder

cd /home/<cpaneluser>/.cpanel/

rm -f email_accounts
rm -f email_accounts*

———–

 

Mailman issues

Issue:
——–
Bug in Mailman version 2.1.14

We’re sorry, we hit a bug!

Please inform the webmaster for this site of this problem. Printing of traceback and
other system information has been explicitly inhibited, but the webmaster can find
this information in the Mailman error logs.
——–

OR

——–
Internal Server Error
——–

Solution
————-
For quick fix : chmod 02775 -R /usr/local/cpanel/3rdparty/mailman/

Else try the following steps
——-
This error message can also be displayed due to wrong permissions of the files in /usr/local/cpanel/3rdparty/mailman/cgi-bin folder.

When error occurs the permission of the files in /usr/local/cpanel/3rdparty/mailman/cgi-bin will be as follows:

—————-
root@server [/usr/local/cpanel/3rdparty/mailman/cgi-bin]# ll
total 272
drwxrwsr-x 2 mailman mailman 4096 Feb 16 21:44 ./
drwxrwsr-x 23 mailman mailman 4096 Feb 18 13:51 ../
-rwxr-xr-x 1 mailman mailman 21100 Feb 16 21:44 admin*
-rwxr-xr-x 1 mailman mailman 21100 Feb 16 21:44 admindb*
-rwxr-xr-x 1 mailman mailman 21100 Feb 16 21:44 confirm*
———- 1 mailman mailman 21100 Feb 16 21:44 create
-rwxr-xr-x 1 mailman mailman 21100 Feb 16 21:44 edithtml*
-rwxr-xr-x 1 mailman mailman 21100 Feb 16 21:44 listinfo*
-rwxr-xr-x 1 mailman mailman 21100 Feb 16 21:44 options*
-rwxr-xr-x 1 mailman mailman 21100 Feb 16 21:44 private*
-rwxr-xr-x 1 mailman mailman 21100 Feb 16 21:44 rmlist*
-rwxr-xr-x 1 mailman mailman 21100 Feb 16 21:44 roster*
-rwxr-xr-x 1 mailman mailman 21100 Feb 16 21:44 subscribe*
—————-

But actually the permission should be as folows;

———————–
root@server [/usr/local/cpanel/3rdparty/mailman/cgi-bin]# ll
total 272
drwxrwsr-x 2 mailman mailman 4096 Feb 16 21:44 ./
drwxrwsr-x 23 mailman mailman 4096 Feb 18 13:51 ../
-rwxr-sr-x 1 mailman mailman 21100 Feb 16 21:44 admin*
-rwxr-sr-x 1 mailman mailman 21100 Feb 16 21:44 admindb*
-rwxr-sr-x 1 mailman mailman 21100 Feb 16 21:44 confirm*
———- 1 mailman mailman 21100 Feb 16 21:44 create
-rwxr-sr-x 1 mailman mailman 21100 Feb 16 21:44 edithtml*
-rwxr-sr-x 1 mailman mailman 21100 Feb 16 21:44 listinfo*
-rwxr-sr-x 1 mailman mailman 21100 Feb 16 21:44 options*
-rwxr-sr-x 1 mailman mailman 21100 Feb 16 21:44 private*
-rwxr-sr-x 1 mailman mailman 21100 Feb 16 21:44 rmlist*
-rwxr-sr-x 1 mailman mailman 21100 Feb 16 21:44 roster*
-rwxr-sr-x 1 mailman mailman 21100 Feb 16 21:44 subscribe*
———————–

So to correct this, change the permission of these files in ‘cgi-bin’ to 2755

++++++
2755 ==> -rwxr-sr-x
++++++

—————
root@server [/usr/local/cpanel/3rdparty/mailman/cgi-bin]# chmod 2755 *
—————

Also do further corrections if problem persists:

If the above error message is shown when accessing mailman in cPanel, please do the following to correct it.

==================================

1. Check in the directory /usr/local/cpanel/3rdparty/mailman/archives/private

In this directory, all the mailing lists will be directories. For the particular mailing list showing the above error while accessing , it won’t be a directory but a file like below.

—————–
root@server [/usr/local/cpanel/3rdparty/mailman/archives/private]# ll test_testdomain.com
-rwxrwxr-x 1 mailman mailman 0 Mar 3 2009 test_testdomain.com*
—————–

2. So first back it up

root@server [/usr/local/cpanel/3rdparty/mailman/archives/private]# mv test_testdomain.com test_testdomain.com.bak
root@server [/usr/local/cpanel/3rdparty/mailman/archives/private]# ll test_testdomain.com.bak
-rwxrwxr-x 1 mailman mailman 0 Mar 3 2009 test_testdomain.com.bak*

3. Then create the directory test_testdomain.com and list it.

root@server [/usr/local/cpanel/3rdparty/mailman/archives/private]# mkdir test_testdomain.com
root@server [/usr/local/cpanel/3rdparty/mailman/archives/private]# ll | grep test_testdomain.com
drwxr-sr-x 2 root mailman 4096 Jan 13 19:32 test_testdomain.com/
-rwxrwxr-x 1 mailman mailman 0 Mar 3 2009 test_testdomain.com.bak*
-rwxrwxr-x 1 mailman mailman 0 Feb 2 2009 test_testdomain.com.mbox*

4. Change the ownership to mailman

root@server [/usr/local/cpanel/3rdparty/mailman/archives/private]# chown mailman. test_testdomain.com
root@server [/usr/local/cpanel/3rdparty/mailman/archives/private]# ls -ld test_testdomain.com
drwxr-sr-x 2 mailman mailman 4096 Jan 13 19:32 test_testdomain.com

5. Then make the permission of test_testdomain.com to 02775

root@server [/usr/local/cpanel/3rdparty/mailman/archives/private]# chmod 02755 test_testdomain.com

6. Finally restart mailman

root@server [/usr/local/cpanel/3rdparty/mailman/archives/private]# /scripts/restartsrv_mailman
==================================

Additionally, on another occassion, I got bug error with mailman due to permission issue of “/dev/urandom” in server.

Noticed the following error from mailman log.

==========
admin(272671): OSError: [Errno 13] Permission denied: ‘/dev/urandom’
==========

Set its correct ‘666’, it will look like:

==========
# ll /dev/urandom
crw-rw-rw- 1 root root 1, 9 Apr 14 14:46 /dev/urandom
==========

All logs in cPanel

Check out all types of logs found on a cPanel server.

===================================
Access log & cpsrvd user activity  ————————-   /usr/local/cpanel/logs/access_log
Account transfers & related activity  ———————   /var/cpanel/logs
Account activity audit log  ———————————   /var/cpanel/accounting.log
Account bandwidth history  ——————————-   /var/cpanel/bandwidth , /var/cpanel/bandwidth.cache
Brute force protection (cphulkd) ————————–    /usr/local/cpanel/logs/cphulkd.log
Backup Logs  ————————————————–   /usr/local/cpanel/logs/cpbackup
cPanel installation log  ————————————–   /var/log/cpanel-install-*
cpsrvd error log  ———————————————   /usr/local/cpanel/logs/error_log
cpsrvd login activity —————————————-    /usr/local/cpanel/logs/login_log
cpsrvd panic log  ———————————————   /usr/local/cpanel/logs/panic_log
DNS server (named)  —————————————–   /var/log/messages
EasyApache build logs  ————————————–   /usr/local/cpanel/logs/easy/apache
FTP logins & misc.  ——————————————-   /var/log/messages
FTP transfer log  ———————————————-   /var/log/xferlog
Horde  ———————————————————-   /var/cpanel/horde/log
Mail (IMAP, POP3 logins, etc.) —————————–   /var/log/maillog
Mail delivery system (Exim)  ——————————-   /var/log/exim_mainlog , /var/log/exim_paniclog , /var/log/exim_rejectlog
Mailman logs ————————————————–   /usr/local/cpanel/3rdparty/mailman/logs
MySQL system ————————————————   /var/lib/mysql/<hostname>.err , /var/log/mysqld.log
Roundcube —————————————————-   /var/cpanel/roundcube/log
Server licensing ———————————————–  /usr/local/cpanel/logs/license_log
Service status (chkservd) logs ——————————  /var/log/chkservd.log
SSHD logs ——————————————————-  /var/log/messages
Squirrelmail  —————————————————  /var/cpanel/squirrelmail
suExec ———————————————————-  /usr/local/apache/logs/suexec_log
suPHP ———————————————————–  /usr/local/apache/logs/suphp_log
System resources (top N consumers)———————-   /var/log/dcpumon/<year>/<mo>/<day>
Tailwatch (tailwatchd)  —————————————  /usr/local/cpanel/logs/tailwatch_log
Update system (UPCP) logs ———————————-  /usr/cpanel/updatelogs/
Webdisk (cpdavd) system ————————————  /usr/local/cpanel/logs/cpdavd_error_log
Website statistics logs —————————————-   /usr/local/cpanel/logs/stats_log
Web server (Apache) access logs—————————-  /usr/local/apache/domlogs/<domain>
Web server (Apache) error log——————————- /usr/local/apache/logs/error_log

Some extra:

* /var/log/message: General message and system related stuff
* /var/log/auth.log: Authenication logs
* /var/log/kern.log: Kernel logs
* /var/log/cron.log: Crond logs (cron job)
* /var/log/maillog: Mail server logs
* /var/log/qmail/ : Qmail log directory (more files inside this directory)
* /var/log/httpd/: Apache access and error logs directory
* /var/log/lighttpd: Lighttpd access and error logs directory
* /var/log/boot.log : System boot log
* /var/log/secure: Authentication log
* /var/log/utmp or /var/log/wtmp : Login records file
* /var/log/yum.log: Yum log files