[TOC]

0x00 快速入门

参考资料
https://www.cnblogs.com/Jeely/p/11224267.html
https://blog.csdn.net/wah1870714/article/details/86519590

0x01 搭建安装环境

JEECMSV9环境安装与搭建:

  • 系统环境:CentOS-7
  • 应用环境: JDK8 / Tomcat9 / Mysql5.7
    $ ls /app/ (注意在这个目录)
    CentOS-7-x86_64-Minimal-1810.iso
    apache-tomcat-9.0.22.tar.gz
    jdk-8u211-linux-x64.tar.gz
    mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz
    jeecmsv9.3-ROOT.zip


1.基础环境搭建(不论安装数据库的主机还是应用主机都要操作):

#!/bin/bash
#基础设置
sed -i '#' /etc/ssh/sshd_config
sed -i '/ONBOOT/s/on/yes' /etc/sysconfig/network-scripts/ifcfg-ens33
systemctl restart network sshd

#关闭Seliunx
sed -i '/SELINUX/s/enforcing/disabled/' /etc/sysconfig/selinux
setenforce 0

#卸载自动mariadb数据库
oldmysql=$(rpm -qa | grep "mariadb")
if [ $? -eq 0 ];then
4rpm -e --nodeps $oldmysql && echo "RPM 卸载成功"
fi

#更新系统以及内核与采用阿里云的yum源
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/CentOS-epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all && yum makecache
yum update -y && yum upgrade -y && yum -y install epel*
yum install -y nano vim net-tools tree wget dos2unix unzip gcc gcc-c++ openssl-devel bzip2-devel

#防火墙设置
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload

#设置完成后重启系统
reboot


2.网站Tomcat服务主机操作:

#建立应用目录
mkdir -vp /app/

#解压JDK与Tomcat
tar -zxf jdk-8u211-linux-x64.tar.gz -C /usr/local/
tar -zxf apache-tomcat-9.0.22.tar.gz -C /app/
mv apache-tomcat-9.0.22/ tomcat-9.0.22/

#WEB用户建立
groupadd -g 501 tomcat
useradd -r -g tomcat -s /sbin/nologin tomcat

#环境设置 - 实际中业务上线总站库要分离
cat >/etc/profile<<END
export JAVA_HOME=/usr/local/jdk1.8.0_211
export JRE_HOME=/usr/local/jdk1.8.0_211/jre
export TOMCAT_HOME=/app/tomcat-9.0.22
export CATALINA_HOME=/app/tomcat-9.0.22
export MYSQL_HOME=/usr/local/mysql-5.7.27
export CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar:\$CATALINA_HOME/lib/servlet-api.jar
export PATH=\$PATH:\$JAVA_HOME/bin:\$TOMCAT_HOME/bin:\$MYSQL_HOME/bin
END
source /etc/profile

#权限和所属组改变
chown -R root:tomcat /usr/local/jdk1.8.0_211
chown -R tomcat:tomcat /app/tomcat-9.0.22


3.数据库主机操作:

#建立数据库应用数据存放目录
mkdir -vp /app/mysql5.7/{data,log,temp} /var/lib/mysql

#MYSQL用户建立
groupadd -g 500 mysql
useradd -r -g mysql -s /sbin/nologin mysql

#数据库解压
tar -zxf mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz -C /usr/local
mv /usr/local/mysql-5.7.27-linux-glibc2.12-x86_64 /usr/local/mysql-5.7.27

#数据库配置/etc/my.cnf
cat >/etc/my.cnf<<END
#编辑 /etc/my.cnf
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
socket=/var/lib/mysql/mysql.sock

[mysqld]
#skip-name-resolve
user=mysql #先设置以root用户运行,运行后再更改为mysql注意各个目录文件夹所属用户
#设置3306端口
port = 3306
#socket与上面一致
socket=/var/lib/mysql/mysql.sock
# 设置mysql的安装目录
basedir=/usr/local/mysql-5.7.27
# 设置mysql数据库的数据的存放目录
datadir=/app/mysql5.7/data
pid-file=/app/mysql5.7/data/mysql.pid
#skip-grant-tables #此项是为了装好后免登陆修改密码使用 (修改后注释即可)
#错误信息
log-error=/app/mysql5.7/log/mysql-err.log
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
#lower_case_table_name=1
max_allowed_packet=16M
#解决问题time不能为0000-00-00
sql-mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
END


#文件夹目录权限设置
chown -R mysql:mysql /usr/local/mysql-5.7.27 /app/mysql5.7 /var/lib/mysql

#初始化数据库(生成数据)
/usr/local/mysql-5.7.27/bin/mysqld --defaults-file=/etc/my.cnf --initialize --user=mysql

#配置启动参数与启动数据库
cp /usr/local/mysql-5.7.27/support-files/mysql.server /etc/init.d/mysqld
#修改/etc/init.d/mysqld中的(实际路径)
$vim /etc/init.d/mysqld
# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.
basedir=/usr/local/mysql-5.7.27
datadir=/app/mysql5.7/data

#设置mysql客户端的路径,否则必须加载绝对路径才能执行
export PATH=$PATH:/usr/local/mysql-5.7.27/bin

/etc/init.d/mysqld start #启动mysql

#获取登录密码
egrep -o '[email protected]: (\S)*' /app/mysql5.7/log/mysql-err.log | cut -d " " -f2
# j2<#v&QkwRgu

#登录更改root密码并设置低权限mysql用户
mysql -u root -p #输入上面的密码
mysql> set password = password('[email protected]');
mysql> use mysql
mysql> update user set host = '%' where user = 'root'; #使其被任何主机连接(不安全
# mysql> update user set authentication_string = '' where user = 'root'; #清空root的密码 在skip0granbt-tables处使用
mysql> CREATE USER 'web'@'%' IDENTIFIED BY 'weiyigeek';
mysql> GRANT ALL ON *.* TO 'web'@'%';
mysql> flush privileges;

#重启数据库尝试连接
/etc/init.d/mysqld start


4.Jeecmsv9系统安装包部署(不懂java采用这种方式)

#解压安装包到tomca中Webapps中的ROOT中
unzip /app/jeecmsv9.3-ROOT.zip
rm -rf /app/tomcat-9.0.22/webapps/ROOT/
cp -r /app/ROOT /app/tomcat-9.0.22/webapps/ROOT/

#为了可以正常安装还需要修改/app/tomcat-9.0.22/conf/web.xml 和 webapps/ROOT/WEB-INF/web.xml
#在web.xml加一个标签:在</web-app>前即可
<absolute-ordering />


#权限修改
chown -R tomcat:tomcat /app/tomcat-9.0.22

#启动tomcat和停止tomcat
/app/tomcat-9.0.22/bin/version.sh
# Using CATALINA_BASE: /app/tomcat-9.0.22
# Using CATALINA_HOME: /app/tomcat-9.0.22
# Using CATALINA_TMPDIR: /app/tomcat-9.0.22/temp
# Using JRE_HOME: /usr/local/jdk1.8.0_211/jre
# Using CLASSPATH: /app/tomcat-9.0.22/bin/bootstrap.jar:/app/tomcat-9.0.22/bin/tomcat-juli.jar
# Server version: Apache Tomcat/9.0.22
# Server built: Jul 4 2019 14:20:06 UTC
# Server number: 9.0.22.0
# OS Name: Linux
# OS Version: 3.10.0-957.27.2.el7.x86_64
# Architecture: amd64
# JVM Version: 1.8.0_211-b12
# JVM Vendor: Oracle Corporation

/app/tomcat-9.0.22/bin/catalina.sh start|stop

WeiyiGeek.web修改



5.启动后安装导入数据库表进行相应的配置,访问 http://192.168.17.128:8080/会出现如果您第一次安装,请直接点击JEECMS安装。

WeiyiGeek.

填入我们建立的mysql数据库用户和账号密码

WeiyiGeek.

最终会显示安装完成,需要重启tomcat即可:


/app/tomcat-9.0.22/bin/catalina.sh stop
/app/tomcat-9.0.22/bin/catalina.sh start

WeiyiGeek.安装成功


  1. 测试是否安装成功
    访问首页:
    http://10.10.107.245:8080/

    访问后台:
    http://10.10.107.245:8080/


VueJeecms管理后台安装

依赖与Node.js环境所以需要安装该环境:

wget https://nodejs.org/dist/v10.16.3/node-v10.16.3.tar.gz
tar -zxf node-v10.16.3.tar.gz
cd node-v10.16.3;
./configure --prefix=/usr/local/nodejs #注意后面这个参数
make && make install

#验证安装
node -v
npm -v

#设置模块镜像源安装cnpm官网https://npm.taobao.org/
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm -v #验证安装

#然后再项目工程之中构建Vue
"/mnt/c/Users/WeiyiGeek/Downloads/jeecmsv9-adminVue"

# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report

#启动项目
> cmsv9-cli


0x02 Jeecms 基本配置

Jeecms模板路径: /WEB-INF/t/cms/www
Jeecms资源路径: /r/cms/www
爬虫采集: 运营 -> 采集 (爬取)

1) JeeCms防火墙配置:
配置文件:/app/tomcat-9.0.22/webapps/ROOT/WEB-INF/config/firewall.properties

firewall.domain=
firewall.hour=9,10,11,12,13,14,15,16,17,18,19,20
firewall.ips=
firewall.password=password
firewall.open=true
firewall.week=1,2,3,4,5,6,7

0x0n 入坑记

问题1:首页无法打开显示服务请求发生了错误!

产生原因:
由于设置了站点设置中静态页目录 (使用根目录导致)

解决办法:
设置首页模板为下面这里默认模板路径: /default/index/index.html


问题2:

系统后台登录输入密码错误3次后会要求输入验证码