Linux安装软件
安装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