LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 664|回复: 2

Apache+SSL+PHP+JSP+MySQL+IMAP+GD 安装全攻略

[复制链接]
发表于 2003-5-24 21:17:47 | 显示全部楼层 |阅读模式
假设所有安装程序包都下在/pub下面,在telnet或ssh文本界面下进行如下所有操作。


一、安装 JDK 1.4
1. 下载 J2SDK1.4 的 Linux RPM 版本 j2sdk-1_4_0-linux-i386-rpm.bin
2. cd /pub
3. chmod +x j2sdk-1_4_0-linux-i386-rpm.bin
4. ./j2sdk-1_4_0-linux-i386-rpm.bin
5. rpm -ivh j2sdk-1_4_0-fcs-linux-i386.rpm
6. vi /etc/profile 增加如下内容:
JAVA_HOME=/usr/java/j2sdk1.4.0
export JAVA_HOME
CLASSPATH=/usr/java/j2sdk1.4.0/lib:/usr/java/j2sdk1.4.0/jre/lib
export CLASSPATH
PATH=$PATHJAVA_HOME/binJAVA_HOME/jre/bin
export PATH
7. 退出然后重新登录使环境变量生效



二、安装 Tomcat 4.0
1. 下载Tomcat的linux binary版本,以及 mod_webapp.so
2. tar zxvf jakarta-tomcat-4.0.3.tar.gz
3. 做 /pub/jakarta-tomcat-4.0.3/conf 目录下面server.xml中的其他相关配置(暂时不做也可以)
4. /pub/jakarta-tomcat-4.0.3/bin/startup.sh 启动 Tomcat 服务,并且将它加到系统的启动程序中/etc/rc.d/rc.local (用/pub/jakarta-tomcat-4.0.3/bin/shutdown.sh 停止Tomcat )



三、安装 MySQL
1. groupadd mysql
2. useradd -g mysql mysql
3. tar zxvf mysql-3.23.49.tar.gz
(or, gunzip < mysql-3.23.49.tar.gz | tar xvf -)
4. cd mysql-3.23.49
5. ./configure --prefix=/usr/local/mysql
6. make
7. make install
8. scripts/mysql_install_db
9. chown -R root /usr/local/mysql
10. chown -R mysql /usr/local/mysql/var
11. chgrp -R mysql /usr/local/mysql
12. cp support-files/my-medium.cnf /etc/my.cnf
13. cp scripts /usr/local/mysql -R
14. cp support-files /usr/local/mysql -R
15. cd /usr/local/mysql
16. chmod +x support-files/mysql.server
17. cp support-files/mysql.server /etc/rc.d/init.d/mysqld 同时要设置 /etc/rc.d/init.d/mysqld 开机自动运行:ln -s /etc/rc.d/init.d/mysqld /etc/rc.d/rc3.d/S99mysqld
18. /etc/rc.d/init.d/mysqld start 启动 MySQL
19. /usr/local/mysql/bin/mysqladmin -u root password ew-password 设置 MySQL root 口令



四、安装 OpenSSL
1. cd /pub
2. tar zxvf openssl-0.9.6b.tar.gz
3. cd openssl-0.9.6b
4. ./config
5. make
6. make test
7. make install



五、安装 mod_ssl
1. cd /pub
2. tar zxvf mod_ssl-2.8.8-1.3.24.tar.gz
3. tar zxvf apache_1.3.24.tar.gz
(from www.apache.org)
4. cd mod_ssl-2.8.8-1.3.24
5. ./configure --with-apache=../apache_1.3.24
6. cd ../apache_1.3.24
7. ./configure --prefix=/www



六、安装 IMAP support
1. cd /pub
2. tar zxvf imap-2001a.tar.Z
3. cd imap-2001a
4. make slx (for Linux)
5. 修改 /etc/services 注册端口,修改 /etc/inetd.conf 开启服务
6. cp c-client/c-client.a /usr/local/lib/libc-client.a
7. cp c-client/rfc822.h /usr/local/include
8. cp c-client/mail.h /usr/local/include
9. cp c-client/linkage.h /usr/local/include



七、安装 CURL support
1. cd /pub
2. tar zxvf curl-7.9.6.tar.gz
3. cd curl-7.9.6
4. ./configure --with-ssl --with-prefix=/usr/local/curl
5. make
6. make test
7. make install



八、安装 GD support
1. Install target=_blank>zlib support
1. cd /pub
2. tar zxvf zlib-1.1.3.tar.gz
3. cd zlib-1.1.3
4. ./configure
5. make
6. make test
7. make install
2. Install target=_blank>libpng support
1. cd /pub
2. tar zxvf libpng-1.0.10.tar.gz
3. cd libpng-1.0.10
4. cp scripts/makefile.linux makefile
5. vi makefile
修改其中
ZLIBLIB=/usr/local/lib
ZLIBINC=/usr/local/include
参数
6. make test
7. make install
3. Install jpeg-6b
support
1. cd /pub
2. tar zxvf jpegsrc.v6b.tar.gz
3. cd jpeg-6b
4. ./configure
5. make
6. make test
7. make install
8. make install-lib
4. Install FreeType
2.0.1 support
1. cd /pub
2. tar zxvf freetype-2.0.1.tar.gz
3. cd freetype-2.0.1
4. make setup
5. make
6. make install
5. Install GD
support
1. cd /pub
2. tar zxvf gd-1.8.4.tar.gz
3. cd gd-1.8.4
4. vi Makefile
修改其中
CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG
-DHAVE_LIBFREETYPE
LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm
INCLUDEDIRS=-I. -I/usr/local/include/freetype2
-I/usr/include/X11
-I/usr/X11R6/include/X11 -I/usr/local/include
5. make
6. make install



九、安装 PHP
1. cd /pub
2. tar zxvf php-4.2.0.tar.gz
3. cd php-4.2.0
4.

CFLAGS=-O2 -I/usr/local/ssl/include
./configure --with-apache=../apache_1.3.24
--enable-memory-limit=yes
--with-config-file-path=/usr/local/lib --with-imap --enable-ftp
--with-mysql=/usr/local/mysql
--enable-sockets --enable-debug=no --enable-track-vars
--with-gd=/usr/local
--with-jpeg-dir=/usr/local --with-png-dir=/usr/local
--with-curl=/usr/local/curl
--with-zlib --with-ttf --with-java
5. make
6. make install
7. cp php.ini-dist /usr/local/lib/php.ini
8. 修改 /usr/local/lib/php.ini



十、安装 Zend Optimizer (这步可在最后完成)
1. cd /pub
2. tar zxvf
ZendOptimizer-1[1].2.0-PHP_4.1.0-Linux_glibc21-i386.tar.gz
3. cd ZendOptimizer-1.2.0-PHP_4.1.0-Linux_glibc21-i386
4. mkdir /usr/local/Zend
5. mkdir /usr/local/Zend/lib
6. ./install.sh



十一、安装 Zend Cache (用在等于或低于 PHP 4.0.5版本,要注册码,这步可在最后完成)
1. cd /pub
2. tar zxvf
ZendCache-1[1].1.0b-PHP_4.0.5-Linux_glibc2.1-i386.tar.gz
3. cd ZendCache-1.1.0b-PHP_4.0.5-Linux_glibc2.1-i386
4. cp data/ZendCache.so /usr/local/Zend/lib
5. ( cp zend_cache.dat /usr/local/Zend ) // to register
license
6. Add the following lines to your php.ini file;
do not add any extra spaces or tabs; must after Zend
Optimizer configuration:
zend_cache.use_cwd=1
zend_cache.memory_consumption=16 ; 16MB
zend_cache.validate_timestamps=1
zend_extension="/usr/local/Zend/lib/ZendCache.so"



十二、安装 Zend Accelerator (用在php 4.0.5以上php 4.2.0以下,要注册码哦,这步可在最后完成)
1. cd /pub
2. tar xvf
ZendAccelerator-2.0.0-PHP_4.0.5-Linux_glibc21-i386.tar
3. cd ZendAccelerator-2.0.0-PHP_4.0.5-Linux_glibc21-i386
4. ./install.sh



十三、安装 Apache
1. cd ../apache_1.3.24
2.

SSL_BASE=/usr/local/ssl ./configure
--prefix=/www --enable-module=ssl --enable-module=so
--activate-module=src/modules/php4/libphp4.a
--enable-rule=SSL_SDBM --enable-module=rewrite
3. make
4. make certificate
5. make install
6. 修改 /www/conf/httpd.conf,
Options Indexes FollowSymLinks MultiViews -> Options
FollowSymLinks MultiViews
DirectoryIndex index.html -> DirectoryIndex index.html
index.php3 index.php
增加
LoadModule webapp_module libexec/mod_webapp.so
WebAppConnection warpConnection warp localhost:8008
WebAppDeploy examples warpConnection /examples/
7. vi /www/conf/mime.types 增加
application/x-httpd-php php php3
8. 拷贝下载的 mod_webapp.so 到 /www/libexec
9. 启动Apache
/www/bin/apachectl startssl
10. vi /etc/rc.d/init.d/httpd (可选)
#!/bin/sh
. /etc/rc.d/init.d/functions
case "$1" in
start)
echo -n "Starting httpd with SSL : "
/www/bin/apachectl startssl
;;
stop)
echo -n "Shutting down httpd: "
/www/bin/apachectl stop
;;
restart)
echo -n "Restarting httpd: "
/www/bin/apachectl restart
;;
status)
echo -n "Show httpd status: "
/www/bin/apachectl status
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0
11. ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc3.d/S99httpd (开机自动运行)



十四、大结局(最后测试)
1. 在/www/htdocs/下写个test.php,内容:<? phpinfo(); ?>,
2. http://localhost/test.php ,看看有没有很多php信息出来,如果有,说明php/mysql等都没有问题了。如果有"with Zend Optimizer v1.2.0, Copyright (c) 1998-2001, by Zend Technologies",说明Zend Optimizer装好了。如果有"with Zend Cache v1.1.0, Copyright
(c) 1999-2001, by Zend
Technologies",说明Zend Cache装好了。同理,看Zend
Accelerator装好没有。
3. 访问http://localhost/examples/jsp/index.html ,有很多jsp的例子
,运行看看有没有问题。恭喜你,jsp也可以了。
发表于 2003-5-29 20:09:35 | 显示全部楼层
好!
发表于 2003-5-31 21:54:37 | 显示全部楼层
版本比较旧,但可以参考安装的方法,谢谢兄弟了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表