Linux 服务器安装配置
1、硬盘分区
Linux 服务器的硬盘分区结构如下图所示:
2、安装过程
(1) 安装 Ubuntu12.04或Debian7.8(amd64)桌面版,建议安装英文版。[以debian7.8系统为例进行说明]
(2) 设置sources.list,修改/etc/apt/sources.list
更新update:## 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
(3) 安装工具软件# sudo apt-get update
(4) 安装网络软件# sudo apt-get install mdadm sqlite3 mysql perl python python3 python3-pip vim
(5) 安装开发软件及工具# sudo apt-get install xinetd apache2 php5 php5-gd php5-curl php5-sqlite php5-mysql samba vsftpd tftp tftpd cvs git subversion openssh-server
(6) 为用户提供 sudo 权限,修改 /etc/sudoers ,在“ root ALL=(ALL:ALL) ALL”后添加用户,该文件的权限应该为: 440# sudo apt-get install automake autoconf bison flex gcc gdb gettext libtool make ncurses-dev libcurl3-dev ncurses-dev ia32-libs lzop
(7) 配置 vi / vim ,修改 /etc/vim/vimrcroot ALL=(ALL:ALL) ALL usinas ALL=(ALL:ALL) ALL othername ALL=(ALL:ALL) ALL
(8) 配置 tftpd 服务, tftpd 服务依赖于 xinetd#避免方向键显示为[A[B[C[D set nocompatible #语法高亮 syntax on
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