存档

2007年5月 的存档

Install Apache+PHP on CentOS4.4

2007年5月29日 没有评论

On the current AMD x64 platform, I install CentOS4.4 and related development packages. This article is How-To set up Apache + PHP in Linux box. It takes me about two hours in fixing this issue. So it seems in pretty good.

1. Download the latest Apache and PHP distributions
httpd-2.2.4.tar.bz2
php-4.4.6.tar.gz

2. Install Apache
Un-compress the install file:
# bunzip httpd-2.2.4.tar.bz2
# tar xvf httpd-2.2.4.tar
# cd httpd-2.2.4

For our Web GUI needs the httpd to be owned by supervisor “root”, the following environment parameter must be added before compiling and building.
# env CFLAGS=”-Wall -DBIG_SECURITY_HOLE” ./configure –prefix=/usr/local/apache –enable-so
–predix indicates the installing path. –enable-so means compiling in DSO mode.
If the configure scripts completes successfully, you can then proceed:
# make && make install
Apache show compile without any hitches.

3. Install PHP
Unpack the PHP distribution, change to the PHP directory and run the configure script, you need to pass certains options to the script.
# tar zxvf php-4.4.6.tar.gz
# cd php-4.4.6

Here’s a complete configure script with Apache-support options.
#./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache/bin/apxs
–with-apxs2 means it supports Apache2.0, this option must be appended.
# make && make install

After it has installed, we need to install the PHP.ini file:
# cp php.ini-optimized /usr/local/lib/php.ini
Note, the above copying step is not always required.

If the installation completes successfully, there will be a file named “libphp4.so” in /usr/local/apache/modules:
# ls /usr/local/apache/modules/
httpd.exp libphp4.so

4. Modify the /usr/local/apache/conf/httpd.conf to enable PHP options. Here’s an example from BA880:
# vi /usr/local/apache/conf/httpd.conf
————————————————–
ServerRoot “/usr/local/apache”
Listen 80
LoadModule php4_module modules/libphp4.so

User root
Group root

ServerAdmin you@example.com
ServerName barcelona

DocumentRoot “/opt/work/httpd/html/”

Options Indexes MultiViews
AllowOverride None
DirectoryIndex index.html index.php default.php
Order allow,deny
Allow from all


Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all


DirectoryIndex index.html index.php default.php
AllowOverride AuthConfig
Order allow,deny
Allow from all


DirectoryIndex index.html


Order allow,deny
Deny from all
Satisfy All

ErrorLog logs/error_log
LogLevel warn


LogFormat “%h %l %u %t “%r” %>s %b “%{Referer}i” “%{User-Agent}i”” combined
LogFormat “%h %l %u %t “%r” %>s %b” common

LogFormat “%h %l %u %t “%r” %>s %b “%{Referer}i” “%{User-Agent}i” %I %O” combinedio

CustomLog logs/access_log common


ScriptAlias /cgi-bin/ “/usr/local/apache/cgi-bin/”



AllowOverride None
Options None
Order allow,deny
Allow from all

DefaultType text/plain


TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


SSLRandomSeed startup builtin
SSLRandomSeed connect builtin

————————————————–
I’ve marked the modified texts by blue font. Note, this special httpd’s owner is “root”.

5. Install Web GUI for BA880:
# mkdir -p /opt/work/httpd
# scp -rf 192.168.3.246:/os/httpd/* /opt/work/httpd
# mv /etc/export /etc/exports.bak
# mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
# ln -s /opt/work/httpd/related/var/etc/exports /etc/exports
# ln -s /opt/work/httpd/related/var/etc/smb.conf /etc/samba/smb.conf

6. Start up Apache:
# /usr/local/apache/bin/apachectl -k start

7. Verify its working status:
# ps -x | grep httpd
6156 ? S 0:00 /usr/local/apache/bin/httpd -k start
6157 ? S 0:00 /usr/local/apache/bin/httpd -k start
6158 ? S 0:00 /usr/local/apache/bin/httpd -k start
6160 ? S 0:00 /usr/local/apache/bin/httpd -k start
If see the above lines, it measn everything runs well.
Open Web Browser, and input the IP address, it would be accessed by http.

分类: 科技 标签:

Implement iscsi on CentOS5.0

2007年5月22日 没有评论

According to the disappoint test result in UT StarCom, I found the underlying reason is the mount version of client OS that is mount-2.11y is too old to support our current product well.Though using higher version mount(eg,mount-2.12a) can resolve this problem, the customer would never be glad to update their software only for adapting to mount our storage shares, if done it, they will be their icy. I have to work on our NAS product, and try to upgrate its kernel to fix known bugs caused by “dlm_sendd” that eats almost all CPU resources when mount 10T share. Hence, I download the lastest CentOS5.0 and install it on the vmware machine. It is lucky that CentOS5.0 has already integrated many packages about cluster and gfs. Still some packeges need to installed. This article will describe how to install a cluster node and implement it for load-distributing.(DNS Round-Robin).

1. Review CentOS5 kernel verion
[root@test1 /]# uname -a
Linux test1 2.6.18-8.el5 #1 SMP Thu Mar 15 19:57:35 EDT 2007 i686 i686 i386 GNU/Linux

2. Install iscsi-initiator-utils Something stranger. When install this package with the following command, it meets error: [root@test1 iscsi]# rpm -ivh iscsi-initiator-utils-4.0.3.0-4.i386.rpm
warning: iscsi-initiator-utils-4.0.3.0-4.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e error: Failed dependencies: libsysfs.so.1 is needed by iscsi-initiator-utils-4.0.3.0-4.i386

But there’re already libsysfs installed in CentOS5.0. Later, I have to use yum tools.
[root@test1 /]# yum install iscsi-initiator-utils
Loading “installonlyn” plugin
Setting up Install Process
Setting up repositories
base 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 951 B 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00

Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s)
Total download size: 447 k Is this ok [y/N]: y
Downloading Packages: (1/1): iscsi-initiator-ut 100% |=========================| 447 kB 01:41
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897 Importing GPG key 0xE8562897 ”
CentOS-5 Key (CentOS 5 Official Signing Key) ” from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]: y
Running Transaction Test Finished
Transaction Test Transaction Test Succeeded
Running Transaction Installing: iscsi-initiator-utils ######################### [1/1]
Installed: iscsi-initiator-utils.i386 0:6.2.0.742-0.5.el5 Complete!

Verify the package:
[root@test1 /]# rpm -qa | grep iscsi
iscsi-initiator-utils-6.2.0.742-0.5.el5

分类: 科技 标签:

Mandriva 2007: kernel source package

2007年5月17日 没有评论

It surprised me so much that Mandriva 2007 4CDs do not provide kernel source package. Googled result says it would be installed in MCC/Software Management/Installable packages, while querying the term “kernel-source” returns no results. Later I fix this issue by executing the following command:

# urpmi kernel-source-2.6.17.8mdv (Note, this is a period, not hyphen after 17)
[root@localhost /]# urpmi kernel-source-2.6.17.8mdv ftp://mirror.tuxinator.org/MandrivaLinux/official/updates/2007.0/i586/media/main/updates/kernel-source-2.6.17.8mdv-1-1mdv2007.0.i586.rpm

1% of 50.8M completed, ETA = 2:26:41, speed = 4909

Or open other termine and use wget to download this file. My current kernel version is 2.6.17-5mdv. It must be installed before running vmware in Mandriva2007.

分类: 科技 标签:

DNS Balance: Round Robin

2007年5月9日 没有评论

When installed BA880 system with Zhu Feng yesterday, I saw the indeed load-balancing mechanism is DNS Round Robin. As the client requires for service, the DNS Round Robin give the client the first hostname/IP address in the local DNS zone recorders. For example, assume there’re totol 3 nodes in cluster, and related three DNS entries in the name table. The first accessing client would be given the first DNS address in the table, and the second client given the second, third accessing given the third. If there’s other clients, the fourth vistor, it is guided to login the first recorder as cycle-rotating.

DNS Round Robin has many disadvantages, such as TTL parameter(Time To Live), and caching recorders. In fact, Round Robin is loading distribution, not load balancing, for it does not know the load of every node. However, Round Robin mechanism has even been used by sina and yahoo for their distributed nodes around the country.

DHCP performance impact Kick-Start installation
I meet the trouble that when using KS file to install Linux, the ethernet network deviced (eth0) would not be sighed IP address by DHCP. And just repeat the KS install command(Linux ks=nfs:192.168.3.246:/os/1.cfg), it seemed to get dynamic IP again and go to install successfully. Note, if not repeat, configure the eth0 IP address manually would also go straightly. Perhaps I have to configure my own DHCP server for future experiments.

分类: 科技 标签:

Q1 Review/Return to Shenzhen

2007年5月8日 没有评论

I resign from Plasmon at April 20th, 2007 and return to Shenzhen. Almost all Zhuhai days are comfortable, the lift is quiet and step runs slowly. I could focus on reading and researching in Linux field. The experience in Plasmon is very senseful for my future technical career.

In the past 4 months, I prepared and took RHCE exam at January, till now I remember how my mother and friends encourage and support me in those hard days. February, Chinese Spring Festival. March, I did not improve myself for some private reason, however, this short period maybe the sweetest days in last 5 years. April, I resigned from Plasmon and go back home, because Mother had rejoined her former company locating in Shenzhen.

Nine month I have worked in Zhuhai, and I know many good friends here. Sam Chen, Han Zhang and Kevin Zhu. After I went back to Shenzhen we still keep touching.

In the coming 3 months, I plan to do the following things:
1. Browse slastdot.org everyday, opening mind is very very important.
2. Linux Cluster/GFS research.
3. Study underlying Linux kernel architecture.

Hmm, I am determinted that I will never drink more than two bottles of beer.

分类: 科技 标签: