主机同时运行JSP和PHP
单位需要上一个php项目,但只有一个域名,服务器操作系统是redhat 4.7,已经布署了tomcat,重做或合并都不可能,但又必须共用一台主机,想到了用apache http server,用jk和tomcat连接,安装了php和mysql,前后花了不少时间,总算成功了,现记录如下:
1、redhat4.7安装yum
redhat4.7默认没有安装yum,用yum安装软件确实比rpm方便,依赖性不用考虑,但有时也有找不到包的时候。
redhat5默认已安装了yum,只需直接配置就可以了
下载 yum wget http://www.parallels.com.cn/downloads/Prima/Tools/yum_forAS4.tar.gz
解压 tar xzvf yum_forAS4.tar.gz
进入目录 cd yum_forAS4 #
安装 rpm -ivh *.rpm
cd /etc/yum.repos.d/
vi CentOS-Base.repo
# CentOS-Base.repo[base]name=CentOS-4.7 - Base - mirrors.ustc.edu.cnbaseurl=http://vault.centos.org/4.7/os/$basearch/gpgcheck=1gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-4#released updates[updates]name=CentOS-4.7 - Updates - mirrors.ustc.edu.cnbaseurl=http://vault.centos.org/4.7/updates/$basearch/gpgcheck=1gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-4#additional packages that may be useful[extras]name=CentOS-4.7 - Extras - mirrors.ustc.edu.cnbaseurl=http://vault.centos.org/4.7/extras/$basearch/gpgcheck=1gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-4#packages used/produced in the build but not released[addons]name=CentOS-4.7 - Addons - mirrors.ustc.edu.cnbaseurl=http://vault.centos.org/4.7/addons/$basearch/gpgcheck=1gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-4#additional packages that extend functionality of existing packages[centosplus]name=CentOS-4.7 - Plus - mirrors.ustc.edu.cnbaseurl=http://vault.centos.org/4.7/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-4#contrib - packages by Centos Users[contrib]name=CentOS-4.7 - Contrib - mirrors.ustc.edu.cnbaseurl=http://vault.centos.org/4.7/contrib/$basearch/gpgcheck=1enabled=0gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-4
# Define 1 real worker using ajp13worker.list=worker1# Set properties for worker1 (ajp13)worker.worker1.type=ajp13worker.worker1.host=localhostworker.worker1.port=8009
# Load mod_jk module# Update this path to match your modules locationLoadModule jk_module modules/mod_jk.so# Where to find workers.properties# Update this path to match your conf directory location (put workers.properties next to httpd.conf)JkWorkersFile /etc/httpd/conf/workers.properties# Where to put jk shared memory# Update this path to match your local state directory or logs directoryJkShmFile /var/log/httpd/mod_jk.shm# Where to put jk logs# Update this path to match your logs directory location (put mod_jk.log next to access_log)JkLogFile /var/log/httpd/mod_jk.log# Set the jk log level [debug/error/info]JkLogLevel info# Select the timestamp log formatJkLogStampFormat "[%a %b %d %H:%M:%S %Y] "# Send everything for context /examples to worker named worker1 (ajp13)JkMount /examples/* worker1