- 浏览: 3514618 次
- 性别:
- 来自: 大连
博客专栏
-
使用Titanium Mo...
浏览量:37487
-
Cordova 3.x入门...
浏览量:604371
-
常用Java开源Libra...
浏览量:678147
-
搭建 CentOS 6 服...
浏览量:87312
-
Spring Boot 入...
浏览量:399849
-
基于Spring Secu...
浏览量:69080
-
MQTT入门
浏览量:90511
文章分类
最新评论
-
afateg:
阿里云的图是怎么画出来的?用什么工具?
各云服务平台的架构图 -
cbn_1992:
博主,采用jdbctoken也就是数据库形式之后,反复点击获取 ...
Spring Security OAuth2 Provider 之 数据库存储 -
ipodao:
写的很是清楚了,我找到一份中文协议:https://mcxia ...
MQTT入门(6)- 主题Topics -
Cavani_cc:
还行
MQTT入门(6)- 主题Topics -
fexiong:
博主,能否提供完整源码用于学习?邮箱:2199611997@q ...
TensorFlow 之 构建人物识别系统
(1)系统架构
查看内核
查看发布版本
查看CPU架构
(2)用户设置
添加用户
确认用户
删除用户
赋予root权限
用户一览
(3)网络设置
设置IP
卸载NestworkManager服务
关闭IPv6
(4)包管理设置
yum清理
yum更新
自动更新
自动查找最快镜像
添加repository
(5)设置vim
(6)安全设置
关闭SELinux
停止iptables
(7)系统运行情况
磁盘使用情况
内存使用情况
CPU和内存
(8)其他
修改hostname
本地语言化
停止不必要的服务
编码转换nkf(Network Kanji Filter)
安装gcc
安装PCRE
安装OpenSSL
NTP同步时间
GHOST: glibc vulnerability (CVE-2015-0235)
查看内核
# uname -s -r Linux 2.6.32-358.el6.x86_64
查看发布版本
# cat /etc/redhat-release CentOS release 6.4 (Final)
查看CPU架构
# arch x86_64(x86_64表示64位机器/i686表示32位机器) # getconf LONG_BIT 64
(2)用户设置
添加用户
# /usr/sbin/useradd user1 -d /home/user1 -G nobody # passwd user1 New password: 123456 Retype new password: 123456 passwd: all authentication tokens updated successfully.
确认用户
# id user1
删除用户
# userdel -r user1
赋予root权限
# usermod -G wheel hoge # vi /etc/pam.d/su auth required pam_wheel.so use_uid # <= 取消注释
用户一览
# cat /etc/passwd
(3)网络设置
设置IP
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE="eth0" OTPROTO="static" # <= HWADDR="00:0C:29:53:A5:AE" IPV6INIT="no" # <= NM_CONTROLLED="yes" ONBOOT="yes" TYPE="Ethernet" UUID="1ca6acf4-ebce-415a-a89b-bf89a67819ff" IPADDR="xxx.xxx.xx.xx" # <= NETMASK="255.255.255.0" # <= GATEWAY="xxx.xxx.xx.xx" # <= DNS1="xxx.xxx.xx.xx" # <= # service network restart Shutting down interface eth0: ...... Connection activated [ OK ] # ifconfig eth0 Link encap:Ethernet HWaddr 00:0C:29:2F:D5:58 inet addr:xxx.xxx.xx.xx Bcast:xxx.xxx.xx.xx Mask:255.255.255.0 ......
卸载NestworkManager服务
# chkconfig NetworkManager off # yum -y remove NetworkManager
关闭IPv6
# service ip6tables stop # chkconfig ip6tables off # echo "install ipv6 /bin/true" >> /etc/modprobe.d/disable-ipv6.conf # vi /etc/sysconfig/network NETWORKING_IPV6=no IPV6INIT=no # vi /etc/sysconfig/network-scripts/ifcfg-eth0 # shutdown -r now # lsmod | grep ipv6 没有ipv6模块 # netstat -an | grep ffff 没有:ffff:开始的IP # ifconfig 没有inet6 addr开始的文字
(4)包管理设置
yum清理
# yum clean all Loaded plugins: fastestmirror, security Cleaning repos: base extras updates Cleaning up Everything # yum makecache Loaded plugins: fastestmirror, security Determining fastest mirrors …………. Metadata Cache Created
yum更新
# yum -y update
自动更新
# yum -y install yum-cron # vi /etc/sysconfig/yum-cron CHECK_ONLY=yes DOWNLOAD_ONLY=yes # /etc/rc.d/init.d/yum-cron start # chkconfig yum-cron on # chkconfig --list yum-cron
自动查找最快镜像
# yum -y install yum-plugin-fastestmirror # vi /etc/yum/pluginconf.d/fastestmirror.conf enabled=0 ←0:无效 1:有效
添加repository
# vi /etc/yum.repos.d/CentOS-Base.repo # rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm # vi /etc/yum.repos.d/rpmforge.repo enabled=0 # yum --enablerepo=rpmforge install xxxx # rpm -Uvh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm # vi /etc/yum.repos.d/epel.repo enabled=0 # yum --enablerepo=epel install xxxx
(5)设置vim
# yum -y install vim-enhanced # vi /etc/profile alias vi='vim' # source /etc/profile # vi /etc/vimrc
(6)安全设置
关闭SELinux
# getenforce # setenforce 0 ←临时关闭 # vi /etc/sysconfig/selinux SELINUX=enforcing ↓ SELINUX=disabled
停止iptables
# /etc/rc.d/init.d/iptables stop iptables: Flushing firewall rules: [ OK ] iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Unloading modules: [ OK ] # chkconfig iptables off # chkconfig --list iptables iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
(7)系统运行情况
磁盘使用情况
# df -h # yum -y install sysstat # iostat
内存使用情况
# free -m
CPU和内存
# cat /proc/cpuinfo # cat /proc/meminfo
(8)其他
修改hostname
# hostname localhost.localdomain # vi /etc/sysconfig/network NETWORKING=yes #HOSTNAME=localhost.localdomain HOSTNAME=MyNewHostName NETWORKING_IPV6=no # vi /etc/hosts 127.0.0.1 MyNewHostName 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 #hosts文件每行格式:IP地址 hostname aliases #保留localhost的定义,因为Apache、Postfix、sendmail等服务会用到 # shutdown -r now # uname -a Linux MyNewHostName 2.6.32-358.el6.x86_64 ...... 临时修改 # hostname MyTmpHostName # /etc/init.d/network restart
本地语言化
# yum -y groupinstall "Japanese Support" # vi /etc/sysconfig/i18n LANG="en_US.UTF-8" ↓ LANG="ja_JP.UTF-8" # source /etc/sysconfig/i18n # echo $LANG ja_JP.UTF-8 # shutdown -r now
停止不必要的服务
# chkconfig --list | grep 3:on # service ip6tables stop # chkconfig ip6tables off
编码转换nkf(Network Kanji Filter)
# yum -y install nkf # vi readme.txt test 漢字 # nkf -g readme.txt UTF-8 (LF) # nkf -s --overwrite readme.txt # nkf -g readme.txt Shift_JIS (LF) # nkf -j --overwrite readme.txt # nkf -g readme.txt ISO-2022-JP (LF)
安装gcc
# rpm -qa gcc # yum -y install gcc gcc-c++ # gcc -v Using built-in specs. Target: i686-redhat-linux ………… gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
安装PCRE
# cd /usr/local/src # wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz # tar zxvf pcre-8.35.tar.gz # cd /usr/local/src/pcre-8.35 # ./configure --prefix=/usr/local/pcre/8.35 # make clean # make && make install # PATH=/usr/local/pcre/8.35/bin:$PATH # vi /etc/ld.so.conf /usr/local/pcre/8.35/lib ←末尾追加 # ldconfig # rpm -qa pcre pcre-7.8-6.el6.x86_64 # pcretest -C PCRE version 7.8 2008-09-05
安装OpenSSL
# cd /usr/local/src # wget http://www.openssl.org/source/openssl-1.0.1h.tar.gz # tar xzvf openssl-1.0.1h.tar.gz # cd openssl-1.0.1h # ./config shared -fPIC # make && make install # vi /etc/ld.so.conf /usr/local/ssl/lib ←末尾追加 # ldconfig # ldconfig -f /etc/ld.so.conf -vp|grep ssl/lib libssl.so.1.0.0 (libc6) => /usr/local/ssl/lib/libssl.so.1.0.0 libssl.so (libc6) => /usr/local/ssl/lib/libssl.so libcrypto.so.1.0.0 (libc6) => /usr/local/ssl/lib/libcrypto.so.1.0.0 libcrypto.so (libc6) => /usr/local/ssl/lib/libcrypto.so # /usr/local/ssl/bin/openssl version OpenSSL 1.0.1h 5 Jun 2014
NTP同步时间
引用
# yum -y install ntp
# mv /etc/ntp.conf /etc/ntp.conf.org
# vi /etc/ntp.conf
driftfile /var/lib/ntp/drift
server 0.jp.pool.ntp.org
server 1.jp.pool.ntp.org
server 2.jp.pool.ntp.org
server 3.jp.pool.ntp.org
# ntpdate 0.jp.pool.ntp.org
# /etc/init.d/ntpd start
# ntpq -p
# ntpstat
# mv /etc/ntp.conf /etc/ntp.conf.org
# vi /etc/ntp.conf
driftfile /var/lib/ntp/drift
server 0.jp.pool.ntp.org
server 1.jp.pool.ntp.org
server 2.jp.pool.ntp.org
server 3.jp.pool.ntp.org
# ntpdate 0.jp.pool.ntp.org
# /etc/init.d/ntpd start
# ntpq -p
# ntpstat
引用
CentOS默认安装NTP服务、NTP服务采用的是Server/Client的模式、一台机器同时是ntp服务器和ntp客户端。
同步方法:ntpdate、ntpd
ntpdate:强制修改系统时间(需要定期同步修正cpu tick)
[root@linux ~]# ntpdate time.ntp.org
[root@linux ~]# crontab -e
0 12 * * * * /usr/sbin/ntpdate time.ntp.org
每天12点强制同步一下时间
ntpd服务:修正系统时间并修正cpu tick
[root@linux ~]# vi /etc/ntp.conf
#restrict 127.0.0.1
restrict 192.168.21.0 mask 255.255.255.0 nomodify notrap
server -4 192.168.21.1 *** -4代表通过IPv4连接服务器
[root@linux ~]# /etc/init.d/ntpd start
[root@linux ~] # netstat -ln|grep 123
[root@linux ~] # ntpstat
每64秒与上源服务器同步一次,随着误差减小,逐步增加同步的间隔
需要确保是否有权限连接到服务器端。
先使用ntpdate强制同步时间,之后使用ntpd服务同步时间
安装
# yum -y install ntp
# ntpd --version
设置
# cp /etc/ntp.conf /etc/ntp.conf.org
# vi /etc/ntp.conf
手动同步
# ntpdate pool.ntp.org
启动ntpd
# service ntpd start
# chkconfig ntpd on
确认
# ntpq -p
# ntpstat
# ntpd -gq 强制更新
同步方法:ntpdate、ntpd
ntpdate:强制修改系统时间(需要定期同步修正cpu tick)
[root@linux ~]# ntpdate time.ntp.org
[root@linux ~]# crontab -e
0 12 * * * * /usr/sbin/ntpdate time.ntp.org
每天12点强制同步一下时间
ntpd服务:修正系统时间并修正cpu tick
[root@linux ~]# vi /etc/ntp.conf
#restrict 127.0.0.1
restrict 192.168.21.0 mask 255.255.255.0 nomodify notrap
server -4 192.168.21.1 *** -4代表通过IPv4连接服务器
[root@linux ~]# /etc/init.d/ntpd start
[root@linux ~] # netstat -ln|grep 123
[root@linux ~] # ntpstat
每64秒与上源服务器同步一次,随着误差减小,逐步增加同步的间隔
需要确保是否有权限连接到服务器端。
先使用ntpdate强制同步时间,之后使用ntpd服务同步时间
安装
# yum -y install ntp
# ntpd --version
设置
# cp /etc/ntp.conf /etc/ntp.conf.org
# vi /etc/ntp.conf
手动同步
# ntpdate pool.ntp.org
启动ntpd
# service ntpd start
# chkconfig ntpd on
确认
# ntpq -p
# ntpstat
# ntpd -gq 强制更新
GHOST: glibc vulnerability (CVE-2015-0235)
# yum update glibc # rpm -qa | grep glibc 2.12-1.149.el6_6.5
发表评论
-
logrotate入门
2018-02-07 08:36 1148日志文件对于开发运维是非常有用的,通过日志可以跟踪系统的使用以 ... -
Bash简要入门
2018-01-19 16:03 1040(一)Shell 和 Bash Bash ... -
搭建独立图像处理服务(Thumbor)
2017-08-16 10:26 7186Thumbor是基于Python的开源 ... -
搭建分布式文件存储服务(FastDFS)
2017-03-17 16:04 3188服务器规划如下: 引用-跟踪服务器 192.168. ... -
CentOS 安装 OpenAM
2017-01-23 15:59 3453官网:https://forgerock.org/openam ... -
CentOS 安装 Nexus
2016-12-08 15:21 1514前提:Java 1)下载 # cd /usr/local/s ... -
CentOS 安装 KVM
2016-09-07 15:55 1398KVM:Kernel-based Virtual Machin ... -
CentOS 安装 Android
2016-09-02 09:58 1783前提 # java -version # gradle -v ... -
CentOS 安装 Jenkins
2016-09-01 09:03 1975(1)安装Jenkins # java -version ... -
CentOS 安装 ELK
2016-07-19 10:02 2565ELK(Elasticsearch, Logstash, Ki ... -
CentOS 7 vs CentOS 6的不同
2015-07-20 14:36 6559升级 CentOS 6 到 CentOS 7 1)备份你的系 ... -
搭建 CentOS 6 服务器(15) - Cacti、Nagios
2015-07-20 13:17 2407(一)Cacti *** 需要先安装Apache + MySQ ... -
搭建VirtualBox + Vagrant + CoreOS + Docker环境
2015-05-08 14:26 10984构成图 引用 Container | Container | ... -
搭建 CentOS 6 服务器(13) - Keepalived、HAProxy、LVS
2015-04-15 15:47 3407(一)Keepalived (1)安装 # cd /usr/ ... -
搭建 CentOS 6 服务器(4) - TigerVNC
2015-04-15 09:34 2554安装GNOME桌面环境 # yum groupinstall ... -
搭建 CentOS 6 服务器(12) - squid、Varnish
2015-04-13 14:07 2333(一)squid 安装 # yum -y install e ... -
搭建 CentOS 6 服务器(11) - rsync、Amanda
2015-04-13 14:06 2404(一)rsync Server端 # yum install ... -
搭建 CentOS 6 服务器(10) - Samba
2015-04-13 14:04 2001(1)安装 # yum -y install samba ... -
搭建 CentOS 6 服务器(14) - CVS、SVN、Git
2015-04-08 10:29 2324(一)CVS 安装xinetd # rpm -q xinetd ... -
搭建 CentOS 6 服务器(9) - vsftpd、ProFTPD
2015-03-18 15:09 3174(一)vsftpd 安装 # yum -y install ...
相关推荐
这几天对服务器兴趣贼为浓厚,在虚拟机上装了一个CentOS7玩了玩,遇到过很多问题,比如网卡驱动设置,不能ping 等等问题,然后掏钱买个ECS搭服务器玩玩,下面就开始谢谢我的心路历程吧。 首先 买服务器,什么阿里云...
有了CentOS,那么如何搭建Git服务器呢? 1、首先需要安装Git,可以使用yum源在线安装: [root@localhost Desktop]# yum install -y git 2、创建一个git用户,用来运行git服务 # adduser git 3、初始化git仓库...
本课题基于VMware所开发,开发环境为Windows10,运行环境为CentOS7,编写语言为shell,运行环境最低配置要求2核4G。由于没有实体机去做真实企业服务器环境,因此下面的一系列实验在VMware虚拟机上实现,模拟企业物理...
安装的服务器centos7。 安装思路 1、通过rpm安装mongo的包,然后安装依赖的程序 2、配置mongo.service 3、配置mongo.conf,初始化的mongo是没有账号密码的,所以先初始化一个无需验证的mongo.conf。配置好之后,重启...
1. 安装规划 2....搭建服务器,安装centos1.7操作系统,jdk1.7,tomcat7,mysql5.6,redis3.07。 【课程计划】 第一节是系统安装,jdk1.7,tomcat7安装配置 第二节是mysql安装配置 第三节是redis安装配置
目的:搭建高可用、高性能的jsp集群 二、初始化系统 #init system 系统环境: CentOS 5.5(定制安装) 组件: Base Development Libraries Development Tools Editors Text-based Internet ./init_system.sh #此脚本...
【Centos7.6安装CDH6.1.0】手把手教你搭建CDH6.1.0主节点安装本地yum仓库中的CM组件从节点安装本地yum仓库中的CM组件初始化scm数据库启动CM服务跳转 主节点安装本地yum仓库中的CM组件 root用户下,在mini1上执行: #...
系统要求安装此存储库的系统要求如下: 情况细节笔记操作系统CentOS7.x,Amazon Linux2 选修的公有云AWS,Azure,阿里云,华为云,腾讯云选修的私有云KVM,VMware,VirtualBox,OpenStack 选修的服务器配置vCPU不...
搭建环境是centos7, 四核心16G内存三台机器 一个master节点,一个etcd,两台node,简单学习测试环境,很难用于实际生产 我用的ip 172.16.1.190 master .191 .192 node 安装前准备 机器要求 机器时间同步 各节点时间...
Fabric官方推荐的开发环境是基于Docker搭建的,需要安装以下开发环境:、、、、、。在连接服务器推荐使工具。 1、CentOS环境 安装git只需要执行yum install -y git,执行完命令之后设置两个额外的参数: git config --...
2.1前言本次环境搭建需要三台CentOS服务器(一主二从),然后在每台服务器中分别安装没有特殊说明,就是三台机器都需要执行。2.2 环境初始化2.2.1 检查
如题,本篇blog记录一下在Linux CentOS 7中安装PostgresSQL的整个过程以及数据库配置等,在Linux系统中,PostgreSQL的安装方式分两种,分别是: 1、二进制安装包安装 2、源码编译安装 由于我们没有什么特殊需求所在...
2、干净的服务器 centos7 不要宝塔 确保安全组全开 就是刚装的系统 3、域名解析到服务器上 安装 1、把 nginx 证书分别改名为 cert.pem 和 key.key 放入/sign/cert 中 2、把 one.sh 里面的你的域名四个大字修改成你...