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安裝成功java
從 https://git.oschina.net/macplus/WCP/attach_files 下載 wcp.2.2.2.beta.zip test@debian78:~$ unzip 下載/wcp.2.2.2.beta.zipmysql
test@debian78:~$ sudo cp -r wcp/ /usr/local/apache-tomcat/webappsgit
test@debian78:~$ sudo apt-get install mysql-server root密碼: 123456
debain7.8的mysql版本5.5,而centos6.5的mysql版本是5.1 因此設置mysql的utf8編碼有點不同。web
注意: CentOS下要把apt-get改成yum sudo yum install mysql-serversql
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 密碼:111111apache