分类: LINUX
2008-09-24 11:49:46
j2sdk-1_4_2_08-linux-i586-rpm.bin httpd-2.0.54.tar.gz resin-3.0.8.tar.gz mysql-4.0.25.tar.gz php-5.0.4.tar.gz ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz mysql-connector-java-3.1.0.tar.gz freetype-2.1.9.tar.gz gd-2.0.28.tar.gz jpegsrc.v6b.tar.gz libpng-1.2.5.tar.gz libxml2-2.6.9.tar.gz xpm-3.4k-2.i386.rpm zlib-1.2.3.tar.gz
1 安装MYSQL
# groupadd mysql # useradd -g mysql mysql /*增加mysql user,group 为mysql. # cd /root/src # tar zxvf mysql-4.0.25.tar.gz /*会生成一个mysql-4.0.21的目录*/ # cd mysql-4.0.25 # ./configure --prefix=/usr/local/mysql --enable-assembler --with-innodb --with-charset=gb2312 # 上面的 /* --prefix=/usr/local/mysql 是把mysql 的安装路径提向 /usr/loca/mysql # make # make install # cp support-files/my-medium.cnf /etc/my.cnf /*这时会问是否覆盖重名文件,回答y*/ # cd /usr/local/mysql # bin/mysql_install_db --user=mysql /*以mysql用户建系统库,必须以mysql用户,这点很重要!*/ # chown -R root . # chown -R mysql var # chgrp -R mysql . # chown -R mysql.mysql var (在mysql目录, 里面存放数据库,可以看到默认的mysql,test DB) # bin/mysqld_safe --user=mysql & /*也要用mysql用户运行,如果没任何反应,恭喜!成功了!*/ # /* 运行上面的语句后会出现Starting mysqld daemon with databases from /usr/local/mysql/var 代表成功start mysql. )
2 安装JDK
# cp /root/src/j2sdk-1_4_2_08-linux-i586-rpm.bin /usr/local # cd /usr/local # chmod +x j2sdk-1_4_2_08-linux-i586-rpm.bin # ./j2sdk-1_4_2_08-linux-i586-rpm.bin / * 使用空格六阅读licens, 直到出现 Do you agree to the above license terms? [yes or no] 选择yes # rpm -ivh j2sdk-1_4_2_08-linux-i586.rpm 安装完后会在/usr目录下出现一个java/j2sdk1.4.2_08 这就是java的安装目录 装完J2SDK后还要设置环境变量 # Vi /etc/profile 在这个文件里增加如下几行, 在export PATH USER LOGNAME 之前加入: PATH=$PATH:/usr/java/j2sdk1.4.2_08/bin:/usr/local/mysql/bin export PATH export JAVA_HOME=/usr/java/j2sdk1.4.2_08 export CLASSPATH=.:/usr/java/j2sdk1.4.2_08/lib/dt.jarscreen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://bbs.chinaunix.net/images/smilies/shy.gif');}" alt="" src="http://bbs.chinaunix.net/images/smilies/shy.gif" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>JAVA_HOME/lib/tools.jarscreen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://bbs.chinaunix.net/images/smilies/shy.gif');}" alt="" src="http://bbs.chinaunix.net/images/smilies/shy.gif" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>JAVA_HOME/lib/htmlconverter.jar:/usr/local/resin-3.0.8/lib:/usr/java/jdbc/mysql-connector-java-3.1.10-bin.jar RESIN_HOME=/usr/local/resin-3.0.8 export RESIN_HOME USERNAME="root" export USERNAME
3 安装MYSQL的JDBC
MySQL的JDBC的相关环境变量已经在前面设置好了,所以余下的只是按以下命令安装: # cd /root/src # tar xzvf mysql-connector-java-3.1.10.tar.gz # mv mysql-connector-java-3.1.10 /usr/java # cd /usr/java # ln -s mysql-connector-java-3.1.10 jdbc /* 产生一个链接,方便后续作业.
4 安装 XPM – 为安装 GD作准备
# cd /root/src # rpm -ivh --froce xpm-3.4k-2.i386.rpm
5 安装libxml – 为安装 GD作准备
# cd /root/src # bunzip2 libxml2-2.6.9.tar.bz2 # tar xvf libxml2-2.6.9.tar # cd libxml2-2.6.9 # ./configure (xml默认安装就可以,不要指定路径了,库文件默认放在/usr/local/lib 里面。因为安装时php可能找不到它,PHP5只支持libxml2-2.5.10以上版本) # make # make install
6 安装zlib – 为安装 GD作准备
# cd /root/src # tar vzxf zlib-1.2.3.tar.gz # cd zlib-1.2.3 # ./configure --prefix=/usr/local/zlib2 (注意,如果您以前没有安装zlib,可以不指定路径,我是没有删除以前的低版本才指定的!以下雷同!) # make # make install
7 安装jpeg – 为安装 GD作准备
# cd /root/src # tar vzxf jpegsrc.v6b.tar.gz # cd jpeg-6b/ # ./configure --prefix=/usr/local/jpeg6 # make # make install-lib 如果你选择默认安装,可能很顺利,指定路径安装后,请先创建以下文件夹 错误提示:...... /usr/bin/install -c -m 644 jconfig.h /usr/local/jpeg6/include/jconfig.h /usr/bin/install: 无法创建一般文件‘/usr/local/jpeg6/include/jconfig.h’: 没有那个文件或目录 make: *** [install-headers] Error 1 # mkdir /usr/local/jpeg6 # mkdir /usr/local/jpeg6/include # mkdir /usr/local/jpeg6/lib # make install-lib # make install 安装时如果错误提示: /usr/bin/install: 无法创建一般文件`/usr/local/jpeg6/bin/cjpeg': 没有那个文件或目录 make: *** [install-lib] Error 1 创建如下文件夹: # mkdir /usr/local/jpeg6/bin # make install /usr/bin/install -c cjpeg /usr/local/jpeg6/bin/cjpeg /usr/bin/install: 无法创建一般文件‘/usr/local/jpeg6/bin/cjpeg’: 没有那个文件或目录 make: *** [install] Error 1 # mkdir /usr/local/jpeg6/bin /usr/bin/install -c -m 644 ./cjpeg.1 /usr/local/jpeg6/man/man1/cjpeg.1 /usr/bin/install: 无法创建一般文件`/usr/local/jpeg6/man/man1/cjpeg.1': 没有那个文件或目录 make: *** [install] Error 1 # mkdir /usr/local/jpeg6/man # mkdir /usr/local/jpeg6/man/man1 # make install 好了,直到安装成功!
8 安装libpng: –为安装 GD作准备
# cd /root/src # tar xzvf libpng-1.2.5.tar.gz # cd libpng-1.2.5 # cp scripts/makefile.std makefile /* 因为没有make file # make test # make install
9 安装freetype –为安装 GD作准备
# cd /root/src # tar vzxf freetype-2.1.9.tar.gz # cd freetype-2.1.9 # ./configure --prefix=/usr/local/freetype2 # make # make install
10 安装gd库
# cd /root/src # tar xzvf gd-2.0.28.tar.gz # cd gd-2.0.28 # ./configure --prefix=/usr/local/gd2 --with-zlib=/usr/local/zlib2/ --with-png=/usr/local/libpng2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype2/ (请指定及格插件的安装路径,否则安装php的时候可能出错!) # make # make install
11 安装apache
安装apache,(php5安装环境需要apache2.0.46以上版本,下载的时候注意!) 如果系统自带安装有apache 请停止服务 service httpd stop, 并且 chkconfig httpd off # cd /root/src # tar zxvf httpd-2.0.54.tar.gz # cd httpd-2.0.54 # ./configure --prefix=/usr/local/apache --enable-module=so --enable-so # make # make install