可能用到的命令
- 查看系统信息:
cat /etc/redhat-release
- 查看安装包:
yum list xx*
- 查看文件大小:
du -h xxx
或du -b xxx
- 从服务器上下载文件:
scp username@servername:/remote_dir/filename local_dir
- 上传本地文件到服务器:
scp local_path/filename username@servername:remote_path
- 从服务器下载整个目录:
scp -r username@servername:/remote_dir/ local_dir
- 上传目录到服务器:
scp -r local_dir username@servername:remote_dir
安装环境
JDK
- 查看jdk列表:
yum list java*
- 安装特定版本:
yum -y install java-1.8.0-openjdk
- 查看安装结果:
java -v
MySql
安装
- 查看系统版本
$ cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
$ wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
- 安装MySql源
$ sudo rpm -Uvh mysql80-community-release-el8-1.noarch.rpm
- 检查是否安装成功
执行成功后会在/etc/yum.repos.d/目录下生成两个repo文件mysql-community.repo及 mysql-community-source.repo,并且通过yum repolist可以看到mysql相关资源
$ yum repolist enabled | grep "mysql.*-community.*"
!mysql-connectors-community/x86_64 MySQL Connectors Community 108
!mysql-tools-community/x86_64 MySQL Tools Community 90
!mysql80-community/x86_64 MySQL 8.0 Community Server 113
- 安装MySql
下载比较慢
$ sudo yum install mysql-community-server
修改密码
$ ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxxxx
开启远程访问<8.0
$ grant all privileges on *.* to 'root'@'%' identified by '你的密码' with grant option
开启远程访问>=8.0
-
$ CREATE USER 'root'@'%' IDENTIFIED BY 'pWVRIVJw3NJX%%lB';
$ GRANT ALL ON *.* TO 'root'@'%';
$ ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'xxxxxx
$ FLUSH PRIVILEGES;
Tomcat
- 现在本地下载Tomcat安装包
- 上传到server
- 解压安装包
- 配置环境变量:
# Tomcat
export TOMCAT_HOME=/usr/local/apache-tomcat-9.0.35
export PATH=$TOMCAT_HOME/bin:$PATH
- 增加域名解析conf/server.xml中Host节点添加新的Host
<Host appBase="webapps" autoDeploy="true" name="easyplan.cloud" unpackWARs="true">
<Alias>app.easyplan.cloud</Alias>
<Context debug="0" path="" privileged="true" />
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
pattern="%h %l %u %t" prefix="easyplan_access_log." resolveHosts="false"
suffix=".txt" />
</Host>
- 启动:
bin/start.sh
网友评论