Archive for August, 2012

1) Stop the mysql services.

[root@localhost ~]# /etc/init.d/mysqld stop

2) Now start the mysql services in safe mode as follows.

[root@localhost ~]# mysqld_safe –skip-grant-tables & 

Note: Use hyphen(-) twice before skip….

120827 17:28:31 mysqld_safe Logging to ‘/var/log/mysqld.log’.
120827 17:28:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

When you find above 2 lines after you issued the command, then hit enter

That comes to commandline

[root@localhost ~]#

Now lon on to mysql with root user

[root@localhost ~]# mysql -u root

mysql> 

mysql> show databases;

Use mysql database to reset the password.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

Now issue the following query in order to reset the password

mysql> update user set password=PASSWORD(“newpassword”) where User=’root’;
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0

Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

Then quit from mysql and stop and start the mysql services.

[root@localhost ~]# /etc/init.d/mysqld stop
Stopping mysqld: [ OK ]
[root@localhost ~]# /etc/init.d/mysqld start
Starting mysqld: [ OK ]

Now log on to mysql with root user…

[root@localhost ~]# mysql -u root -p
Enter password:

Enter your new password….Then it will log on to mysql.

That’s all about reset the root password if you lost…

Google chrome installation Process:

You need to create a file named google-chrome.repo in the path /etc/yum.repos.d/

For 32bit: Add the following lines to the file  google-chrome.repo

name=google-chrome – 32-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pubowing lines to the file (google-chrome.repo)

For 64bit:

Add the following lines to the file  google-chrome.repo

[google-chrome]
name=google-chrome – 64-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

To install issue the following command…

[root@localhost ~]# yum install google-chrome-betayum install google-chrome-beta

When the installation finished it shows

installed: google-chrome-beta.x86_64 0:22.0.1229.14-152690,

That’s all. Now you can check it in Application>Internet for google chrome…

Sometimes when we are giving privileges to one user in Mysql it throughs error as follows…

mysql> flush privileges;
ERROR 1146 (42S02): Table ‘mysql.servers’ doesn’t exist

It can be rectified by creating a table with name mysql.servers. No need to insert any data into it. It Just an empty table.

So the table you should create is…..

    1. Note: Use mysql databse before going to create this empty table

mysql>use mysql;

Database changed

mysql>CREATE TABLE `servers` ( `Server_name` char(64) NOT NULL,

                                           `Host` char(64) NOT NULL,

                                          `Db` char(64) NOT NULL,

                                            `Username` char(64) NOT NULL,

                                            `Password` char(64) NOT NULL,

                                             `Port` int(4) DEFAULT NULL,

                                             `Socket` char(64) DEFAULT NULL,

                                             `Wrapper` char(64) NOT NULL,

                                               `Owner` char(64) NOT NULL,

                                                 PRIMARY KEY (`Server_name`) )

 ENGINE=MyISAM

DEFAULT CHARSET=utf8

COMMENT=’MySQL Foreign Servers table’;

Query OK, 0 rows affected (0.06 sec)

Now try flush privileges definitely it works….

Backup the database:…..

To take the backup first log on to mysql to make sure the database name that needs to be backup….
[root@prac ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.5.27 MySQL Community Server (GPL) by Atomicorp

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>
mysql> show databases;
+——————–+
| Database           |
+——————–+
| information_schema |
| mysql              |
| rajesh_wp          |
| test               |
| vtigercrm          |
+——————–+
5 rows in set (0.00 sec)

Now I have the list of database and from that I wanna take the backup of rajesh_wp database.

Now exit from mysql.
mysql> exit
Bye
[root@prac ~]#

[root@prac ~]# mysqldump -u root -p rajesh_wp > /root/d01/rajesh_wp_bkp.sql

It prompts for the password. Enter your password for mysql. Then simply prompts to next line if the database successfully got the backup as follows….

I have given the file as rajesh_wp_bkp.sql. Its up to you. File name and extension are don’t matter. But I have given extension as sql to identfy the file as a database file easily.

[root@prac ~]# mysqldump -u root -p rajesh_wp > /root/d01/rajesh_wp_bkp.sql
Enter password:
[root@prac ~]#

Now you can check the .sql file whether the database has been got the backup or not.

The startup lines of the backup file should be as follows

MySQL dump 10.13  Distrib 5.5.27, for Linux (i686)

— Host: localhost    Database: rajesh_wp
— ——————————————————
— Server version       5.5.27

You will find the database name which has been taken the backup.

This backup file can be used in case of database failure or dropped.

Restore the database:……..

To restore the database issue the following command…

[root@prac ~]# mysql -u root -p rajesh_wp < /root/d01/rajesh_wp_bkp.sql

If the restore has been completed successfully then it prompts for the next line as follows…
[root@prac ~]# mysql -u root -p rajesh_wp < /root/d01/rajesh_wp_bkp.sql
Enter password:
[root@prac ~]#
You can log on to mysql and check for the database which has been restored…

That’s all about backup and restore of mysql database.

This is installation has been done in centos 32bit machine and applicable the same procedure for all Linux with centos machines…

Command to check the machine OS and version:……
[root@prac ~]# cat /etc/issue
CentOS release 5.8 (Final)
Kernel \r on an \m

Command to check the machine type whether it is 32 or 64bit:….
[root@prac ~]# getconf LONG_BIT
32

Note: My machine is centos 5.8 with 32bit

So the next steps can be followed for centos 32bit

Download the Electro server rpm file from the following url:……. http://www.electrotank.com/downloads/5_3_3/ElectroServer_5_3_3_32bit_Linux_ServerOnly.rpm

Now i am going to download the rpm directly through command line interface as we know terminal

[root@prac ~]# wget http://www.electrotank.com/downloads/5_3_3/ElectroServer_5_3_3_32bit_Linux_ServerOnly.rpm

Now you can check the rpm by:……..

[root@prac ~]#ls                                                                                                                                                                       ElectroServer_5_3_3_32bit_Linux_ServerOnly.rpm

To install the rpm:……………….                                                                                                                                                                                                                 [root@prac ~]#rpm -ivh ElectroServer_5_3_3_32bit_Linux_ServerOnly.rpm

[root@prac ~]# ls
ElectroServer_5_3_3       ——–This is the directory where Electro Server has been installed…..

To start the ElectroServer follow the commands:………..

[root@prac ElectroServer5.3.3]# cd ElectroServer_5_3_3                                                                                                                                                                         [root@prac ElectroServer5.3.3]# ll

total 92

drwxr-xr-x 3 root root 4096 Aug 22 18:56 admin
-rwxr-xr-x 1 root root 10598 Aug 22 18:56 DbUtility
-rwxr-xr-x 1 root root 13158 Aug 22 18:56 ElectroServer_5_3_3_Service
drwxr-xr-x 4 root root 4096 Aug 22 18:56 jre
-rw-r–r– 1 root root 28008 Aug 22 18:56 LICENSE.txt
drwxr-xr-x 11 root root 4096 Aug 23 17:05 server
-rwxr-xr-x 1 root root 10528 Aug 22 18:56 Start_ElectroServer_5_3_3
-rwxr-xr-x 1 root root 10498 Aug 22 18:56 Start_ElectroServer_5_3_3_SAFEMODE

To start electroserver:……….

[root@prac ElectroServer5.3.3]# ./Start_ElectroServer_5_3_3
17:12:49,246 [main] INFO DisplayLogger –
_____ _ _ ____
| ____| | ___ ___| |_ _ __ ___ ___ ___ _ ____ _____ _ __ | ___|
| _| | |/ _ \/ __| __| ‘__/ _ \/ __|/ _ \ ‘__\ \ / / _ \ ‘__| |___ \
| |___| | __/ (__| |_| | | (_) \__ \ __/ | \ V / __/ | ___) |
|_____|_|\___|\___|\__|_| \___/|___/\___|_| \_/ \___|_| |____/

Starting ElectroServer 5.3.3
Go to http://www.electrotank.com/ for the latest version.
###########################################################
Computer Information
Operating System: Linux
Operating System Architecture: i386
Processors Available: 2
Memory Available: 787Mb
###########################################################
Virtual Machine Information
Virtual Machine Vendor: Sun Microsystems Inc.
Virtual Machine Version: 1.6.0_25

[root@prac ElectroServer5.3.3]#

If it successfully started then command line interface prompts to next line as above……

That’s all. Electroserver has been started…….

Now to look up the admin page in browser, move this folder to /var/www/html/ (where apache index file is located)

Now restart the apache server:…..

[root@prac ElectroServer5.3.3]# /etc/init.d/httpd restart                                                                                                                                                                   Stopping httpd: [ OK ]                                                                                                                                                                                                                                  Starting httpd: [ OK ]

Then enter the following url in browser…
http://loaclhost/ElectroServer5.3.3/admin/webadmin/webadmin.html….

You must give your machine IP instead of localhost….

That’s all about Electroserver….

VtigerCRM installation

It is one kind of customer relationship management(CRM) tool…

Before going to start vtiger crm installation make sure apache,mysql and php are installed already.

Note:

1) php version must be 5.2 or more. Cause vtigercrm doesn’t support lesser version. It starts the process of vtiger installation eventhough php version is lesser than 5.2 but it gives an error and process doesn’t go further….

2) Some dependencies will be asked as the process go on but better to install it before….

The dependecncies can be installed as follows….

[root@prac html]# yum install gd gd-devel php-gd

[root@prac html]# yum install php-imap

Then……..

Download source file from

https://www.vtiger.com/crm/open-source-downloads/

Choose source download only not the bin file…

Move the tar file to /var/www/html (which navigates the apache home page) and extract it. To extract follow the command….

[root@prac html]# tar -xvzf vtigercrm-5.4.0.tar.gz

Then you find vtigercrm directory after extracting it.

Then change ownership to root and give full permissions as well.

[root@prac html]# chmod -R 777 vtigercrm

[root@prac html]# chown -R root:root vtigercrm

Then we need to make some changes to php.ini (vi /etc/php.ini)

[root@prac html]# vi /etc/php.ini

The following elements should be changed to php.ini file

allow_call_time_pass_reference on
error_reporting E_WARNING & ~E_NOTICE
safe_mode off
display_errors on
file_uploads on
max_execution_time 600
memory_limit 64M
log_errors off
output_buffering on
register_globals off
short_open_tag on

Then we need to configure database utf-8 configuration for mysql.

If you have not created database then follow the query given below.

mysql>create database dabasename default character set utf8 default collate utf8_general_ci;

If you have already created the database then follow the query given below.

mysql> alter database databasename default character set utf8 default collate ut8_general_ci;

Note: Creating a database is optional. Vtigercrm creates database while installation if you select the option create database in installation wizard…But database creation is recommended

To create the database

logon to mysql with root

[root@prac ~]# mysql -u root -p

It prompts for password then enter the password…

mysql> create database vtigercrm;

mysql> use vtigercrm;

mysql>grant all on vtigercrm.* to ‘root’@’localhost’ identified by ‘leo$123’;

mysql> flush privileges;

Then quit from mysql and restart apache services

[root@prac ~]# /etc/init.d/httpd restart

Then open browser and type url

http:localhost/vtigercrm

Give your system ip, localhost instead…

Then vtigercrm installation wizard will be opened…

Go on the installation wizard, vtigercrm will be installed successfully…