安裝jdk
更新jdk列表
yum -y list java*
安裝jdk1.8
yum install java-1.8.0-openjdk*
配置環(huán)境變量
ls -l /usr/lib/jvm
找到j(luò)dk執(zhí)行文件名字類似java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64
vi /etc/profile
在文件最后加入如下行
#setjavaenvironment
JAVA_HOME=/usr/lib/jvm/xxxxxx上面找到的jdk執(zhí)行文件名
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOMECLASSPATHPATH
刷新配置文件
source /etc/profile
驗(yàn)證
[root@zyapp1~]#java -version
openjdk version "1.8.0_171"
OpenJDKRuntimeEnvironment(build1.8.0_171-b10)
OpenJDK64-BitServerVM(build25.171-b10,mixedmode)
安裝nginx
https://www.cnblogs.com/songxingzhu/p/8568432.html
添加源
sudo rpm-Uvh
http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
安裝
sudo yum install -y nginx
設(shè)置開(kāi)機(jī)自動(dòng)運(yùn)行
sudo systemctlenable nginx.service
啟停
service nginx start
service nginx stop
前端項(xiàng)目文件存放路徑
/usr/share/nginx/html/
nginx的配置文件路徑
/etc/nginx/nginx.conf
Linux防火墻iptables的啟動(dòng)與關(guān)閉
1.關(guān)閉firewall
systemctl stop firewalld.service//停止firewall
systemctl disable firewalld.service//禁止firewall開(kāi)機(jī)啟動(dòng)
安裝rz
sudo yum install lrzsz -y
安裝wget
yum install wget
安裝vim
yum install vim-enhanced
Centos7安裝mysql5.7
配置yum源
下載mysql源安裝包
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
安裝mysql源
yum local install mysql57-community-release-el7-8.noarch.rpm
檢查mysql源是否安裝成功
yum repolistenabled|grep "mysql.*-community.*"
安裝mysql
yum install mysql-community-server
啟動(dòng)MySQL服務(wù)
systemctl start mysqld
查看MySQL的啟動(dòng)狀態(tài)
systemctl status mysqld
開(kāi)機(jī)啟動(dòng)
systemctl enable mysqld
systemctl daemon-reload
修改root默認(rèn)密碼
查看默認(rèn)密碼
grep 'temporarypassword' /var/log/mysqld.log
用默認(rèn)密碼登錄
mysql -uroot -p
mysql>Enterpassword:默認(rèn)密碼
修改默認(rèn)密碼
mysql>SETPASSWORD=PASSWORD('1q.Q%Q.q1');#上面的root是你的新密碼
如果修改簡(jiǎn)單密碼則需要先調(diào)整密碼規(guī)則
允許root遠(yuǎn)程登錄
GRANTALLPRIVILEGESON*.*TO'root'@'%'IDENTIFIEDBY'密碼'WITHGRANTOPTION;
修改字符集編碼UTF-8
查看當(dāng)前的字符編碼
show variables like 'char%';
檢測(cè)是否都是utf-8(filesystem除外),如果不是就得改
例如這個(gè)character_set_server一般是拉丁編碼
修改編碼
停數(shù)據(jù)庫(kù)
systemctl stop mysqld
//進(jìn)入my.cnf文件凭迹,一般是在etc路徑下
vim/etc/my.cnf
//加入要修改的字符集修改完:wq退出
在[mysqld]下追加:
character-set-server=utf8
在[mysql]下追加:
default-character-set=utf8
//重啟數(shù)據(jù)庫(kù)
systemctlstartmysqld