Archive for March, 2007



Building a LAMP server in Linux

In the previous week I had configured LAMP in our server. Being a person who had worked in php for some months, actually I was not much aware of setting this in Linux. On my php days I was only using the easy windows bundle “phptriad” for coding… Being a man who is not much familiar with Linux, this installation was not much easy for me. The one main problem occurred is with the compatibility issue of the latest PHP and MySQL downloads.

1. Remove previous RPM Versions of the Applications

rpm -qa | grep -i apache
rpm -qa | grep -i httpd
rpm -qa | grep -i php
rpm -qa | grep -i mysql

2. Get the Source Code for all Applications from their respective sites

3. Unpack the Source Code

tar zxf php-x.x.x.tar.gz
tar zxf apache_x.x.xx.tar.gz
tar zxf mysql-x.x.xx.tar.gz

This should leave you with the following directories:

/usr/local/src/php-4.4.2
/usr/local/src/apache_1.3.34
/usr/local/src/mysql-4.0.26

4. Build and Install MySQL

cd /usr/local/src/mysql-x.x.xx

chown -R root.root *

make clean

./configure \
–prefix=/usr/local/mysql \
–localstatedir=/usr/local/mysql/data \
–disable-maintainer-mode \
–with-mysqld-user=mysql \
–with-unix-socket-path=/tmp/mysql.sock \
–without-comment \
–without-debug \
–without-bench

then make && make install

5. Build and Install Apache (with DSO support)

cd /usr/local/src/apache_1.3.34

make clean

./configure \
–prefix=/usr/local/apache \
–enable-shared=max \
–enable-module=rewrite \
–enable-module=so

make && make install

6. Build and Install PHP

cd /usr/local/src/php-x.x.x

./configure \
–with-apxs=/usr/local/apache/bin/apxs \
–disable-debug \
–enable-ftp \
–enable-inline-optimization \
–enable-magic-quotes \
–enable-mbstring \
–enable-mm=shared \
–enable-safe-mode \
–enable-track-vars \
–enable-trans-sid \
–enable-wddx=shared \
–enable-xml \
–with-dom \
–with-gd \
–with-gettext \
–with-mysql=/usr/local/mysql \
–with-regex=system \
–with-xml \
–with-zlib-dir=/usr/lib

make && make install

cp php.ini-dist /usr/local/lib/php.ini
ln -s /usr/local/lib/php.ini /etc/php.ini

7. Edit the Apache Configuration File (httpd.conf)

To ensure your PHP files are properly interpreted, and not just downloaded as text files , add these lines to the respective location in the httpd.conf file. We can find the location by searching “AddType”.

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-tar .tgz
AddType application/x-httpd-php .php .foo
AddType application/x-httpd-php-source .phps .phtmls
AddType application/x-httpd-php .php .htm .html

8. Commands to start, stop or restart apache

To start apache : /usr/local/apache/bin/apachectl start
To stop apache : /usr/local/apache/bin/apachectl stop
To restart apache : /usr/local/apache/bin/apachectl restart

Source: here
Technorati tags: Linux, LAMP, PHP, Apache, MySQL 

MySQL: Backup and Restore

To take the entire backup of a database:
> mysqldump -u user_name -p database_name > dumped_file_name

To Restore the backup
> mysql -u user_name -p database_name < dumped_file_name

Technorati: Mysql

Searchmash: Another Google product

Searchmash mixes (mashes) the various types of searches from Google products like web sites, videos from You Tube and Google Video, images, blogs. The wikipedia search results are also mixed with it. It has a simpler interface and some useful user friendly features. There is a small “Ajax feedback” form too.

Technorati : google, searchmash

Spring Framework 2.0.3 Released

Spring’s this version is a bugfix and enhancement release in the Spring 2.0 series, including about 200 (!) refinements and fixes. Furthermore, this release introduces support for the JSR-166 (java.util.concurrent) backport project and basic support for JCA 1.5 (ResourceAdapter bootstrap, WorkManager support), as well as extended support for IBM WebSphere and Oracle OC4J.

Source : here

Technoarti: Spring 2.0

Uninstalling the Previous MySQL Installation in Linux

When we install the new version of mysql in linux then, if there is any old version is existing, it will show some conflict. So we have to remove the old files before proceeding further. The following commands will help you to do this.

# rpm -qa | grep -i mysql
libdbi-dbd-mysql-0.6.5-7
MySQL-python-0.9.1-9
perl-DBD-MySQL-2.9002-1
mod_auth_mysql-20030510-3
php-mysql-4.3.3-6
mysql-3.23.58-4
mysql-bench-3.23.58-4
mysql-server-3.23.58-4
freeradius-mysql-0.9.1-1
mysql-devel-3.23.58-4
qt-MySQL-3.1.2-14

You will want to uninstall any release of MySQL before continueing with the installation of latest MySQL version.

You can use RPM to uninstall the above packages as follows:

# rpm -e libdbi-dbd-mysql
# rpm -e MySQL-python
# rpm -e mod_auth_mysql
# rpm -e php-mysql
# rpm -e mysql-bench
# rpm -e mysql-server
# rpm -e freeradius-mysql
# rpm -e mysql-devel
# rpm -e mysql perl-DBD-MySQL MyODBC qt-MySQL

In addition to removing all MySQL packages, you will also want to remove any mysql group and user that may already be created. The following command will remove both the mysql group as well as the mysql group:

# userdel mysql

Reference here


Technorati : , ,

« Previous Page


View Lijin Joseji's profile on LinkedIn

Disclaimer

The information on this site is for informational purposes only. The use of any Trademark or Copyrighted material is not intended to infringe Copyright. This blog is intended to be used under a policy of personal and non commercial use.

Adds

Add to Google

Blog Stats

  • 127,029 hits

Categories