Chinaunix首页 | 论坛 | 博客
  • 博客访问: 298753
  • 博文数量: 65
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 284
  • 用 户 组: 普通用户
  • 注册时间: 2013-11-21 15:10
文章分类
文章存档

2016年(3)

2015年(51)

2014年(8)

2013年(3)

分类: 嵌入式

2015-05-11 14:18:05

linux基本服务器配置

配置ip:
 ifconfig eth0 192.168.1.100  配置网卡0的ip地址为 192.168.1.100,这是临时配置,重启会失效
 ifconfig eth0 up    激活网卡0
 ifup eth0       激活网卡0
 ifconfig eht0 down    关闭网卡0
 ifdown eth0      关闭网卡0
 
 修改配置文件/etc/sysconfig/network-scripts/ifcfg-eht0
 DEVICE=eth0      //设备名称
 BOOTPROTO=static    //静态ip
 HAWADDR=00:0C:29:A2:8B:B8  //mac地址
 ONBOOT=yes      //开机启动
 IPADDR=192.168.1.100   //ip地址
 NETMASK=255.255.255.0   //mac地址
 GATEWAY=192.168.1.1    //局域网

 
搭建yum源:
 编辑配置文件/etc/yum.repos.d/*.repo
   {
   baseurl = file;///redhat5/
   enabled = 1
   gpgcheck = 1
   }
 yum命令:
 yum clean all     清除之前的配置
 yum list      列出当前yum源
 yum -y install      安装
 yum -y remove     卸载


搭建ftp服务器:
 安装  yum -y install ftp*
 默认的ftp文件上传目录在/var/ftp/
 
 ftp命令:
 get 获取文件
 put 上传文件 
 
 lftp命令:
 get 获取文件
 put 上传文件
 mirror -R 本地文件夹           上传文件夹
 mirror 远程文件夹 本地文件夹    下载文件夹
 
 
搭建tftp服务器
    安装 yum -y install *tftp*
         yum -y install xinetd.d
        
    配置:
    service tftp
    {
     socket_type  = dgram
     protocal  = udp
     wait   = yes
     user   = root
     server   = /usr/sbin/in.tftpd
     server_args  = -s /tftpboot  //tftp路径
     disable   = no                //tftp开启
     per_source  = 11
     cps    = 1002
     flags   = IPv4
    }
 重启xinetd.d服务  service xined.d restart

    uboot下的tftp命令:
    tftp 文件大小  起始地址  结束地址  文件名
   
   
搭建nfs服务器:
 安装 yum -y install nfs*
 
 配置文件/etc/exports
 nfs目录     能链接的ip     权限
 /nfsroot    192.168.1.*    (rw,sync,no_root_squash)
 
 查看目标机的共享
 showmount -e 192.168.1.10
 挂载nfs mount -t nfs 192.168.1.10:/weijie  /mnt

阅读(1809) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~