1、關閉SELinux和防火墻
打開SELinux文件并修改SELINUX參數(shù)
vim /etc/sysconfig/selinux
SELINUX=disabled
執(zhí)行如下命令?臨時關閉(不用重啟機器)
setenforce 0
關閉防火墻
systemctl stop firewalld.service
禁止防火墻開機啟動
systemctl disable firewalld.service
2俊扳、安裝Mysql
下載Mysql的repo源
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
安裝mysql-community-release-el7-5.noarch.rpm包
rpm -ivh mysql-community-release-el7-5.noarch.rpm
執(zhí)行安裝Mysql
yum install -y mysql-server
更改Mysql用戶權限
chown -R root:root /var/lib/mysql
重啟服務
systemctl restart mysql.service
查看Mysql是否開啟
systemctl status mysql.service
登陸Mysql并修改密碼
mysql -u root
mysql > use mysql;
mysql > update user set password=password(‘123456‘) where user=‘root‘;
mysql >? GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
mysql > flush privileges;
mysql > exit;
設置Mysql開機啟動
systemctl enable mysqld.service
打開my.ini
vim?/etc/my.ini
修改max_allowed_packet參數(shù)淑掌,無則添加(避免大數(shù)據(jù)寫入或者更新失斄揖)
max_allowed_packet = 20M
重啟服務
systemctl restart mysql.service
3、安裝Nginx
下載對應當前系統(tǒng)版本的Nginx包
wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
創(chuàng)建Nginx的yum倉庫
rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
下載并安裝Nginx
yum install -y nginx
開啟Nginx
systemctl start nginx.service
查看Nginx是否運行成功
systemctl status nginx.service
設置Nginx開機啟動
systemctl enable nginx.service
4、安裝JAVA8
查看JAVA版本(是否已安裝)
java -version
查看內(nèi)置JDK
rpm -qa | grep java
移除內(nèi)置JDK痰娱,按照依賴順序刪除(*號替換為需要刪除的文件名)
rpm -e --nodeps *