To Gain Knowledge and to become a one, who all wants to become

Dreams are not those which are seen during sleep ,but Dreams are those which do not let you sleep,so see the dreams
and work hard to make them true.

Monday, December 31, 2012

Getting your Gmail Emails (using pop/imap) in linux box using fetchmail :

1. Get the SSL Certificate for connecting to Gmail POP3-over-SSL (pop3s) :

    # cd /usr/share/ssl/certs
    # chmod 644 Equifax_Secure_Certificate_Authority.pem
    # openssl x509 -in Equifax_Secure_Certificate_Authority.pem -fingerprint -subject -issuer -serial -hash -noout
    # c_rehash . (c_rehash command will be available with openssl-perl package)
    # file 594f1775.* (the name of linked file)

2. Create a .fetchmailrc file in user's home directory and write the following lines :

    poll with proto POP3
    user '' there with password 'password' is username here
    options keep ssl sslfingerprint 'FF:69:18:0D:75:8C:17:61:F5:EF:FC:F9:85:7D:F5:0E' (this fingerprint will be shown by using fetchmail -v)
    sslcertpath /usr/share/ssl/certs

3. fetchmail -d 600 (The fetchmail utility can be run in daemon mode by running it with the -d flag, followed by the interval in seconds that fetchmail should 
    poll servers listed in the .fetchmailrc file.)

4. You can now check your gmail emails in local users mailbox by using mail user agents like mail,mutt,alpine,etc.

Tuesday, September 11, 2012

NGNIX on Cpanel

Install Nginx on cPanel

The bright people over at have come up with a wonderful little tool for working with Nginx. It integrates a admin panel into WHM so you can stop and restart Nginx, recreate the vhost config, view the Nginx Logs and check apache.

Also it autoconfigures WHM and Apache for use with Nginx by changing apache from listening on port 80 to port 8081.

For those who don't know what Nginx is its a caching proxy that will cache static content such as images and html files and serves them up without having to access Apache for the content thus improving speed, memory usage and processor overhead. All dynamic content such as php, java and video are proxied to Apache for processing.

So if you have a site that is slow you might benefit from Nginx serving up all the static content and only using Apache to process the php files..

Nginx Admin (Stable version) v3.2 for Cpanel Version 11.30 or above

Install Instructions:

#cd /usr/local/src
#tar xf nginxadmin.tar
#cd publicnginx
#./nginxinstaller install

If you receive any pyaml related error or the following error :

Welcome to the Nginx Admin installer……Starting Install
Generating vhosts…
Traceback (most recent call last):
File "/scripts/", line 2, in ?
import yaml
File "/usr/lib/python2.4/site-packages/PyYAML-3.10-py2.4-linux-i686.egg/yaml/", line 26
SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause
Installing WHM interface…
deploying booster rockets
Traceback (most recent call last):
File "/usr/local/src/publicnginx/nginxinstaller2″, line 9, in ?
import createvhosts
File "/usr/local/src/publicnginx/", line 2, in ?
import yaml
File "/usr/lib/python2.4/site-packages/PyYAML-3.10-py2.4-linux-i686.egg/yaml/", line 26
SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause

Then run execute following commands ….
For i686 architecture :-

# easy_install Pyyaml==3.09
# rm -f /usr/lib/python2.4/site-packages/PyYAML-3.10-py2.4-linux-i686.egg

For x86_64 architecture :-

# easy_install Pyyaml==3.09
# rm -f /usr/lib/python2.4/site-packages/PyYAML-3.10-py2.4-linux-x86_64.egg

Then Again run the following commands :-

# ./nginxinstaller install
# /etc/init.d/httpd restart

Now Nginx run on the port no:80 and apache run on the port no.8081.You can manage the nginx through WHM >> Main >> Nginx Admin

To uninstall nginx use following :-

#  cd /usr/local/src
#  wget
#  tar xf nginxadmin2.8-stable.tar
#  cd publicnginx
#  ./nginxinstaller uninstall