初玩Linux部署项目

1,先安装虚拟机
2,安装centOS
3,安装mysql

安装mysql客户端:
yum install mysql

安装mysql 服务器端:
yum install mysql-server

yum install mysql-devel

启动mysql服务:
service mysqld start

登录:
mysql -u root -p输入密码即可。
忘记密码:
service mysqld stop

mysqld_safe --user=root --skip-grant-tables

mysql -u root

use mysql

update user set password=password("new_pass") where user="root";

flush privileges;


开机启动:
chkconfig -add mysqld,查看开机启动设置是否成功chkconfig --list | grep mysql*

数据库字符集设置
mysql配置文件/etc/my.cnf中加入default-character-set=utf8;

用SQLyog(海豚)工具连,会发现连不上,执行

update user set host='%' where user='root' and host='localhost';

ok!!!



4,如果要用WinSCP进行文件传送
或putty_连接linux,
要先开ssh服务
并且把防火墙关掉。

service sshd start

service iptables stop
(打开iptables的配置文件:vi /etc/sysconfig/iptables)

5,远程连接mysql
GRANT ALL PRIVILEGES ON *.* TO 'root2'@'%'IDENTIFIED BY 'root2' WITH GRANT OPTION;
commit;


6,用yum安装jdk
yum -y install java-1.6.0-openjdk*

7,放tomcat(把文件的所有权限勾上)


然后至bin路径下,sh startup.sh 或者 ./startup.sh 启动

tail -f ../logs/catalina.out

8,关tomcat(直接杀进程)

ps -ef | grep tomcat
kill -9 11111

9,别的ip访问你的(局域网)

先设备桥接

vi /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR=192.168.0.10
NETMASK=255.255.255.0
GATEWAY=192.168.0.1

搞定!

下面是Seafile的运用,一种云存储;

下面是官网的安装说明。

http://manual-cn.seafile.com/deploy/using_mysql.html

原文地址:https://www.cnblogs.com/xiexy/p/4081326.html