具体步骤如下:
a:解决apr not found问题>>>>>>
[iyunv@xt test]# tar -zxf apr-1.4.5.tar.gz
[iyunv@xt test]# cd apr-1.4.5
[iyunv@xt apr-1.4.5]# ./configure --prefix=/usr/local/apr
[iyunv@xt apr-1.4.5]# make && make install
b:解决APR-util not found问题>>>>
[iyunv@xt test]# tar -zxf apr-util-1.3.12.tar.gz
[iyunv@xt test]# cd apr-util-1.3.12
[iyunv@xt apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr
[iyunv@xt apr-util-1.3.12]# make && make install
##=====================================================================================================================================================
4 安装tomcat-connector
[iyunv@www java]# wget http://archive.apache.org/dist/jakarta/tomcat-connectors/jk/source/jk-1.2.15/jakarta-tomcat-connectors-1.2.15-src.tar.gz
[iyunv@www java]# tar xzvf jakarta-tomcat-connectors-1.2.15-src.tar.gz
[iyunv@www java]# cd jakarta-tomcat-connectors-1.2.15-src/jk/native
[iyunv@www jakarta-tomcat-connectors-1.2.15-src ]# ./configure --with-apxs=/usr/local/apache2/bin/apxs
[iyunv@www jakarta-tomcat-connectors-1.2.15-src]# make
[iyunv@www java]# cp /usr/local/apache2 /mod_jk.so /usr/local/apache2/modules/
5 在/usr/local/apache2/conf/下面建立两个配置文件mod_jk.conf和workers.properties。
[iyunv@www java]# vi mod_jk.conf
添加以下内容:
JkWorkersFile /usr/local/apache2/conf/workers.properties
# Where to put jk logs
JkLogFile /usr/local/apache2/logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# 将所有servlet 和jsp请求通过ajp13的协议送给Tomcat,让Tomcat来处理
JkMount /servlet/* worker1
JkMount /*.jsp worker1
[iyunv@www java]# vi workers.properties
添加以下内容:
# Defining a worker named worker1 and of type ajp13
worker.list=worker1
# Set properties for worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
再配置httpd.conf,作以下修改:
[iyunv@www java]# vi /usr/local/apache2/ conf/httpd.conf
增加关于加载mod_jk的语句:
LoadModule jk_module modules/mod_jk.so
Include /usr/local/apache2/conf/mod_jk.conf
5.安装设置完毕,之后使用只需启动-连接-断开-关闭,命令如下:
[iyunv@CentOS mysql]# service mysql start
Starting MySQL.. [确定]
[iyunv@CentOS mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.22 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.07 sec)
mysql> exit;
Bye
[iyunv@CentOS mysql]# service mysql stop
Shutting down MySQL. [确定]
6.其它:
查看进程命令 ps –ef|grep mysqld
kill进程命令 kill –9 进程号