当前位置: 首页 > 工具软件 > WCP > 使用案例 >

CentOS7.6搭建开源WCP知识管理系统

姬英武
2023-12-01

CentOS7.6搭建开源WCP知识管理系统

一、环境简介

1、操作系统:CentOS7.6 (minimal install)
2、依赖服务:JDK 1.8.0_212,OpenOffice 4.1.10
3、网页服务:tomcat 8.5.69
4、数据库:mariadb 5.5.60
5、知识管理系统:WCP free 4.3.0
相关资源:点击获取
提取码:jvt4

二、安装JDK和tomcat

关闭selinux:
setenforce 0
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config

将JDK包移动并解压至/usr/local目录中:
mv jdk-8u212-linux-x64.tar.gz /usr/local
cd /usr/local
tar -zxf jdk-8u212-linux-x64.tar.gz
mv jdk1.8.0_212 jdk1.8
添加Java环境变量:
echo "export JAVA_HOME=/usr/local/jdk1.8" >> /etc/profile
echo "export JRE_HOME=${JAVA_HOME}/jre" >> /etc/profile
echo "export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar" >> /etc/profile
echo "export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin" >> /etc/profile

将tomcat包移动并解压至/usr/local目录中:
mv apache-tomcat-8.5.69.tar.gz /usr/local
cd /usr/local
mv apache-tomcat-8.5.69 tomcat8
添加tomcat环境变量:
echo "export CATALINA_HOME=/usr/local/tomcat8" >> /etc/profile
echo "export PATH=$PATH:${JAVA_PATH}:${CATALINA_HOME}" >> /etc/profile
使添加的环境变量立即生效:
source /etc/profile

查看Java版本:java -version
java version "1.8.0_212"
Java(TM) SE Runtime Environment (build 1.8.0_212-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.212-b10, mixed mode)

添加tomcat服务:
cp /usr/local/tomcat8/bin/catalina.sh /etc/init.d/tomcat
编辑/etc/init.d/tomcat文件,在第二行添加 :
CATALINA_HOME=/usr/local/tomcat8/
#chkconfig:2345 10 90
设置tomcat服务开机自启:
chkconfig tomcat on

启动tomcat:
service tomcat start
登录网页查看是否正常:http://IP:8080

三、安装mariadb

卸载系统自带mariadb lib包:
rpm -qa | grep mariadb-libs*
rpm -e --nodeps mariadb-libs*
安装mariadb:
yum install mariadb mariadb-server -y
启动mariadb并设为开机自启:
systemctl start mariadb
systemctl enable mariadb
初始化数据库:
mysql_secure_installation
Enter current password for root (enter for none):<–初次运行直接回车
Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
New password: <– 设置root用户的密码
Re-enter new password: <– 再输入一次你设置的密码
Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车
Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车,
Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车
Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车

四、安装openoffice

安装依赖:
yum groupinstall "X Window System"
安装openoffice
tar -zxvf Apache_OpenOffice_4.0.0_Linux_x86-64_install-rpm_zh-CN.tar.gz -C /data/soft/
cd /data/soft/zh-CN/RPMS
yum localinstall *.rpm
cd /RPMS/desktop-integration
yum localinstall openoffice4.0-redhat-menus-4.0-9702.noarch.rpm
启动openoffice
nohup /opt/openoffice4/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &
检查是否启动:
netstat -lnp | grep 8100
tcp   0  0 127.0.0.1:8100   0.0.0.0:*    LISTEN   13903/soffice.bin

五、部署WCP

将zip包解压:
unzip WCP.free.4.3.0.u.base.Setup.zip
mv WCP.free.4.3.0.u.base.Setup wcp
复制网页程序到tomcat指定路径中:
cd /root/install_files/wcp/webs
mv ROOT wcp
cp -p wcp wda /usr/local/tomcat8/webapps
设置mysql大小写不敏感:
vi /etc/my.cnf
在[mysqld]部分添加:
lower_case_table_names=1
重启数据库:
systemctl restart mariadb
新建wcp数据库并导入初始数据:
mysql -uroot -p
MariaDB [(none)]>create database wcp character set utf8;
MariaDB [(none)]>use wcp;
MariaDB [(none)]>source /root/install_files/wcp/sql/wcp.free.v4.3.0.all.sql;
配置wcp网页程序与数据库的连接:
vi /usr/local/tomcat8/webapps/wcp/WEB-INF/classes/jdbc.properties
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc\:mysql\://127.0.0.1\:3306/wcp?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=Your password
配置wcp网页程序taglib
vi /usr/local/tomcat8/webapps/wcp/WEB-INF/web.xml
在jsp-config中添加如下内容:
<taglib>
	<taglib-uri>/view/conf/farmdoc.tld</taglib-uri>
	<taglib-location>/view/conf/farmdoc.tld</taglib-location>
</taglib>
<taglib>
	<taglib-uri>/view/conf/farmtag.tld</taglib-uri>
	<taglib-location>/view/conf/farmtag.tld</taglib-location>
</taglib>
<taglib>
	<taglib-uri>/view/conf/wda.tld</taglib-uri>
	<taglib-location>/view/conf/wda.tld</taglib-location>
</taglib>
不添加可能会报如下错误:
Unable to find taglib [PF] for URI: [/view/conf/farmtag.tld]

六、登录验证

网页访问:http://IP:8080/wcp
输入初始账号密码,进入应用:sysadmin/111111

 类似资料: