1,修改httpd.conf
找到下面脚本,如果前面有“#”,删掉“#”
LoadModule rewrite_module modules/mod_rewrite.so
在LoadMoudle下面添加以下脚本
DocumentRoot "/wd/htdocs"
<Directory "/wd/htdocs">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
在文件结尾处添加下面两行
Include /wd/apache2/conf/mod_jk.conf
Include /wd/apache2/conf/rewrite.conf
2,编辑mod_jk.conf,内容如下:
LoadModule jk_module modules/mod_jk.so
JkWorkersFile /wd/apache2/conf/workers.properties
JkLogFile "|/wd/apache2/bin/rotatelogs /wd/apache2/logs/mod_jk/mod_jk.log.%Y-%m-%d 86400"
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /meeting/* worker1
3,编辑rewrite.conf, 内容如下:
rewritelog /wd/apache2/logs/rewrite.log
rewriteloglevel 9
rewriteengine on
rewriterule ^/admin$ /meeting/pages/admin/login.jsp [R=301]
rewriterule ^/wap$ /meeting/pages/wap/login.jsp [R=301]
rewriterule ^/portal$ /meeting/pages/portal/login.jsp [R=301]
rewriterule ^/$ /meeting/ [R=301]
rewriterule ^/meeting$ /meeting/ [R=301]
4, 编辑worker.properties
worker.list=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
5, 备份和导入数据库
备份:文件名加上日期
mysqldump -u root -p meeting > meeting-0118.sql
导入:
mysql -uroot
mysql> use meeting
mysql>source meeting-0118.sql
6, 备份上传文件
压缩:
tar -zcvf htdocs-0118.tar.gz /wd/htdocs
解压:
tar -zxvf htdocs-0118.tar.gz
7,修改mysql配置
/etc/my.cnf
lower_case_table_names=1
character_set_server = utf8
default-character-set = utf8
8, 修改tomcat, conf/server.xml
添加URIEncoding="UTF-8"到端口8009
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"
maxThreads="1024" minSpareThreads="50" maxSpareThreads="100"
acceptCount="1024" connectionTimeout="30000" enableLookups="false"
URIEncoding="UTF-8"/>