Linux 服务器安装配置

13 篇文章 0 订阅

Linux 服务器安装配置

1、硬盘分区

Linux 服务器的硬盘分区结构如下图所示:


2、安装过程

(1) 安装 Ubuntu12.04Debian7.8amd64桌面版,建议安装英文版[debian7.8系统为例进行说明]

(2) 设置sources.list,修改/etc/apt/sources.list

## china
deb http://ftp.cn.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.cn.debian.org/debian/ wheezy main contrib non-free
deb http://ftp.cn.debian.org/debian/ wheezy-proposed-updates main contrib non-free deb-src http://ftp.cn.debian.org/debian/ wheezy-proposed-updates main contrib non-free 
deb http://ftp.cn.debian.org/debian/ wheezy-backports main contrib non-free
deb-src http://ftp.cn.debian.org/debian/ wheezy-backports main contrib non-free
# debian security updates
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
# multimedia
deb http://deb-multimedia.org wheezy main non-free
更新update:

# sudo apt-get update
(3) 安装工具软件

# sudo apt-get install mdadm sqlite3 mysql perl python python3 python3-pip vim
(4) 安装网络软件

# sudo apt-get install xinetd apache2 php5 php5-gd php5-curl php5-sqlite php5-mysql samba vsftpd tftp tftpd cvs git subversion openssh-server
(5) 安装开发软件及工具

# sudo apt-get install automake autoconf bison flex gcc gdb gettext libtool make ncurses-dev libcurl3-dev ncurses-dev ia32-libs lzop
(6)   为用户提供 sudo 权限,修改 /etc/sudoers ,在“ root    ALL=(ALL:ALL) ALL”后添加用户,该文件的权限应该为:  440
root    ALL=(ALL:ALL) ALL
usinas  ALL=(ALL:ALL) ALL
othername  ALL=(ALL:ALL) ALL
(7)   配置 vi / vim ,修改 /etc/vim/vimrc
#避免方向键显示为[A[B[C[D   
set nocompatible

#语法高亮                  
syntax on
(8)  配置 tftpd 服务, tftpd 服务依赖于 xinetd

tftpd默认是关闭的,手动编辑文件/etc/xinetd.d/tftp,输入以下内容

service tftp
{
  disable = no
  socket_type = dgram
  protocol = udp
  wait = yes
  user = nobody
  server = /usr/sbin/in.tftpd
  server_args = -s /tftp_root -c
  per_source = 11
  cps = 100 2
  flags = IPv4
}

/etc/xinetd.conf脚本将会执行/etc/xinetd.d下所有的脚本,不用再另外增加启动代码。

假设我们使用 /tftp_root 作为文件访问目录,设置该目录全面读写权限。

# mkdir /tftp_root
# chmod -R 777 /tftp_root

将/etc/inetd.conf关于tftp的部分注释掉,以免混淆。

#tftp        dgram     udp   wait  nobody    /usr/sbin/tcpd    /usr/sbin/in.tftpd /tftp_root

重启xinetd

# service xinetd reload && service xinetd restart

检查tftpd是否开启,端口69是否打开

# sudo netstat –anp
udp  0      0 0.0.0.0:69           0.0.0.0:*                       4141/xinetd

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值