Issue with installing the mysql gem: solved, how to install mysql gem without issue

When tried to install mysql gem I got following error
[root@localhost siwan]# sudo gem install mysql
Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
checking for mysql_ssl_set()… yes
checking for rb_str_set_len()… no
checking for rb_thread_start_timer()… yes
checking for mysql.h… no
checking for mysql/mysql.h… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
–with-opt-dir
–without-opt-dir
–with-opt-include
–without-opt-include=${opt-dir}/include
–with-opt-lib
–without-opt-lib=${opt-dir}/lib
–with-make-prog
–without-make-prog
–srcdir=.
–curdir
–ruby=/usr/bin/ruby
–with-mysql-config
–without-mysql-config

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

To find the mysql path on machine used following command
[root@localhost siwan]# which mysql
/usr/bin/mysql

I tried following command:
[root@localhost siwan]# sudo gem install mysql — –with-mysql-dir=/usr/bin/mysql

I Got the same error

[root@localhost siwan]# sudo gem install mysql — –with-mysql-dir=/usr/bin/mysql
Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
checking for mysql_ssl_set()… yes
checking for rb_str_set_len()… no
checking for rb_thread_start_timer()… yes
checking for mysql.h… no
checking for mysql/mysql.h… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
–with-opt-dir
–without-opt-dir
–with-opt-include
–without-opt-include=${opt-dir}/include
–with-opt-lib
–without-opt-lib=${opt-dir}/lib
–with-make-prog
–without-make-prog
–srcdir=.
–curdir
–ruby=/usr/bin/ruby
–with-mysql-config
–without-mysql-config

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
ERROR: could not find gem — locally or in a repository
ERROR: could not find gem –with-mysql-dir=/usr/bin/mysql locally or in a repository

Then I checked the mysql-devel
[root@localhost siwan]# yum list mysql-devel
Loaded plugins: refresh-packagekit
Available Packages
mysql-devel.i586 5.1.37-1.fc11 updates

Then I Installed the mysql-devel
[root@localhost siwan]# yum install mysql-devel
Installed:
mysql-devel.i586 0:5.1.37-1.fc11
Complete!

Then I tried the mysql Gem installing…..I am able to install the mysql gem…
[root@localhost siwan]# gem install mysql
Building native extensions. This could take a while…
Successfully installed mysql-2.8.1
1 gem installed
Installing ri documentation for mysql-2.8.1…
Installing RDoc documentation for mysql-2.8.1…
[root@localhost siwan]#

Install mp3 player and vlc player on Fedora

Play mp3 songs in fedora linux
I am using the Fedora 11 and on that I am going to install the Fluendo MP3 plugin

Install mp3 player and vlc player on Fedora

If you want to install the Fluendo MP3 plugin on Fedora 8, 9, 10 or 11
Use same steps;

Download fluendo-codecs-mp3-7-1.i386.rpm file from here:

fluendo-codecs-mp3

Use following command:
[root@localhost siwan]# rpm -i fluendo-codecs-mp3-7-1.i386.rpm

How to install the Vlc player on Fedora 8, 9, 10 or 11
root@localhost siwan]#  su
[root@localhost siwan]#  rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
[root@localhost siwan]# yum install vlc
[root@localhost siwan]# yum install mozilla-vlc (optionnal)

Install Mysql cluster on Fedora box

Each MySQL Cluster host computer running an SQL node must have installed on it a MySQL. For management nodes and data nodes,
it is not necessary to install the MySQL server binary,
but management nodes require the management server daemon (ndb_mgmd) and data nodes require the data node daemon (ndbd).

It is also a good idea to install the management client (ndb_mgm) on the management server host.
This section covers the steps necessary to install the correct binaries for each type of Cluster node.

Important Note:
If you have mysql installed already than remove that from computer using following command
[root@localhost siwan]# yum remove mysql mysql-server mysql-libs mysql-common

Open http://dev.mysql.com/downloads/
click on * MySQL Cluster url:
http://dev.mysql.com/downloads/select.php?id=14
Scoll down,
Under “Current Realeases” section
You will see the following text;
MySQL Cluster 7.0.8a GA
Select the Red Hat Enterprise Linux here and download following packages.

Select Operating System: Red Hat Enterprise Linux
As per linux edition(4 and 5) and computer and Os comptable(64bit or 32bit download the RPMs
I am using the Fedora 11 as OS and 32bit Intel machine.
I used or downloaded following RPM files from above URL:
MySQL-Cluster-gpl-debuginfo-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-embedded-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-server-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-7.0.8a-0.rhel5.src.rpm
MySQL-Cluster-gpl-7.0.8a-0.sles11.src.rpm
MySQL-Cluster-gpl-devel-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-tools-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-test-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-client-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-extra-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-storage-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-shared-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-management-7.0.8a-0.rhel5.i386.rpm

SQL node installation — RPM files. On each machine to be used for hosting a cluster SQL node, install the Server RPM by executing the following command as the system root user, replacing the name shown for the RPM as necessary to match the name of the RPM downloaded from the MySQL web site:

How to repeat:
Make sure you have nothing in /var/lib/mysql and /var/lock/subsys/mysql.
The do :
rpm -i MySQL-client-5.1.25-0.glibc23.x86_64.rpm MySQL-server-5.1.25-0.glibc23.x86_64.rpm

[root@localhost MysqlClusterSoft]# rpm -iv MySQL-Cluster-gpl-*

Forcely install the above rpms again, for that use following command.
[root@localhost MysqlClusterSoft]# rpm -ivh –force MySQL-Cluster-gpl-server-7.0.8a-0.rhel5.i386.rpm

Following command you can use for uninstall the Mysql cluster.
[root@localhost MysqlClusterSoft]# rpm -e -F MySQL-Cluster-gpl-*

[root@localhost MysqlClusterSoft]# yum install mysql mysql-server

[root@localhost MysqlClusterSoft]# rpm -Uhv MySQL-Cluster-gpl-server-7.0.8a-0.rhel5.i386.rpm
Preparing… ########################################### [100%]
1:MySQL-Cluster-gpl-serve########################################### [100%]
091113 17:05:13 [Warning] Forcing shutdown of 3 plugins
091113 17:05:13 [Warning] Forcing shutdown of 3 plugins

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h localhost.localdomain password ‘new-password’

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available at http://www.mysql.com/
Support MySQL by buying support/licenses from http://shop.mysql.com/

[root@localhost MysqlClusterSoft]#

[root@localhost MysqlClusterSoft]# rpm -Uhv MySQL-Cluster-gpl-client-7.0.8a-0.rhel5.i386.rpm
Preparing… ########################################### [100%]
package MySQL-Cluster-gpl-client-7.0.8a-0.rhel5.i386 is already installed

After all installtion Please reboot the machine. and Run the nbdb server and load the sample data.
Use following article…
http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-multi-load-data-queries.html

Force remove the rpm from linux box

I installed the Mysql-cluster on fedora11 box.
When I tried the wordpress local setup on by box I got following error.
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”

I used the noraml command for uninstalling the rpm package.
#rpm -e PACKAGE_NAME
I tried so many things but failed. Nothing is removed. Then I tried this command. I still got following result.

#yum list Mysql*.*
Installed Packages
MySQL-Cluster-gpl-debuginfo.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-extra.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-management.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-server.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-shared.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-storage.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-tools.i386

I tried the following commands…
#yum remove MySQL-Cluster-gpl-shared
This really worked…Yes this is final solution.

[root@localhost siwan]# yum install mysql mysql-server php-mysql mysql-common mysql-libs

[root@localhost siwan]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name, using localhost.localdomain for ServerName

This will solved your problem. Following links I found usefull:

http://www.rikers.org/rpmbook/node18.html
http://www.rikers.org/rpmbook/node20.html
http://www.rikers.org/rpmbook/node19.html

solved – bash: phpize: command not found

This error is due to “phpize” command not available on your server.

To fix, install php-devel package.

If your server have yum (Eg: Fedora)

[root@localhost siwan]# phpize
bash: phpize: command not found
[root@localhost siwan]# yum -y install php-devel

[root@localhost siwan]# phpize
Cannot find config.m4.
Make sure that you run ‘/usr/bin/phpize’ in the top level source directory of the module

[root@localhost siwan]#
How to install the eaccelerator on fedora9?
use follwoing command

[root@localhost siwan]# yum install php-eaccelerator

How to install and setup varnish on fedora9

Varnish is an HTTP accelerator designed for content-heavy dynamic web sites. In contrast to other HTTP accelerators, many of which began life as client-side proxies or origin servers, Varnish was designed from the ground up as an HTTP accelerator.

Use following command:
[root@localhost siwan]# su
[root@localhost siwan]# yum install varnish
ncurses are needed for textual “graphical” configuration.
[root@localhost siwan]# yum install ncurses-devel

Edit the setting of varnish
[root@localhost siwan]# vim /etc/varnish/default.vcl

Start the varnish.
[root@localhost varnish]# /etc/init.d/varnish start

on startup set varnish on
[root@localhost varnish]# /sbin/chkconfig varnish on

Software for making diagram or flowchart in fedora

Aftter doning some R&D I found some flowchart and open source graphics softwares.
I installed on my Fedora9. Gimp is like photoshop but I do not find that as good as Photoshop.

1. inkscape
Features: An Open Source vector graphics editor, with capabilities similar to Illustrator, CorelDraw,
or Xara X, using the W3C standard Scalable Vector Graphics (SVG) file format.
Installation command
[root@localhost siwan]# yum install inkscape
Site Url: http://www.inkscape.org/index.php

2. Dia
Features:Dia is a program for creating diagrams of all kinds. It can create many types of diagrams, including UML, network and flowchart diagrams. The engine is very flexible and dynamically loads diagram-types from disk. Dia can also print diagrams and export tham to a number pf formats including EPS, SVG, and PNG
Installation command
[root@localhost siwan]# yum install dia
Site Url:http://live.gnome.org/Dia

How to use hosts file on Mac, Windows and Linux

The hosts file is a computer file used by an operating system to map hostnames to IP addresses.
On many operating systems, the host file content is used preferentially over other methods,
such as the Domain Name System (DNS). Unlike DNS, the hosts file is under the control of the local computer’s administrator

Locate the file “Hosts” on your computer:
Windows
Windows 95/98/Me c:\windows\hosts
Windows NT/2000/XP Pro c:\winnt\system32\drivers\etc\hosts
Windows XP Home c:\windows\system32\drivers\etc\hosts

Linux
/etc/hosts or /etc/host.conf or /etc/nsswitch.conf

Symbian
C:\system\data\hosts

Mac OS
/private/etc/hosts or /etc/hosts

In that file you can edit entry like this

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost localhost yourlocaldomain.com , example.com
::1 localhost6.localdomain6 localhost6
192.168.2.200 intranet

directory.example.com 71.155.186.91

How to setup mongrel cluster setup on fedora

First install the following gems:
#su
#gem install mongrel
#gem install mongrel_cluster
#cd project_name
#mongrel_rails cluster::configure -e production -p 3000 -N 3 -c /home/siwan/project_name -a 127.0.0.1 —-prefix /project_name
# mongrel_rails cluster::start

You are able to start your applicaton at http://127.0.0.1:3000, http://127.0.0.1:3001 and http://127.0.0.1:3002

for all the cluster
# mongrel_rails cluster::stop

Advanced prepairation for production realeaze
$ mkdir /etc/mongrel_cluster

#vim /etc/mongrel_cluster/project_name.yml
copy and paste following text;
user: project_name
cwd: //home/siwan/project_name
log_file: /home/siwan/project_name/mongrel.log
port: “3000”
environment: production
group: dev
address: localhost
pid_file: /home/siwan/project_name/tmp/pids/mongrel.pid
servers: 3

or you can run the following command

or copy and paste the content from config/mongrel_cluster.yml file to /etc/mongrel_cluster/project_name.yml

# ln -s /home/siwan/project_name/config/mongrel_cluster.yml /etc/mongrel_cluster/project_name.yml

Then open your httpd.conf file for apache configration:

<Proxy balancer://project_name>
BalancerMember http://127.0.0.1:3000
BalancerMember http://127.0.0.1:3001
BalancerMember http://127.0.0.1:3002
</Proxy>

<VirtualHost *:80>
ProxyPreserveHost On
# Avoid open you server to proxying
ProxyRequests Off
# Options +FollowSymLinks
RewriteEngine On

RewriteRule ^/(images|stylesheet|javascript|html)/?(.*) /home/siwan/project_name/public/$0 [L]
ServerAdmin siwan@yahoo.co.in
DocumentRoot /home/project_name/
ServerName example.com
RewriteRule  ^/(.*)$  balancer://project_name%{REQUEST_URI} [P,QSA,L]
</VirtualHost>

Restart the apache server
#/etc/init.d/httpd restart

Command for restart the mongrel servers from any where
# mongrel_rails cluster::restart -C /etc/mongrel_cluster/project_name.yml