1.新ubuntu上安装
1.利用apt-get安装软件,也许没有需要的软件,所以要提前个更新源
1.命令 sudo apt-get update 更新软件包列表
2.安装java
1.命令 sudo apt-get install openjdk-6-jdk
3.安装tomcat
1.命令 sudo apt-get install tomcat6
4.安装mysql
1.命令 sudo apt-get install mysql-server
5.安装nginx
1.命令 sudo apt-get install nginx
2.配置安装的软件
1.tomcat
1.配置端口,日志记录位置
2.配置项目的默认路径 <Context docBase="wan" path=""/>
2.mysql
1.配置忽略大小写,在[mysqld]的配置区 lower_case_table_names=1
2.设置编码格式[mysqld]和[client] 里加上 default-character-set=utf8
3.导入数据库 source /home/wan/xxx.sql
4.新建用户,并将权限付给新用户
grant all privileges on *.* to user@"127.0.0.1" identified by pass
user 指的是用户名 例如:wan
pass 指的是密码 例如:123
*.* 第一个*可以写成数据库的名字,就是将这个数据库的权限给user这个用户
3.nginx
按需求配。
3.用到的命令
1.创建软连接 ln -s 源路径 目标路径
2.远程复制 pscp -r [email protected]:/home/wan/源路径 目标路径
2.远程ftp wget http://119.xxx.xxx.xxx:8080/source/sj.rar
3.tomcat复制,改端口和shutdown的端口,好像还有 Connector port端口也要改
查看端口使用情况 lsof -i,改/etc/init.d/tomcat6中的文件路径
4.更改文件夹权限 sudo chown wan:wan palyball -R
5.数据库备份 mysql -u"root" -h"127.0.0.1" -p"123" wan > wan.201107111127.sql
4.安装绿色版的tomcat6
1.wget
2.tar -zxvf apache-tomcat-6.0.29.tar.gz