#yyds干货盘点#安装悟空CRM

时人不识凌云木,直待凌云始道高。这篇文章主要讲述#yyds干货盘点#安装悟空CRM相关的知识,希望能为你提供帮助。
一、安装JDK
?一、去官网下载https://www.oracle.com下载jdk-8u60-linux-x64.tar.gz
?二、解压,并创建软链接

[root@localhost ~ ]# tar zxvf jdk-8u60-linux-x64.tar.gz [root@localhost ~ ]# mv jdk1.8.0_60/ /application/ [root@localhost ~ ]# ln -s/application/jdk1.8.0_60/ jdk#制作软链接

?三、写入环境变量,查看是否安装成功
[root@localhost ~ ]# cat> > /etc/profile < < EOF#写入环境变量 export java_HOME=/application/jdk export JRE_HOME=$JAVA_HOME/jre export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib export PATH=$JAVA_HOME/bin:$PATH EOF [root@localhost ~ ]# ./etc/profile [root@localhost /etc]# java -version java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode) #安装成功

二、安装tomcat
略...
三、安装mysql
略...
四、安装redis
?一、去网站下载redis:http://download.redis.io/releases/ 本次下载的是:redis-4.0.9.tar
?二、解压安装
[root@localhost ~]# yum -y install gcc-C++#安装依赖组件 [root@localhost ~/redis-4.0.9/src]# yum -y install tcl#安装依赖组件 [root@localhost ~]# tar zxvf redis-4.0.9.tar.gz [root@localhost ~]# cd redis-4.0.9 [root@localhost ~]# make [root@localhost ~/redis-4.0.9]# cd src [root@localhost ~/redis-4.0.9/src]# make test#安装测试 [root@localhost ~/redis-4.0.9/src]# make install PREFIX=/data/redis/redis/[root@localhost ~/redis-4.0.9/src]# cd /data/redis_cluster/redis_6379#安装成功后进入文件中 [root@localhost /data/redis_cluster/redis_6379]# ls bin [root@localhost /data/redis_cluster/redis_6379]# mkdir etc#创建redis配置文件目录 [root@localhost /]# cd ~ [root@localhost ~]# cd redis-4.0.9 [root@localhost ~/redis-4.0.9]# mv redis.conf /data/redis_cluster/redis_6379/conf/#将配置文件移动到安装目录下 [root@localhost /]# cd /data/redis_cluster/redis_6379/etc [root@localhost /data/redis_cluster/redis_6379/conf]# vim redis.conf#将redis改为后台启动,将no改为yes daemonize yesredis.conf文件内容:------------------------------------------- #以守护进程模式启动 daemonize yes#绑定主机地址 bind 192.168.100.10 127.0.0.1#监听端 port 6379#pid和log文件所在路径 pidfile /data/redis_cluster/redis_6379/pid/redis_6379.pid logfile /data/redis_cluster/redis_6379/logs/redis_6379.log#设置数据库的数量,默认为0 databases 16#指定本地持久化文件的文件名,默认dump.rdb dbfilename redis_6379.rdb#本地数据库的目录,持久化文件路径 dir /data/redis_cluster/redis_6379/data ------------------------------------------------------------------------------------------------------------#配置redis开机自启 需将文件bin下的文件移动到/usr/local/bin/,/redis目录中的bin就可以删除 一、cd /usr/lib/systemd/system 二、创建redis.service这个文件,内容如下: ------------------------------------------------------------------------------------------------------------ [Unit]Description=RedisAfter=network.target remote-fs.target nss-lookup.target[Service]Type=forkingExecStart=/usr/local/bin/redis-server /data/redis_cluster/redis_6379/conf/redis_6379.conf#启动文件目录ExecStop=kill -INT `cat /tmp/redis.pid`User=redisGroup=redis[Install]WantedBy=multi-user.target ------------------------------------------------------------------------------ 三、cd /etc/systemd/system 四、 ln -s /usr/lib/systemd/system/redis.service redis.service#创建快捷方式 五、创建redis用户,useradd redis 六、将redis目录权限给到redis用户 [root@localhost /etc/systemd/system]# chown -R redis:redis /data/redis_cluster/redis_6379 七、重新加载systemctl [root@localhost /etc/systemd/system]# systemctl daemon-reload 八、使用systemctl start redis 启动redis 九、设置开机自启:systemctl enable redis#启动redis,加入到systemctl后即可:systemctl start redis [root@localhost /opt/soft/redis/etc]# /usr/local/bin/redis-server /data/redis_cluster/redis_6379/conf/redis.conf #查看是否启动成功,6379端口是否正在监听 [root@localhost /opt/soft/redis/etc]# netstat -anpt | grep redis tcp00 127.0.0.1:63790.0.0.0:*LISTEN15486/redis-server #将redis目录下的redis-cli复制到命令目录中 [root@localhost bin]# cp redis-cli/usr/local/bin/ [root@localhost bin]# redis-cli 127.0.0.1:6379>

五、安装maven
一、官网下载软件http://archive.apache.org/dist/maven/maven-3/3.5.4/binaries/
二、解压文件
[root@localhost ~]# tar zxvf apache-maven-3.5.4-bin.tar.gz -C /home [root@localhost /home]# mv apache-maven-3.5.4/ maven

三、增加环境变量
[root@localhost /etc]# vim /etc/profile export MAVEN_HOME=/home/maven export PATH=:$java_HOME/bin:$CATALINA_HOME/bin:$MAVEN_HOME/bin:PATH

六、安装悟空crm
一、网站下载:https://gitee.com/wukongcrm/72crm-java?_from=gitee_search
二、解压文件
[root@localhost /]# unzip -nwukongcrm-72crm-java-master.zip -d /home/wukongcrm/

三、创建数据库,并导入数据。
[root@localhost /]# mysql -uroot -p123456 mysql> create database crm9; mysql> use crm9; mysql> source /home/wukongcrm/72crm-java/docs/crm9.sql;

四、修改数据文件
[root@localhost /]# cd /home/wukongcrm/72crm-java/src/main/resources/config/ [root@localhost /home/wukongcrm/72crm-java/src/main/resources/config]# cp crm9-config.txt crm9-config.txt.bak#修改前先备份一下 [root@localhost /home/wukongcrm/72crm-java/src/main/resources/config]# vim crm9-config.txt ------------------------------------------------------------------------------ #database mysql.jdbcUrl = jdbc:mysql://127.0.0.1:3306/crm9?characterEncoding=utf8& useSSL=false& zeroDateTimeBehavior=convertToNull& tinyInt1isBit=false mysql.user = root mysql.password = 123456 jfinal.devMode = true[root@localhost /home/wukongcrm/72crm-java/src/main/resources/config]# cp redis.json redis.json.bak#备份 [root@localhost /home/wukongcrm/72crm-java/src/main/resources/config]# vim redis.json ------------------------------------------------------------------------------"type":1, "remarks":"1为单机版,2为cluster集群,3为sentinel集群", "cacheName":"master", "host":[ "127.0.0.1:6379" ], "database":7[root@localhost /home/wukongcrm/72crm-java/src/main/resources/config]# cp undertow.txt undertow.txt.bak #备份 [root@localhost /home/wukongcrm/72crm-java/src/main/resources/config]# vim undertow.txt ------------------------------------------------------------------------------ undertow.devMode=true # 端口 undertow.port=8090 # host undertow.host=127.0.0.1[root@localhost /home/wukongcrm/72crm-java]# cp pom.xml pom.xml.bak#备份 [root@localhost /home/wukongcrm/72crm-java]# vim pom.xml ------------------------------------------------------------------------------ < modelVersion> 4.0.0< /modelVersion> < groupId> com.kakarote< /groupId> < artifactId> crm9< /artifactId> < packaging> war< /packaging> #更改成war < version> 1.4.0< /version> < name> crm9-master< /name> #注释内容 < !--< dependencies> --> < !--< dependency> < groupId> com.jfinal< /groupId> < artifactId> jfinal-undertow< /artifactId> < version> 1.9< /version> --> < !--< /dependency> --> #取消注释 < dependency> < groupId> javax.servlet< /groupId> < artifactId> javax.servlet-api< /artifactId> < version> 4.0.1< /version> < scope> provided< /scope> < /dependency> [root@localhost /home/wukongcrm/72crm-java/src/main/java/com/kakarote/crm9]# vim Application.java #将其中所有内容都给注释了 ------------------------------------------------------------------------------ //package com.kakarote.crm9; //import com.jfinal.server.undertow.UndertowConfig; //import com.jfinal.server.undertow.UndertowServer; //import com.kakarote.crm9.common.config.JfinalConfig; //import com.kakarote.crm9.common.constant.BaseConstant; //public class Application //public static void main(String[] args) //UndertowConfig config=new UndertowConfig(JfinalConfig.class,"config/undertow.txt"); //config.setResourcePath("src/main/webapp,"+ BaseConstant.UPLOAD_PATH); // config.setServerName(BaseConstant.NAME); // UndertowServer.create(config).start(); // //

五、使用maven打包
在/home/wukongcrm/72crm-java 执行mvn clean package

【#yyds干货盘点#安装悟空CRM】六、打包将生成的cp /home/wukongcrm/72crm-java/target/ ROOT.war /home/tomcat/apache-tomcat-9.0.8/webapps/ 会自动生成 webapps/ROOT目录并有首页index.html,本机ip加8080,即可访问

    推荐阅读