关闭

mvnForum 一个开源的BBS搭建过程

标签: bbsdatabasetomcat数据库oracle邮件服务器
837人阅读 评论(0) 收藏 举报
分类:

mvnForum 一个开源的BBS搭建过程- -

mvnForum是一个不错的基于jsp的开源BBS,搭建的全过程如下(数据库使用的是
oracle,它也支持MySQL等数据库; AppServer用的是Tomcat):
搭建mvnForum 1.0.0-rc3_01
1、建立数据库:执行/sql/mvnForum_oracle9.sql
2、修正上传文件的中文问题(使用commons-fileupload-1.0代替原来的文件上传模块)
(1) 下载commons-fileupload-1.0源码:http:
//jakarta.apache.org/commons/fileupload/
用package java.org.apache.commons.fileupload 下面的内容覆盖
net.myvietnam.mvncore.fileupload 下面内容并更改包名称
(2) 修改使用fileupload的内容
1.修改com.mvnforum.user.AttachmentWebHandler
将146行 void processAdd(HttpServletRequest request) 方法内
FileUpload fileUpload = new FileUpload();
改为
//FileUpload fileUpload = new FileUpload();
DiskFileUpload fileUpload = new DiskFileUpload();
if (request.getCharacterEncoding() == null)
{
fileUpload.setHeaderEncoding("UTF-8");
}
else
{
fileUpload.setHeaderEncoding(request.getCharacterEncoding());
}
将280行 void prepareDelete(HttpServletRequest request) 方法内
attachFileItem.write(filename);
改为
attachFileItem.write(new File(filename));

2.修改com.mvnforum.admin
将132行 public static void importXmlZip(HttpServletRequest request,
HttpServletResponse response) 方法内
FileUpload fileUpload = new FileUpload();
改为
//FileUpload fileUpload = new FileUpload();
DiskFileUpload fileUpload = new DiskFileUpload();
将250行同一个方法内
clientImportFileItem.write(filepath);
importFile=new File(filepath);
改为
importFile = new File(filepath);
clientImportFileItem.write(importFile);

3.修改com.mvnforum.user.MemberWebHandler
将522行 void uploadAvatar(javax.servlet.ServletConfig config,
HttpServletRequest request) 方法内
FileUpload fileUpload = new FileUpload();
改为
//FileUpload fileUpload = new FileUpload();
DiskFileUpload fileUpload = new DiskFileUpload();

3、设置Log4j属性:
将/mvnforum/WEB-INF/classes/log4j.properties
修改
log4j.rootLogger=DEBUG, A1, A3
并添加
log4j.appender.A3=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A3.File=%TOMCAT_HOME%/webapps/mvnforum/WEB-INF/mvnForumHome/log/mvnForumLog.txt
log4j.appender.A3.Append=true
log4j.appender.A3.DatePattern='.'yyyy-MM-dd
log4j.appender.A3.layout=org.apache.log4j.PatternLayout
log4j.appender.A3.layout.ConversionPattern=%-5r %-5p [%t] %c{2} - %m%n
4、设置论坛默认设置:
/mvnforum/WEB-INF/classes/mvnforum.xml
修改
<mvnforum_home>%TOMCAT_HOME%/webapps/mvnforum/WEB-INF/mvnForumHome</mvnforum_home>
<webmaster_email>youremail@yourdomain.com</webmaster_email>
<logo_url>http://www.mvnForum.com</logo_url>
<supported_locales>en;zh_CN;zh_TW</supported_locales>
<default_locale_name>zh_CN</default_locale_name>
<max_attachment_size>1MB</max_attachment_size>
5、设置数据库连接和邮件服务器:
/mvnforum/WEB-INF/classes/mvncore.xml
修改
<driver_class_name>oracle.jdbc.driver.OracleDriver</driver_class_name>
<database_url>jdbc:oracle:thin:@10.10.100.25:1521:ctpdemo</database_url>
<database_user>MVMOUSE</database_user>
<database_password>****</database_password>
<max_connection>20</max_connection>
<max_time_to_wait>2000</max_time_to_wait>
<minutes_between_refresh>30</minutes_between_refresh>
<mailoptions>
<mail_server>smtp.echannels.com.cn</mail_server>
<default_mail_from>zhanghao@echannels.com.cn</default_mail_from>
<username>zhanghao</username>
<password>****</password>
<port>25</port>
</mailoptions>
<paramoptions>
<context_path>/mvnforum</context_path>
<server_path>http://192.168.1.2:8080</server_path>
</paramoptions>
6、中文化
将/mvnforum/mvnplugin/mvnforum/user/zh_CN下的文件拷贝到/mvnforummvnplugin/ mvnforum/user下面
7、将源文件中mvnforum/template拷贝到%TOMCAT_HOME%/webapps/mvnforum/template
8、管理员登陆:
mvnforumadmin/index
user:admin
pass:admin

 

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1503151

 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:93926次
    • 积分:1165
    • 等级:
    • 排名:千里之外
    • 原创:7篇
    • 转载:78篇
    • 译文:0篇
    • 评论:7条
    文章分类
    最新评论