linux虚拟机基础配置



配置网卡

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   (没有编译功能)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值