ejforum论坛安装
解压到制定位置 [root@tomcat tmp]# tar -xf apache-tomcat-8.5.32.tar.gz -C /usr/local/ [root@tomcat tmp]# tar -xf jdk-8u191-linux-x64.tar.gz -C /usr/local/ 建立连接文件 [root@tomcat local]# ln -s jdk1.8.0_191 java [root@tomcat local]# ln -s apache-tomcat-8.5.32/ tomcat 配置java和tomcat环境 [root@tomcat usr]# vim /etc/profile ......... PATH=$JAVA_HOME/bin/$PATH:$HOME/bin export PATH .................. JAVA_HOME=/usr/local/java CATALINA_HOME=/usr/local/tomcat export JAVA_HOME 生成环境 [root@tomcat local]# source /etc/profile 启动tomcat [root@tomcat ~]# /usr/local/tomcat/bin/startup.sh Using CATALINA_BASE: /usr/local/tomcat Using CATALINA_HOME: /usr/local/tomcat Using CATALINA_TMPDIR: /usr/local/tomcat/temp Using JRE_HOME: /usr Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar Tomcat started. 查看java启动情况 [root@tomcat ~]# ps -ef | grep java root 1324 1 16 10:11 pts/0 00:00:02 /usr/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start root 1341 1119 0 10:11 pts/0 00:00:00 grep --color=auto java 查看tomcat启动情况 [root@tomcat ~]# ps -ef | grep tomcat root 1324 1 10 10:11 pts/0 00:00:02 /usr/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start root 1343 1119 0 10:11 pts/0 00:00:00 grep --color=auto tomcat 查看java端口 [root@tomcat ~]# ss -ntplu | grep java tcp LISTEN 0 100 :::8009 :::* users:(("java",pid=1324,fd=53)) tcp LISTEN 0 100 :::8080 :::* users:(("java",pid=1324,fd=48))
安装数据库mariadnb [root@tomcat tmp]# yum install -y mariadb-server [root@tomcat tmp]# systemctl start mariadb [root@tomcat tmp]# systemctl enable mariadb Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service. [root@tomcat tmp]# mysql -uroot -p 默认没有密码: 创建数据库ejforum MariaDB [(none)]> create database ejforum; Query OK, 1 row affected (0.00 sec) 赋予ejforumuser用户权限 MariaDB [(none)]> grant all on ejforum.* to "ejforumuser"@"localhost" identified by "123"; 连数据插件:解压(数据库与java连接文件) [root@tomcat tmp]# unzip mysql-connector-java-5.0.8.zip [root@tomcat tmp]# cd mysql-connector-java-5.0.8 [root@tomcat mysql-connector-java-5.0.8] # cp mysql-connector-java-5.0.8-bin.jar /usr/local/tomcat/bin/ 解压论坛包ejforum-2.3.zip [root@tomcat tmp]# unzip ejforum-2.3.zip [root@tomcat tmp]# mv ejforum-2.3 /usr/local/ [root@tomcat local]# cd ejforum-2.3/ [root@tomcat ejforum-2.3]# cd ejforum/ 将ejforum的文件拷贝到 ~/tomcat/webapps/ROOT 下 [root@tomcat ejforum]# cp -r ./* /usr/local/tomcat/webapps/ROOT/ 修改配置文件 [root@tomcat conf]# vim /usr/local/tomcat/webapps/ROOT/WEB-INF/conf/config.xml ..................... <database maxActive="10" maxIdle="10" minIdle="2" maxWait="10000" username="ejforumuser" password="123" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/ejforum?characterEncoding=gbk&autoReconnect=true&autoReconnectForPools=true&zeroDateTimeBehavior=convertToNull" sqlAdapter="sql.MysqlAdapter"/m ............................... 将论坛数据导入数据库中: [root@tomcat ~]# mysql ejforum < /usr/local/ejforum-2.3/install/script/easyjforum_mysql.sql [root@tomcat ~]# mysql -uroot -p Enter password: MariaDB [(none)]> show databases;; +--------------------+ | Database | +--------------------+ | information_schema | | ejforum | | mysql | | performance_schema | | test | +--------------------+ 5 rows in set (0.00 sec) MariaDB [(none)]> use ejforum; MariaDB [ejforum]> show tables; +-------------------+ | Tables_in_ejforum | +-------------------+ | ejf_admin_log | | ejf_archive_reply | | ejf_archive_topic | | ejf_attach | | ejf_backup_task | | ejf_board | | ejf_bookmark | | ejf_censor_log | | ejf_credits_log | | ejf_error_log | | ejf_friend | | ejf_group | | ejf_moderator_log | | ejf_reply | | ejf_report_log | | ejf_section | | ejf_short_msg | | ejf_topic | | ejf_trash_box | | ejf_user | | ejf_visit_stat | +-------------------+ 21 rows in set (0.00 sec) MariaDB [ejforum]> exit 停止tomcat服务: [root@tomcat ~]# /usr/local/tomcat/bin/shutdown.sh Using CATALINA_BASE: /usr/local/tomcat Using CATALINA_HOME: /usr/local/tomcat Using CATALINA_TMPDIR: /usr/local/tomcat/temp Using JRE_HOME: /usr/local/java Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar 启动tomcat服务 [root@tomcat ~]# /usr/local/tomcat/bin/startup.sh Using CATALINA_BASE: /usr/local/tomcat Using CATALINA_HOME: /usr/local/tomcat Using CATALINA_TMPDIR: /usr/local/tomcat/temp Using JRE_HOME: /usr/local/java Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar Tomcat started.