QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2780|回复: 5

小弟有个问题,在网上找了很久没有找到解决的办法,望高人指点!

[复制链接]
发表于 2006-5-2 16:07:31 | 显示全部楼层 |阅读模式
小弟搭建了:Redhat9+Apache+Mysql+PHP+GD2+Perl+tomcat 

软件版本:

Linux RedHat 9.0 

mysql-4.0.23a.tar  

php-4.3.10.tar.gz 

zlib-1.2.2.tar.gz  

freetype-2.1.9.tar.gz 

libpng-1.2.5.tar.gz

gd-2.0.33.tar.gz  

DBI-1.46.tar.gz  

DBI-1.46.tar.gz

httpd-2.0.52.tar.gz

jakarta-tomcat-5.5.7.tar.gz

jdk-1_5_0_01-linux-i586.bin

jakarta-tomcat-connectors-jk2-src-current.tar.tar

安装过程:

1.我先完成安装php,测试php环境正常.

2.安装jsp,测试apache+tomcat环境正常

现在怎么重新配置,才能使服务器能够同时支持php与jsp?性能怎么样?

小弟比较菜.望高人详细指点下,感激万分!
发表于 2006-5-2 18:01:41 | 显示全部楼层
tomcat的官方文档很丰富滴http://tomcat.apache.org/tomcat-5.5-doc/setup.html

而且Jackey是Java master,配置的tomcat很安全
回复

使用道具 举报

 楼主| 发表于 2006-5-5 18:45:45 | 显示全部楼层
斑竹您好!
很感谢您的回答!!
我现在的情况是:
1、jsp的tomcat+apache+mysql 的整合已经完成了,并且可以正常的执行。
2、php的Apache+Mysql+PHP+GD2+Perl,也已经整合完成了,并且已经可以正常执行。
我先安装的是php,可以正常执行php。再安装jsp的环境,当我把httpd.conf中的web的根目录改为jsp的webapps后,就不能执行php文件了(可以正常执行jsp文件,执行php是下载)。
我觉得应该是tomcat配置需要修改,但是我现在应该怎么修改才能,才能使php与jsp能够在一台服务器上可以正常运行,由于小弟的英语水平比较差,望斑竹能够抽点时间,讲解下,小弟万分感激。
回复

使用道具 举报

发表于 2006-5-6 13:24:33 | 显示全部楼层
你需要安装一个apache2的模块,叫mod_jk, 如果你成功配置了mod_jk后就可以同时让php和jsp脚步混合使用。
回复

使用道具 举报

 楼主| 发表于 2006-5-12 08:51:05 | 显示全部楼层
Apache/2.0.52 (Unix) mod_jk2/2.0.0 DAV/2 PHP/4.3.10
我的httpd.conf已经能够找到这些模块

以下是我的具体配置:

httpd.conf:

ServerRoot "/usr/local/apache"
Listen *:80
LoadModule  jk2_module  modules/mod_jk2.so
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
LoadModule auth_dbm_module modules/mod_auth_dbm.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule log_forensic_module modules/mod_log_forensic.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imap_module modules/mod_imap.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php4_module        modules/libphp4.so
DirectoryIndex index.html index.html.var index.php index.jsp
DocumentRoot /usr/local/tomcat/webapps/

ServerName 220.197.x.x
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps

workers2.properties:
level=DEBUG

[config:]
file=${serverRoot}/conf/workers2.properties
debug=0
debugEnv=0

[uriMap:]
info=Maps the requests. Options: debug
debug=0

# Alternate file logger
#[logger.file]
#level=DEBUG
#file=${serverRoot}/logs/jk2.log

[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=${serverRoot}/logs/jk2.shm
size=1000000
debug=0
disabled=0

[workerEnv:]
info=Global server options
timing=1
debug=0
# Default Native Logger (apache2 or win32 )
# can be overriden to a file logger, useful
# when tracing win32 related issues
#logger=logger.file:0

[lb]
info=Default load balancer.
debug=0

[lb]
info=A second load balancer.
debug=0

[channel.socket:localhost]
info=Ajp13 forwarding over socket
debug=0
tomcatId=localhost:8009

[channel.socket:localhost]
info=A second tomcat instance.
debug=0
tomcatId=localhost:8019
lb_factor=1
group=lb
group=lb_1
disabled=0

[channel.un:/opt/33/work/jk2.socket]
info=A second channel connecting to localhost:8019 via unix socket
tomcatId=localhost:8019
lb_factor=1
debug=0

[channel.jni]
info=The jni channel, used if tomcat is started inprocess

[status:]
info=Status worker, displays runtime informations

[vm:]
info=Parameters used to load a JVM in the server process
#JVM=C:\jdk\jre\bin\hotspot\jvm.dll
classpath=${TOMCAT_HOME}/bin/tomcat-jni.jar
classpath=${TOMCAT_HOME}/server/lib/commons-logging.jar
OPT=-Dtomcat.home=${TOMCAT_HOME}
OPT=-Dcatalina.home=${TOMCAT_HOME}
OPT=-Xmx128M
#OPT=-Djava.compiler=NONE
disabled=1

[worker.jni]
info=Command to be executed by the VM on startup. This one will start tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=start
# For Tomcat 5 use the 'stard' for startup argument
# ARG=stard
disabled=1
stdout=${serverRoot}/logs/stdout.log
stderr=${serverRoot}/logs/stderr.log

[worker.jni]
info=Command to be executed by the VM on shutdown. This one will stop tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=stop
disabled=1

[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
group=status:

[uri:127.0.0.1]
info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to test it
alias=myVirtualHost:8003

[uri:127.0.0.1:8003/ex]
info=Example webapp in the virtual host. It'll go to lb_1 ( i.e. localhost:8019 )
context=/ex
group=lb_1

[uri:/examples]
info=Example webapp in the default context.
context=/examples
debug=0

[uri:/examples1/*]
info=A second webapp, this time going to the second tomcat only.
group=lb_1
debug=0

[uri:/examples/servlet/*]
info=Prefix mapping

[uri:/examples/*.jsp]
info=Extension mapping

[uri:/examples/*]
info=Map the whole webapp

[uri:/examples/servlet/HelloW]
info=Example with debug enabled.
debug=10
# Map the Tomcat examples webapp to the Web server uri space
[uri:/*.jsp]
info=Map the whole webapp
# list of needed handlers.
handler.list=channelSocket,request
# Override the default port for the channelSocket
channelSocket.port=8009
[uri:/lybbs/*]
info=Map the whole webapp
# list of needed handlers.
handler.list=channelSocket,request
# Override the default port for the channelSocket
channelSocket.port=8009
回复

使用道具 举报

 楼主| 发表于 2006-5-12 08:54:22 | 显示全部楼层
在我修改成jsp的配置前可以正常执行php
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-25 11:40 , Processed in 0.074815 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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