小弟有个问题,在网上找了很久没有找到解决的办法,望高人指点!
小弟搭建了: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?性能怎么样?
小弟比较菜.望高人详细指点下,感激万分! tomcat的官方文档很丰富滴http://tomcat.apache.org/tomcat-5.5-doc/setup.html
而且Jackey是Java master,配置的tomcat很安全 :mrgreen: 斑竹您好!
很感谢您的回答!!
我现在的情况是:
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能够在一台服务器上可以正常运行,由于小弟的英语水平比较差,望斑竹能够抽点时间,讲解下,小弟万分感激。 你需要安装一个apache2的模块,叫mod_jk, 如果你成功配置了mod_jk后就可以同时让php和jsp脚步混合使用。 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
LoadModulejk2_modulemodules/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
file=${serverRoot}/conf/workers2.properties
debug=0
debugEnv=0
info=Maps the requests. Options: debug
debug=0
# Alternate file logger
#
#level=DEBUG
#file=${serverRoot}/logs/jk2.log
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=${serverRoot}/logs/jk2.shm
size=1000000
debug=0
disabled=0
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
info=Default load balancer.
debug=0
info=A second load balancer.
debug=0
info=Ajp13 forwarding over socket
debug=0
tomcatId=localhost:8009
info=A second tomcat instance.
debug=0
tomcatId=localhost:8019
lb_factor=1
group=lb
group=lb_1
disabled=0
info=A second channel connecting to localhost:8019 via unix socket
tomcatId=localhost:8019
lb_factor=1
debug=0
info=The jni channel, used if tomcat is started inprocess
info=Status worker, displays runtime informations
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
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
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
info=Display status information and checks the config file for changes.
group=status:
info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to test it
alias=myVirtualHost:8003
info=Example webapp in the virtual host. It'll go to lb_1 ( i.e. localhost:8019 )
context=/ex
group=lb_1
info=Example webapp in the default context.
context=/examples
debug=0
info=A second webapp, this time going to the second tomcat only.
group=lb_1
debug=0
info=Prefix mapping
info=Extension mapping
info=Map the whole webapp
info=Example with debug enabled.
debug=10
# Map the Tomcat examples webapp to the Web server uri space
info=Map the whole webapp
# list of needed handlers.
handler.list=channelSocket,request
# Override the default port for the channelSocket
channelSocket.port=8009
info=Map the whole webapp
# list of needed handlers.
handler.list=channelSocket,request
# Override the default port for the channelSocket
channelSocket.port=8009 在我修改成jsp的配置前可以正常执行php
页:
[1]