CSDN博客

img echoguo

RedHat Linux下tomcat5.0.28 +apache2.0.50+php4.3.9安装配置[原]

发表于2004/9/23 10:14:00  1566人阅读

作者:Echo.Guo
@LoveUnix.net


所需软件:
httpd-2.0.50.tar.gz
j2sdk-1_4_2_05-linux-i586-rpm.bin
jakarta-tomcat-5.0.28.tar.gz
php-4.3.9.tar.gz
mysql-standard-4.0.21-pc-linux-i686.tar.gz
预先放在/usr/local/下

目的:一个web服务同时支持php和jsp页面

1.安装jdk
#chmod 755 j2sdk-1_4_2_05-linux-i586-rpm.bin
#./j2sdk-1_4_2_05-linux-i586-rpm.bin
生成j2sdk-1_4_2_05-linux-i586.rpm
#rpm -iv j2sdk-1_4_2_05-linux-i586.rpm
默认安装在/usr/j2sdk1.4.2.05


2.安装tomcat

tar -zxf jakarta-tomcat-5.0.28.tar.gz
ln -s /usr/local/jakarta-tomcat-5.0.28 /usr/local/tomcat
less /usr/local/tomcat/conf/server.xml
代理端口 8082
    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
    <!-- See proxy documentation for more information about using this. -->
    <Connector port="8082"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false"
               acceptCount="100" debug="0" connectionTimeout="20000"
               proxyPort="80" disableUploadTimeout="true" />


/usr/local/tomcat/conf/server.xml修改

      <Host name="localhost" debug="0" appBase="webapps"
 #unpackWARs="true" autoDeploy="true"      
 unpackWARs="false" autoDeploy="false"
       xmlValidation="false" xmlNamespaceAware="false">


/usr/local/tomcat/bin/startup.sh添加


export JAVA_HOME=/usr/java
export CATALINA_BASE=/usr/local/tomcat
export CATALINA_HOME=/usr/local/tomcat
export CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/lib:$JAVA_HOME/jre/bin:$PATH:$HOME/bin

然后 ./startup.sh 启动tomcat


3.安装apache

tar xvfz httpd-2.0.47.tar.gz
./configure --enable-proxy=shared --enable-proxy_http=shared > --prefix=/usr/local/apache --enable-so
make
make install


修改httpd.conf

文件末尾添加
ProxyPass /jsp/ http://(tomcat IP):8082/jsp/
ProxyPassReverse /jsp/ http://(tomcat IP):8082/jsp/


4.安装php

tar xvfz php-4.3.4.tar.gz
cd php-4.3.4
./configure --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --enable-track-vars --with-gd --with-zlib --with-xml
make 
make install
cp php.ini-dist /usr/local/lib/php.ini

注:在configure的时候可能会出现错误
缺少bsion和flex
下载一个rpm包装上就可以
rpm -ivh bison-1.35-1.i386.rpm
rpm -ivh flex-2.5.4a-29.i386.rpm


5.配置httpd.conf
在AddType 里加入一行
AddType application/x-httpd-php .php

注:LoadModule php4_module modules/libphp4.so 一行,不要手工加
否则会出错

然后重起apache
/usr/local/apache/bin/apachectl restart

就可以测试一下

在tomcat的webapps下放一个jsp目录
里面放一个.jsp文件

在apache的htdocs下放一个test.php
内容为:
<?
phpinfo();
?>


6.安装mysql


tar xvfz mysql-standard-4.0.21-pc-linux-i686.tar.gz
解压之后
mysql-standard-4.0.21-pc-linux-i686
#ln -s /usr/local/mysql-standard-4.0.21-pc-linux-i686 /usr/local/mysql

就ok

剩下配置:
去mysql的suport-files目录下,随便挑一个.cnf文件
#cp my-medium.cnf /etc/my.cnf
修改/etc/my.cnf,直接到mysqld那一节

# The MySQL server
[mysqld]
port            = 3306
socket          = /var/lib/mysql/mysql.sock
skip-locking
set-variable    = thread_stack=1M
set-variable    = key_buffer=256M
set-variable    = max_allowed_packet=10M
set-variable    = table_cache=256
set-variable    = sort_buffer=10M
set-variable    = record_buffer=10M
set-variable    = myisam_sort_buffer_size=64M
set-variable    = thread_cache=18
# Try number of CPU's*2 for thread_concurrency
set-variable    = thread_concurrency=8
log-bin
server-id       = 1


#./scripts/mysql_install_db
你可以看到数据库目录下增加了两个目录 mysql 和 test。
然后启动:
#./bin/safe_mysqld &

 


 

0 0

相关博文

我的热门文章

img
取 消
img