Linux安裝軟體

weixin_34292287發表於2017-07-09

安裝Apache

yum install httpd httpd-devel
service httpd start
/bin/systemctl start httpd.service
systemctl start httpd
service httpd status

安裝mysql

MySQL 依賴 libaio,所以先要安裝 libaio

yum search libaio # 檢索相關資訊
yum install libaio # 安裝依賴包

檢查 MySQL 是否已安裝

yum list installed | grep mysq
如果有,就先全部解除安裝,命令如下
yum -y remove mysql-libs.x86_64

下載 MySQL Yum Repository

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

安裝

新增 MySQL Yum Repository 到你的系統 repository 列表中,執行
yum localinstall mysql-community-release-el7-5.noarch.rpm

驗證下是否新增成功

yum repolist enabled | grep "mysql.-community."

選擇要啟用 MySQL 版本

檢視 MySQL 版本,執行

yum repolist all | grep mysql

可以通過類似下面的語句來啟動某些版本

yum-config-manager --disable mysql56-community
yum-config-manager --enable mysql57-community-dmr

通過 Yum 來安裝 MySQL

yum install mysql-community-server
rpm -qi mysql-community-server.x86_64 0:5.6.24-3.el7
whereis mysql

啟動和關閉 MySQL Server

啟動 MySQL Server

systemctl start mysqld

檢視 MySQL Server 狀態

systemctl status mysqld

關閉 MySQL Server

systemctl stop mysqld

防火牆設定

遠端訪問 MySQL, 需開放預設埠號 3306.

firewall-cmd --permanent --zone=public --add-port=3306/tcp
firewall-cmd --permanent --zone=public --add-port=3306/udp
firewall-cmd --reload

設定字符集

vim /etc/my.cnf
[mysqld]
character_set_server = utf8

[mysql]
default-character-set = utf8

檢視字符集

SHOW VARIABLES LIKE 'character%';

安裝jdk

yum search java|grep jdk
yum install java-1.7.0-openjdk
//安裝完之後,預設的安裝目錄是在: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75.x86_64

配置環境變數

vi /etc/profile

set java environment

JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75.x86_64
JRE_HOME=$JAVA_HOME/jre
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH

讓修改生效

source /etc/profile

如果javac無效

yum install java-devel

相關文章