可能用到的命令
- 查看系統(tǒng)信息:
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
安裝環(huán)境
JDK
- 查看jdk列表:
yum list java*
- 安裝特定版本:
yum -y install java-1.8.0-openjdk
- 查看安裝結(jié)果:
java -v
MySql
安裝
- 查看系統(tǒng)版本
$ 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
- 檢查是否安裝成功
執(zhí)行成功后會在/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
- 現(xiàn)在本地下載Tomcat安裝包
- 上傳到server
- 解壓安裝包
- 配置環(huán)境變量:
# Tomcat
export TOMCAT_HOME=/usr/local/apache-tomcat-9.0.35
export PATH=$TOMCAT_HOME/bin:$PATH
- 增加域名解析conf/server.xml中Host節(jié)點添加新的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