Monday, July 12, 2010

How to Install confluence wiki on linux server(64 bit) + mysql database configuration error

Guys,

I have referred following URL to install the confluence wiki on linux(64 bit).

=====
http://confluence.atlassian.com/display/DOC/Installing+Confluence+Standalone+on+UNIX+or+Linux
=====

Regarding the DB setting you can refer the following URL :

====
http://confluence.atlassian.com/display/DOC/Database+Setup+For+MySQL

NB: You need to create one db user and db password. Just give grant privileges to the "confluence" db or customized DB that you had manually created.

====
http://confluence.atlassian.com/display/DOC/Configuring+a+MySQL+Datasource+in+Apache+Tomcat
====

Here are the error messages that I had received during configuring the DB at the browser.

====
* Configuring the database failed. Couldn't create the database schema.
* com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
Could not create connection to database server. Attempted reconnect 3 times.
Giving up
====

Sol : 1. The error is basically happened for mismatching of DB engine.
2. checked the DB engine at the backend like mysql# show variable like "%engine%";
3. Now you'll see the URL to connect the DB via jdbc driver like :
jdbc:mysql://localhost/confluenceuser?autoReconnect=true&sessionVariables=storage_engine%3DInnoDB

4. For my case DB engine was MyIsAm at mysql.
5. I setup the following URL :
jdbc:mysql://localhost/confluenceuser?autoReconnect=true&sessionVariables=storage_engine%3DMyIsAm
6. Then I proceeded further and I had successfully installed the software.

Try :)

Sunday, July 4, 2010

How to repair a corrupt MBR on linux machine?

Here are the steps:

========
1. Incert CD and boot from cd(you have to change the option at BIOS).
2. boot: linux rescue //command while boot prompt comes
3. chroot /mnt/sysimage //command
4. grub-install /dev/hda //command
5. reboot the machine.
========

That's it. try :)

How to take backup/restore of MBR with dd command?

The MBR is located in the first 512 bytes of the disk (the first sector).

Size (bytes) Description
446 Executable code section
4 Optional Disk signature
2 Usually nulls
64 Partition table
2 MBR signature

1. backup : execute following command

dd if=/dev/hda of=/mbrbackup.bin bs=512 count=1

2. Restore :

dd if=/mbrbackup.bin of=/dev/hda bs=512 count=1

Try it now :)

Saturday, July 3, 2010

How to check mysql slow queries or which queries are consuming cpu resources?

1. vi /etc/my.cnf and add following entries after mysqld.
[mysqld]
set-variable=long_query_time=1
log-slow-queries=/var/log/mysql/log-slow-queries.log

2. Perform following steps:
mkdir /var/log/mysql
touch /var/log/mysql/log-slow-queries.log
chown mysql.mysql -R /var/log/mysql
3. Restart mysql. /etc/init.d/mysqld restart
4. Now you can use mysqlsla tool to check the slow queries. Here are the steps.
cd /usr/src
wget http://hackmysql.com/scripts/mysqlsla-2.03.tar.gz
tar -xvzf mysqlsla-2.03.tar.gz
cd mysqlsla-2.03/bin
5. Execute following command :
./mysqlsla -lt slow --sort t_sum --top 5 /var/log/mysql/mysqld.slow

Now you'll able to see the results :) Contact developer to optimize the code.
optimize command is used to optimize the table. Here it is:
mysql>optimize table table_name;

check whether slow log has enabled or not.

mysql> SHOW VARIABLES like "%slow%"; //if not
mysql> SET @log_slow_queries=1;

Again restart mysql and use above tool after few minutes to check log.

Try :)

Wednesday, June 23, 2010

Cpanel / WHM /FTP/E-mail are showing incorrect or zero disk usage?

Hi Guys,

If you get such type of problems, please refer the following steps to resolve the issue. The reason is that I have followed it and fixed it.

====
1. Execute following scripts on the server.
root@venice [/]# /scripts/initquotas; /scripts/resetquotas; /scripts/fixquotas

2. If the issue is still there then check whether "usrquota" option has enabled or not for home directory(/etc/fstab). Please enable it. Also check the rw option of the home directory where user's home directory is there. I did following things.

====
root@venice [/]# cat /etc/fstab | grep home
LABEL=/home /home ext3 defaults 1 2
root@venice [/]#
root@venice [/]# mount -o remount,rw, usrquota /home
root@venice [/]# cat /etc/fstab | grep home
LABEL=/home /home ext3 defaults,rw,usrquota 1 2
root@venice [/]#
====

3. Make sure those options has also enabled in /etc/mtab.

===
root@venice [/]# cat /etc/mtab | grep home|column -t
/dev/sda8 /home ext3 rw,usrquota 0 0
root@venice [/]
===

Then I refreshed the WHM. It was displaying the correct disk usages.

TC.. :)

Friday, June 11, 2010

How to scan the ports on the machine?

1. Verifying Which Ports are Listening :
nmap -sT -O localhost/remote host/subnet

2. Check the port http of your local network :
nmap -v -p 80 192.168.1.*

3. ping scan :-
nmap -v -sP 192.168.2.0/24 or nmap -sP 192.168.2.*

4. UDP scan :-
nmap -v -sU 192.168.2.0/24

5. O.S Detection scan :-
nmap -O --vv 192.168.2.0/24

6. To check which protocol is supported by the remote machine :-
nmap –sO hostname

Sunday, June 6, 2010

Why is horde or webmail showing blank page ?

Issue : Horde is showing blank page while someone is accessing the webmail interface.
Solution :

I got this issue when one customer had notified it. It usually happens if path of the horde libray is not defined in the /etc/httpd/conf.d/zz010_psa_httpd.conf file. So,
a)edit the /etc/httpd/conf.d/zz010_psa_httpd.conf file
b) Find the directive "Include".
Example :

Before :
---------------
php_admin_value
include_path "/usr/share/psa-horde:/usr/share/psa-horde/pear:."
---------------

After (Correct) :

----------
php_admin_value
include_path "/usr/share/psa-horde/lib:/usr/share/psa-horde:/usr/share/psa-horde/pear:."
----------

c)Then restart the httpd service. That's it.