1、安装tomcat6
test@debian78:~$ wget http://apache.fayea.com/tomcat/tomcat-6/v6.0.44/bin/apache-tomcat-6.0.44.tar.gz
test@debian78:~$ tar xzvf apache-tomcat-6.0.44.tar.gz
test@debian78:~$ sudo mv apache-tomcat-6.0.44 /usr/local/apache-tomcat
test@debian78:~$ sudo chown -R root:root /usr/local/apache-tomcat
test@debian78:~$ sudo vi /etc/profile
末尾添加:
export CATALINA_HOME=/usr/local/apache-tomcat
test@debian78:~$ sudo cp /usr/local/apache-tomcat/bin/catalina.sh /etc/init.d/tomcat
test@debian78:~$ vi /etc/init.d/tomcat
+84 CATALINA_HOME=/usr/local/apache-tomcat
+85 JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
test@debian78:~$ sudo /etc/init.d/tomcat start
test@debian78:~$ curl http://localhost:8080/
看到html内容,表示tomcat安装成功
2、安装wcp webapp
从 https://git.oschina.net/macplus/WCP/attach_files 下载 wcp.2.2.2.beta.zip test@debian78:~$ unzip 下载/wcp.2.2.2.beta.zip
test@debian78:~$ sudo cp -r wcp/ /usr/local/apache-tomcat/webapps
3、安装mysql
test@debian78:~$ sudo apt-get install mysql-server
root密码: 123456
debain7.8的mysql版本5.5,而centos6.5的mysql版本是5.1 所以设置mysql的utf8编码有点不一样。
注意: CentOS下要把apt-get改为yum sudo yum install mysql-server
test@debian78:~$ sudo vi /etc/mysql/my.cnf
+22 default-character-set=utf8
+109 lower_case_table_names=1
+110 character_set_server=utf8
+111 collation_server=utf8_general_ci
test@debian78:~$ sudo /etc/init.d/mysql restart
test@debian78:~$ wget https://git.oschina.net/macplus/WCP/raw/master/database/wcp2.2.2.sql
test@pqa-001:~$ mysql -uroot -p
mysql> create database wcp2 character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| wcp2 |
+--------------------+
4 rows in set (0.00 sec)
mysql> use wcp2;
Database changed
mysql> show tables;
Empty set (0.00 sec)
mysql> source wcp2.2.2.sql;
...很多行
Query OK, 0 rows affected (0.09 sec)
mysql> grant all privileges on wcp2.* to mywcp@localhost identified by 'wcp123456';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
test@debian78:~$ sudo vi /usr/local/apache-tomcat/webapps/wcp/WEB-INF/classes/jdbc.properties
1 jdbc.driverClassName=com.mysql.jdbc.Driver
2 jdbc.url=jdbc\:mysql\://127.0.0.1\:3306/wcp2
3 jdbc.username=root
4 jdbc.password=123456
test@debian78:~$ sudo /etc/init.d/tomcat stop
test@debian78:~$ sudo /etc/init.d/tomcat start
浏览器访问: http://localhost:8080/wcp 系统管理员: sysadmin 密码:111111
来源:oschina
链接:https://my.oschina.net/u/1990460/blog/486782