Wednesday, September 17, 2008

Creating Local rpm Repository for yum update.

1) Install the createrepo rpm from installation media

#rpm -ivh createrepo-.rpm

2) Dumping all the rpm file from the installation media

#cp -av

3) Then create the repo with the below command

#createrepo

4) Now create a .repo file in "/etc/yum.repo.d/" folder as below.

#vi /etc/yum.repos.d/local.repo
[Local]
name=local repo
failovermethod=priority
baseurl=file:///var/repo
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
enabled=1
gpgcheck=0
gpgkey=

5) Now for chaking run the command as

#yum list

Now creating Group of the rpm files

#createrepo -g
E.G. createrepo -g /media/Fedora\ 8\ i386\ DVD/repodata/Fedora-8-comps.xml /var/repo/ (As in my installation)

PHP5 Support along with PHP4

PHP5 Support along with PHP4; the following are the steps to run php5+gd+mysql support (with the default install of php4) working with Plesk 8.2.0 and Non-Plesk hosted sites on RHEL 4.

1.1. Install GD support for PHP5.

a) # mkdir /usr/local/php5libpng
b) # cd /usr/local/php5libpng
c) # wget http://kent.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8-config.tar.gz
d) # tar -zxvf libpng-1.2.8-config.tar
e) # ./configure --prefix=/usr/local/php5libpng --exec-prefix=/usr/local/php5libpng
f) # make
g) # make install

1.2. Check for this packages or install it.

a) mysql-devel
b) libjpeg-devel


1.3. Download and Install PHP.

a) # mkdir /usr/local/php5
b) # cd /usr/local/php5
c) # wget http://museum.php.net/php5/php-5.1.4.tar.gz
d) # tar -zxvf php-5.1.2.tar

e) # ./configure --host=i386-redhat-linux --build=i386-redhat-linux --target=i386-redhat-linux-gnu --prefix=/usr/local/php5 --exec-prefix=/usr/local/php5 --program-suffix=5 --enable-force-cgi-redirect --enable-discard-path --enable-exif --enable-ftp --with-curl --with-bz2 --enable-memory-limit --enable-inline-optimization --with-openssl --with-png --with-regex=system --with-xml --with-zlib --enable-sockets --enable-mbstring=shared --enable-mbstr-enc-trans --with-png-dir=/usr/local/php5libpng --with-gd --with-jpeg-dir=/usr/local/php5libjpeg --enable-gd-native-ttf --with-mysql --with-gmp --with-iconv --enable-magic-quotes --enable-calendar --enable-dbx --enable-dio --enable-libxml --enable-session --with-pcre-regex --enable-xml --enable-simplexml --enable-spl --enable-sigchild --enable-soap --enable-zend-multibyte --with-kerberos=/usr/kerberos --enable-fastcgi

f) # make
g) # make install

2. Now go to the root folder of the domain and configure php5 as default php application. Create the file vhost.conf with the following in it for each site running in PHP5:

a) # cd /var/www/vhosts/domain-name/conf/
b) # vi vhost.conf and add the following lines.

AddHandler fcgid-script .php5 .php
SuexecUserGroup psacln

FCGIWrapper /var/www/vhosts/domain-name/bin/php5 .php
FCGIWrapper /var/www/vhosts/domain-name/bin/php5 .php5
Options ExecCGI
allow from all

Save and exit with ":wq".

Note1: for replacing string in vi editor use the command: [:n,$s/string/newstring/g] - Where 'n' will replace with the starting line NO.


c) # cd /var/www/vhosts/domain-name/
d) # mkdir bin
e) # chown ftpuser.psaserv bin
f) # cd bin
g) # cp /usr/local/php5/bin/php5 php5
h) # chown ftpuser,psacln php5
i) # chmod 755 php5 (optional if the permission is wrong)

Note2: PHP5 needs to be copied and run locally, since otherwise you get issues with suexec. If you have problems run cat /var/log/httpd/suexec_log and check any errors.


3. Reconfigure domain with PHP5

a) Run: # /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.com
b) # service httpd restart

Recheck with "phpinfo" as it is properly configure or not.

Local Server Installation: For Non Plesk Server
4.0.0. Now configure the same in a Non Plesk Environment. Run the step One (download and compile the PHP 5).

4.1.0. Now you can configure in a way so that only the file with .php5 extension will run through PHP 5.

4.1.1. # vi /etc/httpd/conf/httpd.conf, and add this lines.

# Enabling PHP 5 as CGI Application

ScriptAlias /php5 /usr/local/php5/bin

Options +ExecCGI +FollowSymLinks
AllowOverride All

AddType application/x-httpd-php-5 .php5
Action application/x-httpd-php-5 /php5/php


4.1.2. # service httpd restart

4.2.0. Alternatively you can use port base configuration, so that the file with .php extension with this option e.g. http://domain.com/test.php runs with PHP4 and for http://domain.com:88/test.php with PHP 5.

4.2.1. # vi /etc/httpd/conf/httpd.conf, add these lines.

# Coustom Port for PHP 5
Listen 88

# VirtualHost PHP 5 Based hosting


ScriptAlias /php5 /usr/local/php5/bin

Options +ExecCGI +FollowSymLinks
AllowOverride None

AddHandler php-cgi-script .php
Action php-cgi-script /php5/php
Options +ExecCGI


4.2.2. # service httpd restart

Running MySQL 4 & MySQL 5 Concurrently

1.0. Download and install MySQL 5.x

1.1. Download the source code from http://dev.mysql.com/downloads/mysql/5.0.html#source

1.2. #tar -zxvf mysql.version.tgz

1.3. #cd mysql.version

1.4. # ./configure --prefix=/var/lib/mysql5 \
--with-unix-socket-path=/var/lib/mysql5/mysql5.sock \
--with-tcp-port=3307
1.5. #make
1.6. #make install

2.0. Create an appropriate cnf/ini file so that mysql will know where to place the data files and other configuration option.

2.1. #vi /etc/my5.cnf, below is a sample file.

# Example MySQL config file for large systems.

## This is for a large system with memory = 512M where the system runs mainly MySQL.
## You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /var/lib/mysql5/var) or
# ~/.my.cnf to set user-specific options.

## In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.# The following options will be passed to all MySQL clients

#[client]
#password = your_password
#port = 3307
#socket = /var/lib/mysql5/mysql5.sock

# Here follows entries for some specific programs
# The MySQL server

[mysqld]
port = 3307
socket = /var/lib/mysql5/mysql5.sock
old_passwords=1
skip-locking
key_buffer = 128M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M

[mysql.server]
user=mysql

[mysql]
default-character-set=latin1

[mysqld_safe]
err-log=/var/log/mysqld_5.log
pid-file=/var/lib/mysql5/mysqld5.pid

2.2. :wq to save the file.

2.3. Run this for install database directory.

./scripts/mysql_install_db --defaults-file=/etc/my5.cnf --user=mysql

3.0. Enter this line in /etc/rc.local to pin mysql5 when system start

/var/lib/mysql5/bin/mysqld_safe --defaults-file=/etc/my5.cnf --user=mysql &

4.0. Now configure phpMyAdmin to access both the Server MySQL 4.x and 5.x. Below is a sample of config.inc.php file.

/* Servers configuration */
$i = 0;

/* Server DiademGW_MySQL-4 (cookie) [1] */
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['verbose'] = 'MySQL-4';

/* Server DiademGW_MySQL-5 (cookie) [2] */
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['port'] = '3307';
$cfg['Servers'][$i]['socket'] = '/var/lib/mysql5/mysql5.sock'; /*actual socket path*/
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['verbose'] = 'MySQL-5';

/* End of servers configuration */

$cfg['blowfish_secret'] = '475e8ba09cb6c4.57557095';
?>

Minux...Sometimes spelled MINIX

Minux is an open source operating system with a user interface similar to that of Unix. Professor Andrew Tanenbaum, of Vrije University in Amsterdam, created Minux as an educational tool. To this end, Minux was developed with a small and well-documented microkernel-based design. The complete source code was made available with the system.

To learn the inner workings of Unix-like systems, students can run Minux on their personal computers. According to reports, even inexperienced students can acquire a good knowledge of the whole system within the few months of study typical of training courses. The best known student user of Minux was Linus Torvalds, who, at the Helsinki in Finland, used the Minux platform on which to build the kernel for a new operating system, which he called Linux.


Source: http://searchopensource.techtarget.com/sDefinition/0,,sid39_gci884703,00.html

A Mother's Sacrifice A Very Heart Touching and Inspirational Story!...

My mom only had one eye. I hated her... she was such an embarrassment. My mom ran a small shop at a flea market. She collected little weeds and such to sell... anything for the money we needed she was such an embarrassment. There was this one day during elementary school.
I remember that it was field day, and my mom came. I was so embarrassed.
How could she do this to me? I threw her a hateful look and ran out. The next day at school..."Your mom only has one eye?!" and they taunted me.

I wished that my mom would just disappear from this world so I said to my mom, "Mom, why don't you have the other eye?! You're only going to make me a laughingstock. Why don't you just die?" My mom did not respond. I guess I felt a little bad, but at the same time, it felt good to think that I had said what I'd wanted to say all this time.

Maybe it was because my mom hadn't punished me, but I didn't think that I had hurt her feelings very badly.

That night...I woke up, and went to the kitchen to get a glass of water. My mom was crying there, so quietly, as if she was afraid that she might wake me. I took a look at her, and then turned away. Because of the thing I had said to her earlier, there was something pinching at me in the corner of my heart. Even so, I hated my mother who was crying out of her one eye. So I told myself that I would grow up and become successful, because I hated my one-eyed mom and our desperate poverty.

Then I studied really hard. I left my mother and came to Seoul and studied, and got accepted in the Seoul University with all the confidence I had. Then, I got married. I bought a house of my own. Then I had kids, too. Now I'm living happily as a successful man. I like it here because it's a place that doesn't remind me of my mom.

This happiness was getting bigger and bigger, when someone unexpected came to see me "What?! Who's this?!" ...It was my mother...Still with her one eye. It felt as if the whole sky was falling apart on me. My little girl ran away, scared of my mom's eye.

And I asked her, "Who are you? I don't know you!!!" as if I tried to make that real. I screamed at her "How dare you come to my house and scare my daughter! GET OUT OF HERE! NOW!!!" And to this, my mother quietly answered, "oh, I'm so sorry. I may have gotten the wrong address," and she disappeared. Thank good ness... she doesn't recognize me. I was quite relieved. I told myself that I wasn't going to care, or think about this for the rest of my life.

Then a wave of relief came upon me...one day, a letter regarding a school reunion came to my house. I lied to my wife saying that I was going on a business trip. After the reunion, I went down to the old shack, that I used to call a house...just out of curiosity there, I found my mother fallen on the cold ground. But I did not shed a single tear. She had a piece of paper in her hand.... it was a letter to me.

She wrote:
My son...
I think my life has been long enough now. And... I won't visit Seoul anymore... but would it be too much to ask if I wanted you to come visit me once in a while? I miss you so much. And I was so glad when I heard you were coming for the reunion. But I decided not to go to the school.... For you... I'm sorry that I only have one eye, and I was an embarrassment for you.

You see, when you were very little, you got into an accident, and lost your eye. As a mother, I couldn't stand watching you having to grow up with only one eye... so I gave you mine...I was so proud of my son that was seeing a whole new world for me, in my place, with that eye. I was never upset at you for anything you did. The couple times that you were angry with me. I thought to myself, 'it's because he loves me.' I miss the times when you were still young around me.

I miss you so much. I love you. You mean the world to me.
My world shattered!!!

Then I cried for the person who lived for me... My Mother

Linus Torvalds - The creator of the Linux Kernel.

Linus Torvalds, the creator of the Linux kernel, was born in Helsinki, Finland, on December 28, 1969. When Linus was ten years old, his grandfather, a statistics professor at University of Helsinki, purchased a Commodore VIC-20 computer. Linus served as an assistant to his grandfather by entering data into his grandfather's "programmable calculator" and, just for fun, taught himself some simple BASIC programs by reading the instruction books that came with the computer. By the time he registered as a computer science student at the University of Helsinki, Linus Torvalds was an accomplished programmer.

In 1991, after taking a course in Unix and C, Torvalds bought his own personal computer (PC). He was unhappy with the operating system that came with the computer (MS-DOS) and decided to write his own. Torvalds became interested in Minix, a small Unix-like operating system developed for educational purposes by Andrew S. Tanenbaum, a Dutch professor who wanted to teach his students the inner workings of a real operating system. Minix was designed to run on Intel 8086 microprocessors and had source code that was readily available for study. Torvalds decided to develop an operating system that exceeded the Minix standards. He called it Linux, a contraction for Linus' Minix.

Linus Torvalds did not copyright his computer code. Instead, he published his code on the Internet and asked members of the comp.os.minix newsgroup to help him build his operating system. On August 25, 1991, Linus Torvalds posted this famous message:

Hello everybody out there using minix -
I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones.

Linus Torvalds credits much of the success of his operating system to the Internet and to Richard Stallman's GNU project. Torvalds and his co-developers made use of the system components developed by members of the Free Software Foundation for the GNU project. The open-source philosophy behind the development of Linux, combined with the success of the operating system, has made Linus Torvalds into what can arguably be called a "cult figure." Unlike Windows and other proprietary operating systems, Linux remains publicly open and extendible by contributers. Anyone can use it without charge as long as any improvements they make are not copyrighted and remain freely available. At present, it's estimated that only 2% of Linux code today was written by Linus Torvalds himself, although he still "owns" the Linux kernel (the central part of the operating system) and remains the ultimate judge of what new code and innovations are incorporated into it.

After spending 10 years as a student and researcher at the University of Helsinki coordinating the development of the Linux kernel, Linus Torvalds accepted a job with Transmeta, a Silicon Valley start-up company known for its recruitment of high profile talent and its Crusoe chip. He is married and has two daughters.

Powered By Blogger