下载文件:
http://java.sun.com j2sdk-1_4_2_06-linux-i586-rpm.bin
1、安装j2sdk
[root@localhost] chmod 711 j2sdk-1_4_2_01-linux-i586-rpm.bin
[root@localhost] ./j2sdk-1_4_2_01-linux-i586-rpm.bin
[root@localhost] rpm –ivh j2sdk-1_4_2_01-linux-i586-rpm
执行后会出现好几页的版权声明,回答 yes
安装好后的 JDK 会储存在 /usr/java/j2sdk1.4.2_01 目录中(不同版本的 JDK 目录名称会不一样,例如 /usr/java/j2sdk1.x.y_zz)。
做一个符号连接:
[root@localhost] ln –s /usr/java/j2sdk1.4.2_01 /usr/java/jdk
设置环境变量:
写到/etc/profile中去了。那样会使系统启动时就加载jdk。
[root@localhost] vi profile
export JAVA_HOME="/usr/java/jdk"
export PATH="$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin"
export CLASSPATH="$JAVA_HOME/lib:$JAVA_HOME/jre/lib"
2、安装tomcat
因为我下载的是binary版本,所以不需要再进行编译。
[root@localhost] cp /download/jakarta-tomcat-5.1.20.tar.gz /usr/local
[root@localhost] tar zxvf jakarta-tomcat-5.1.20.tar.gz
[root@localhost] rm -f jakarta-tomcat-5.1.20.tar.gz
[root@localhost] ln -s jakarta-tomcat-5.1.20 tomcat5
[root@localhost] cd tomcat5
[root@localhost] cp common/lib/servlet-api.jar /usr/java/jdk/jre/lib/ext //把servlet包复制到jre的lib下ext下
添加环境变量:
[root@localhost] vi /etc/profile
export CATALINA_HOME="/usr/local/tomcat5"
可以测试Tomcat能否正常启动了:
[root@localhost] cd /usr/local/tomcat5
[root@localhost] bin/startup.sh
你会看到这些东东:
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JAVA_HOME: /usr/java/jdk
然后打开浏览器,输入http://localhost:8080,如果您能看到一只变态的小猫望着你的话,那么恭喜您
,tomcat也成了 。
3、安装OpenSSl
[root@localhost] tar -zxvf openssl-0.9.7d.tar.gz
[root@localhost] cd openssl-0.9.7d
[root@localhost] ./config --prefix=/usr/local/openssl #设置安装路径
[root@localhost] make
[root@localhost] make test
[root@localhost] make install
4、安装GD让系统支持GD
a、安装zlib-1.1.3.tar.gz
[root@localhost] tar zxvf zlib-1.1.3.tar.gz
[root@localhost] cd zlib-1.1.3
[root@localhost] ./configure
[root@localhost] make
[root@localhost] make test
[root@localhost] make install
b、安装libpng-1.0.10.tar.gz
[root@localhost] tar zxvf libpng-1.0.10.tar.gz
[root@localhost] cd libpng-1.0.10
[root@localhost] cp scripts/makefile.linux makefile
[root@localhost] vi makefile
修改其中参数
ZLIBLIB=/usr/local/lib
ZLIBINC=/usr/local/include
[root@localhost] make test
[root@localhost] make install
c、安装jpegsrc.v6b.tar.gz
[root@localhost] tar zxvf jpegsrc.v6b.tar.gz
[root@localhost] cd jpeg-6b
[root@localhost] ./configure
[root@localhost] make
[root@localhost] make test
[root@localhost] make install
[root@localhost] make install-lib
d、安装freetype-2.0.1.tar.gz
[root@localhost] tar zxvf freetype-2.0.1.tar.gz
[root@localhost] cd freetype-2.0.1
[root@localhost] make setup
[root@localhost] make
[root@localhost] make install
e、最后安装GD
[root@localhost] tar zxvf gd 2.0.15.tar.gz
[root@localhost] cd gd 2.0.15
[root@localhost] ./configure
配置完成后,注意输出的信息是否如下:
** Configuration summary for gd 2.0.15:
Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Xpm library: no
Xpm库以前安装不成功,如果程序部门不常用用,一般PNG/JPEG/FREETYPE三个库打开支持就行
[root@localhost] make
[root@localhost] make install
[root@localhost] cp gd.h /usr/local/lib \\编译PHP的时候会缺少这个文件出错
5、安装apache2
[root@localhost]tar zxvf httpd-2.0.52.tar.gz
[root@localhost]cd httpd-2.0.52
[root@localhost]./configure --prefix=/usr/local/apache --enable-so --enable-rewrite
[root@localhost]make
[root@localhost]make install
安装成功
6、安装php4
[root@localhost]tar zxvf php-4.3.9.tar.gz
[root@localhost]cd php-4.3.9
[root@localhost]./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-gd=/usr/local/lib --with-zlib-dir=/usr/local/lib -with-mysql=/usr/local/mysql --enable-sysvmsg --enable-trace-vars --enable-sockets --enable-sysvshm --enable-sysvsem
[root@localhost] make
[root@localhost] make install
[root@localhost] cp php.ini-dist /usr/local/lib/php.ini //不然无法启动
[root@localhost] vi /usr/local/lib/php.ini
;default_charset = "iso-8859-1"
在这行下面加一行
default_charset = "gb2312"
把register_globals = Off改为register_globals = On
---------------------------------------------------------
max_execution_time = 600 ;最大运行时间 600 秒
max_input_time = 600 ;最大输出时间 600秒
memory_limit = 20M ;最大内存限制 20M
file_uploads = On ;允许上载文件
upload_max_filesize = 20M ;最大文件大小 20M
post_max_size = 20M ;php可接受的 post 方法大小 20M
session.auto_start = 1 ;session自动启动
-------------------------------------------------------------