配置网卡
cd /etc/sysconfig/network-scripts/第一个文件更改 ONBOOT=YES
配置阿里云yum源
输入命令cd /etc/yum.repos.d/
输入命令
yum -y install wget
wget http://mirrors.aliyun.com/repo/Centos-7.repo
备份
mv CentOs-Base.repo CentOs-Base.repo.bak
切换阿里源
mv Centos-7.repo CentOs-Base.repo
执行yum源更新命令
yum clean all
yum makecache
yum update
安装httpd
yum install httpd
vi /etc/httpd/conf/httpd.conf 加入一句 ServerName localhost:80
httpd 启动
centos7防火墙
检查状态
firewall-cmd --state
systemctl stop firewalld.service
systemctl disable firewalld.service #禁止firewall开机启动
查看已经开放的端口:
firewall-cmd --list-ports
开启端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
CentOS 6.5关闭防火墙
[root@localhost ~]#servcie iptables stop --临时关闭防火墙
[root@localhost ~]#chkconfig iptables off --永久关闭防火墙
设置静态IP
/etc/sysconfig/network-scripts
BOOTPROTO=static
IPADDR=192.168.243.150 #IP
GATEWAY=192.168.243.1 #网关
NETMASK=255.255.255.0
安装Java
yum install java-1.8.0-openjdk.x86_64 && java (没有编译功能)