首页 > Personal > Linux > Centos 安装后续
2013
07-19

Centos 安装后续

安装163(http://mirrors.163.com/),sohu(http://mirrors.sohu.com/)源,加快yum速度。安装方法见各站网页帮助。

安装完成后首先更新到最新版本。

yum update

 

安装epel源

rpm –Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

 

yum update

 [centosplus]
 name=CentOS-$releasever - Plus
 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
 #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
 gpgcheck=1
 enabled=0

to

 [centosplus]
 name=CentOS-$releasever - Plus
 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
 #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
 gpgcheck=1
 enabled=1

安装bash自动完成工具 ,(系统可能已自动安装)。

yum install bash-completion

 

添加新用户,配置相应信息

useradd XXXXX     # 创建用户XXXX,用户列表在 /etc/passwd , /etc/shadow(密码) 中

groupadd group_name    # 添加组, 组列表在 /etc/group 中

useradd –G group_name XXXX    # 创建用户XXXX并加入组中,组用户列表在 /etc/gshadow 中

usermod –G group_name XXXX    # 将用户XXXX加入组中

passwd XXXX    # 修改密码

给用户XXXX添加root权限 /etc/sudoers中添加

%XXXX ALL=(ALL) ALL

 

修改域名解析配置文件 /etc/resolv.conf,添加解析服务器

nameserver xxx.xxx.xxx.xxx

 

修改hosts文件,配置地址主机名

127.0.0.1 localhost

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

xxx.xxx.xxx.xxx. server_name

 

修改机器名 /etc/sysconfig/network

HOSTNAME=name

CentOS7 使用 hostnamectl命令修改
hostnamectl set-hostname name
hostnamectl status 可以查询结果

 

修改sshd配置 /etc/ssh/sshd_config,增强安全性。

PermitRootLogin no

Port XXXXX

 

安装iptables

yum install iptables

配置iptables /etc/sysconfig/iptables 见

  iptables (2.5 KiB, 1,117 hits)

配置qos,脚本见

  tc_qos.sh (1,010 bytes, 958 hits)

 

安装wget,以方便下载

yum install wget

 

安装文本编辑工具vim

yum install vim

参考vim配置,修改vim配置。

 

安装iftop,网络查看工具(在epel源中)

yum install iftop

 

安装iperf, 网络测试工具(在epel源中)

yum install iperf

 

安装gcc,cgdb,

yum install gcc

yum install cgdb

 

安装httpd (如果需要)

yum install httpd

yum install mod_dav_svn (部署svn服务器需要)

yum install mod_ssl (https需要)

配置httpd,/etc/httpd/conf 和/etc/httpd/conf.d,配置见

  http.conf.tar.gz (17.3 KiB, 1,047 hits)

 

安装mysql(如果需要)

yum install mysql

yum install mysql-server

 

修改开机启动chkconfig

chkconfig –list [name]     # 查看 chkconfig 列表

chkconfig –add name    # 增加某项服务 如httpd,服务必须在/etc/ini.d/中

chkconfig –del name    # 删除某项服务 如httpd

chkconfig [–level levels] name    # 配置服务启动状态

chkconfig –level 2345 httpd on

chkconfig mysqld on

 

安装php(如果需要)

yum install php

yum install php-mysql(可能需要)

yum install php-gd(可能需要)

配置文件参见

  php.ini (67.5 KiB, 1,343 hits)

 

安装svn

yum install svn

 

安装git

yum install git

最后编辑:
作者:wy182000
这个作者貌似有点懒,什么都没有留下。

留下一个回复