Tuesday, January 27, 2015

How to resolve failed to open session lockfile issue of C Panel?

If you are getting this issue wih CPanel:

failed to open session lockfile: FILE=/var/cpanel/sessions/raw/:Up5nKwLkFgQF_Ke_yEsgb_w9gMl2FzDSPpHdrus6DAOcD30Xt1tEgWy41BwsSQC5.lock, No such file or directory at /usr/local/cpanel/Cpanel/Session.pm line 261.

df -i  : to check the usage of inode space.

if it showing 100% used then

cd /var/spool

rm -rf exim :  to delete the exim file

Issue will resolved

Monday, September 1, 2014

mysql – Error in accept: Too many open files

One server is running both mysql and apache together,but the mysql get down every four hours.From PHP,it’s said ‘Error establshing a database connection’.From mysql error log,i got the some records like below:
’121029  2:47:38 [ERROR] Error in accept: Too many open files’
i know that mysql server has a config directive of open_files_limit which limit the number of file descripteors mysqld can use.so i need to check what the value in use for the current running mysqld server,from mysql client console,

You can also check the config with following command:


# netstat -atnp|grep 3306
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      5596/mysqld
 
# cat /proc/5596/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            10485760             unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             200704               200704               processes
Max open files            1185                 1185                 files
Max locked memory         32768                32768                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       200704               200704               signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0


so now we need to adjust mysql server configuration to make it feel comfortalbe.You decide the open_files_limit value by considering following factor:the databases amount, the max_connections and the table_cache value. You can also increase the number to a little higher you think is appropriate,then tune it by mysql server running status.


# vim /etc/my.cnf
[mysqld]
open_files_limit = 3000
 
save to quit and then restart msyql server
#/etc/init.d/mysqld restart


Saturday, August 30, 2014

The Most Common OpenSSL Commands

General OpenSSL Commands



These commands allow you to generate CSRs, Certificates, Private Keys and do other miscellaneous tasks.
  • Generate a new private key and Certificate Signing Request
    openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key
  • Generate a self-signed certificate (see How to Create and Install an Apache Self Signed Certificate for more info)
    openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout privateKey.key -out certificate.crt
  • Generate a certificate signing request (CSR) for an existing private key
    openssl req -out CSR.csr -key privateKey.key -new
  • Generate a certificate signing request based on an existing certificate
    openssl x509 -x509toreq -in certificate.crt -out CSR.csr -signkey privateKey.key
  • Remove a passphrase from a private key
    openssl rsa -in privateKey.pem -out newPrivateKey.pem

Checking Using OpenSSL

If you need to check the information within a Certificate, CSR or Private Key, use these commands. You can also check CSRs and check certificates using our online tools.
  • Check a Certificate Signing Request (CSR)
    openssl req -text -noout -verify -in CSR.csr
  • Check a private key
    openssl rsa -in privateKey.key -check
  • Check a certificate
    openssl x509 -in certificate.crt -text -noout
  • Check a PKCS#12 file (.pfx or .p12)
    openssl pkcs12 -info -in keyStore.p12

Debugging Using OpenSSL

If you are receiving an error that the private doesn't match the certificate or that a certificate that you installed to a site is not trusted, try one of these commands. If you are trying to verify that an SSL certificate is installed correctly, be sure to check out the SSL Checker.
  • Check an MD5 hash of the public key to ensure that it matches with what is in a CSR or private key
    openssl x509 -noout -modulus -in certificate.crt | openssl md5
    openssl rsa -noout -modulus -in privateKey.key | openssl md5
    openssl req -noout -modulus -in CSR.csr | openssl md5
  • Check an SSL connection. All the certificates (including Intermediates) should be displayed
    openssl s_client -connect www.paypal.com:443

Converting Using OpenSSL

These commands allow you to convert certificates and keys to different formats to make them compatible with specific types of servers or software. For example, you can convert a normal PEM file that would work with Apache to a PFX (PKCS#12) file and use it with Tomcat or IIS. Use our SSL Converter to convert certificates without messing with OpenSSL.
  • Convert a DER file (.crt .cer .der) to PEM
    openssl x509 -inform der -in certificate.cer -out certificate.pem
  • Convert a PEM file to DER
    openssl x509 -outform der -in certificate.pem -out certificate.der
  • Convert a PKCS#12 file (.pfx .p12) containing a private key and certificates to PEM
    openssl pkcs12 -in keyStore.pfx -out keyStore.pem -nodes
    You can add -nocerts to only output the private key or add -nokeys to only output the certificates.
  • Convert a PEM certificate file and a private key to PKCS#12 (.pfx .p12)
    openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt

Friday, May 23, 2014

XAMPP IS CURRENTLY ONLY AVAILABLY AS 32 BIT APPLICATION. PLEASE USE A 32 BIT COMPATIBILITY LIBRARY FOR YOUR SYSTEM

‘XAMPP IS CURRENTLY ONLY AVAILABLY AS 32 BIT APPLICATION. PLEASE USE A 32 BIT COMPATIBILITY LIBRARY FOR YOUR SYSTEM’


Xampp worked fine when i was using linux mint 12 . But when i upgraded to 64-bit system , i ended with problem.
The installation of xampp works fine with 64-bit system. But when you try to invoke xampp, it says
XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility library for your system.
and as usual i tried in google for this and came to know that i ve to do 2 things.
1. commenting out few portions in conf file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
vi /opt/lampp/lampp
# XAMPP is currently 32 bit only
#case `uname -m` in
#    *_64)
#    if /opt/lampp/bin/php -v > /dev/null 2>&1
#    then
#        :
#    else
#        $de && echo "XAMPP gibt es zur Zeit nur als 32-Bit Applikation. Bitte verwende eine 32-Bit Kompatibilitaetsbibliothek fuer Dein System."
#        $de || echo "XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility library for your system."
#        exit
#    fi
#    ;;
#esac
Write the file and quit
2.
1
sudo apt-get install ia32-libs
please dont do this in linux mint . its an 88 mb archive. after downloading 60 mb it got struck. not able to complete the process.
Instead go for
1
sudo apt-get install lib32stdc++6
which will work fine.
now start xampp
1
/opt/lampp/lampp start
it should work fine

Wednesday, April 2, 2014

How to turn off IPv6 router discovery? window 7 and linux

My recommendation for servers and workstations that do not need "Stateless Autoconfiguration" is to turn off Router Discovery. You can turn of Router Discovery using netsh. For example, if you want to turn off Router Discovery on Local Area Connection you can type in the following statement from elevated command prompt:

netsh int ipv6 set int "Local Area Connection" routerdiscovery=disabled

To check other interface parameters including Router Discovery type in:

netsh int ipv6 show int "Local Area Connection"

And you'll have to receive something like this:


Friday, February 14, 2014

MySQL is not starting. Operating system error number 2 in a file operation

Here is the error log.

2013-11-18 21:25:25 a171e1a8  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: Error: could not open single-table tablespace file ./testdb/dr_actions.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.

Step 1. Open mysql configuration file, mine is /opt/lampp/etc/my.cnf

Step 2. In [mysqld] section, add the following line:
innodb_force_recovery = 1

Step 3. Save the file and try starting MySQL

Step 4. Remove that line which you just added and Save. 

Wednesday, February 5, 2014

Move Window Control Buttons to the Right Ubuntu 12.04

For Ubuntu 12.04

1.  In the Terminal, enter this code sudo apt-get install gconf-editor to install Configuration Editor if it's not in your system.

2.  Press Alt-F2, then type gconf-editor into the box, and press Enter to run it.

3.  Browse to apps > metacity > general, look for "button_layout" on the right panel.

4.  Change the value in the "button_layout" from close,minimize,maximize: to :minimize,maximize,close   and press the Enter key.


The above works for all control buttons on non-maximized windows. When a window is maximized, the control buttons are however fixed to the left of the Global Menu.


Note: If dconf-editor is not available, you can install it by running sudo apt-get install dconf-tools in the Terminal.